diff --git a/android/app/src/main/assets/capacitor.plugins.json b/android/app/src/main/assets/capacitor.plugins.json index ebb480c7cff..bae58e04937 100644 --- a/android/app/src/main/assets/capacitor.plugins.json +++ b/android/app/src/main/assets/capacitor.plugins.json @@ -37,7 +37,7 @@ }, { "pkg": "@logseq/capacitor-file-sync", - "classpath": "com.logseq.app.FileSyncPlugin" + "classpath": "com.logseq.app.filesync.FileSyncPlugin" }, { "pkg": "capacitor-voice-recorder", diff --git a/package.json b/package.json index 38122fb3f3b..a1953f915ca 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "@capacitor/status-bar": "^4.0.0", "@excalidraw/excalidraw": "0.10.0", "@kanru/rage-wasm": "0.2.1", - "@logseq/capacitor-file-sync": "0.0.6", + "@logseq/capacitor-file-sync": "0.0.10", "@logseq/react-tweet-embed": "1.3.1-1", "@sentry/react": "^6.18.2", "@sentry/tracing": "^6.18.2", diff --git a/src/main/frontend/fs/sync.cljs b/src/main/frontend/fs/sync.cljs index 60f13c6dc87..966023a0ae0 100644 --- a/src/main/frontend/fs/sync.cljs +++ b/src/main/frontend/fs/sync.cljs @@ -820,13 +820,15 @@ (set! graph-uuid' graph-uuid) (set! private-key secret-key) (set! public-key' public-key) - (p->c (.setEnv mobile-util/file-sync (clj->js {:env (if prod? "prod" "dev") + (p->c (.setEnv mobile-util/file-sync (clj->js {:graphUUID graph-uuid + :env (if prod? "prod" "dev") :secretKey secret-key :publicKey public-key})))) - (c (.getLocalAllFilesMeta mobile-util/file-sync (clj->js {:basePath base-path}))))] + (let [r (c (.getLocalAllFilesMeta mobile-util/file-sync (clj->js {:graphUUID graph-uuid + :basePath base-path}))))] (if (instance? ExceptionInfo r) r (->> (.-result r) @@ -836,10 +838,11 @@ (get metadata "encryptedFname") (get metadata "mtime") false nil))) set))))) - (c (.getLocalFilesMeta mobile-util/file-sync - (clj->js {:basePath base-path + (clj->js {:graphUUID graph-uuid + :basePath base-path :filePaths filepaths}))))] (assert (not (instance? ExceptionInfo r)) "get-local-files-meta shouldn't return exception") (->> (.-result r) @@ -849,9 +852,10 @@ (get metadata "encryptedFname") (get metadata "mtime") false nil))) set)))) - (c (.renameLocalFile mobile-util/file-sync - (clj->js {:basePath base-path + (clj->js {:graphUUID graph-uuid + :basePath base-path :from from :to to})))) @@ -874,10 +878,11 @@ :token token})))))] r))) - (c (.deleteLocalFiles mobile-util/file-sync - (clj->js {:basePath base-path + (clj->js {:graphUUID graph-uuid + :basePath base-path :filePaths filepaths})))))] r))) @@ -907,16 +912,18 @@ r (get (js->clj r) "txid"))))) - (c (.encryptFnames mobile-util/file-sync - (clj->js {:filePaths fnames}))))] + (clj->js {:graphUUID graph-uuid + :filePaths fnames}))))] (if (instance? ExceptionInfo r) (.-cause r) (get (js->clj r) "value"))))) - (c (.decryptFnames mobile-util/file-sync - (clj->js {:filePaths fnames}))))] + (clj->js {:graphUUID graph-uuid + :filePaths fnames}))))] (if (instance? ExceptionInfo r) (ex-info "decrypt-failed" {:fnames fnames} (ex-cause r)) (get (js->clj r) "value")))))) diff --git a/yarn.lock b/yarn.lock index 5dbc1298998..a9c659ef482 100644 --- a/yarn.lock +++ b/yarn.lock @@ -480,10 +480,10 @@ resolved "https://registry.yarnpkg.com/@kanru/rage-wasm/-/rage-wasm-0.2.1.tgz#dd8fdd3133992c42bf68c0086d8cad40a13bc329" integrity sha512-sYi4F2mL6Mpcz7zbS4myasw11xLBEbgZkDMRVg9jNxTKt6Ct/LT7/vCHDmEzAFcPcPqixD5De6Ql3bJijAX0/w== -"@logseq/capacitor-file-sync@0.0.6": - version "0.0.6" - resolved "https://registry.yarnpkg.com/@logseq/capacitor-file-sync/-/capacitor-file-sync-0.0.6.tgz#e738ec08c1249ad96560c5f5090a60f4f49d679a" - integrity sha512-gnSAm2x9jNAtlQP4r8S5P2a7vRYZkGDIh6wX1/UgldDHPaY//+SWYvtFQQeDEJ1rLU/S+UYnPndlQdMDpu6mqA== +"@logseq/capacitor-file-sync@0.0.10": + version "0.0.10" + resolved "https://registry.yarnpkg.com/@logseq/capacitor-file-sync/-/capacitor-file-sync-0.0.10.tgz#36575b369a4fff83e71b282c19cc948d60309809" + integrity sha512-O4bCHLym7+DnqCoO57D1Ii6ec6tcZBjp8SzFEYCKE9mvHsX5aFmCA61XUHgNEFovocQ3gBMJvi6GKSJBcGwT3Q== "@logseq/react-tweet-embed@1.3.1-1": version "1.3.1-1"