@capgo/capacitor-updater 6.4.1 → 6.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async setStatsUrl(options) {\n console.warn(\"Cannot setStatsUrl in web\", options);\n return;\n }\n async setUpdateUrl(options) {\n console.warn(\"Cannot setUpdateUrl in web\", options);\n return;\n }\n async setChannelUrl(options) {\n console.warn(\"Cannot setChannelUrl in web\", options);\n return;\n }\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return { bundle: BUNDLE_BUILTIN };\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IAAA;IACA;IACA;IACA;IACA;AAEK,UAAC,gBAAgB,GAAGA,mBAAc,CAAC,kBAAkB,EAAE;IAC5D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;IAC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AK,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/H,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,QAAQ,CAAC,MAAM,EAAE;IAC3B,QAAQ,OAAO,CAAC,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC;IACvD,QAAQ,OAAO;IACf,KAAK;IACL,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAClD,QAAQ,OAAO;IACf,KAAK;IACL;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { registerPlugin } from \"@capacitor/core\";\nconst CapacitorUpdater = registerPlugin(\"CapacitorUpdater\", {\n web: () => import(\"./web\").then((m) => new m.CapacitorUpdaterWeb()),\n});\nexport * from \"./definitions\";\nexport { CapacitorUpdater };\n//# sourceMappingURL=index.js.map","/*\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at https://mozilla.org/MPL/2.0/.\n */\nimport { WebPlugin } from \"@capacitor/core\";\nconst BUNDLE_BUILTIN = {\n status: \"success\",\n version: \"\",\n downloaded: \"1970-01-01T00:00:00.000Z\",\n id: \"builtin\",\n checksum: \"\",\n};\nexport class CapacitorUpdaterWeb extends WebPlugin {\n async setStatsUrl(options) {\n console.warn(\"Cannot setStatsUrl in web\", options);\n return;\n }\n async setUpdateUrl(options) {\n console.warn(\"Cannot setUpdateUrl in web\", options);\n return;\n }\n async setChannelUrl(options) {\n console.warn(\"Cannot setChannelUrl in web\", options);\n return;\n }\n async download(options) {\n console.warn(\"Cannot download version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async next(options) {\n console.warn(\"Cannot set next version in web\", options);\n return BUNDLE_BUILTIN;\n }\n async isAutoUpdateEnabled() {\n console.warn(\"Cannot get isAutoUpdateEnabled in web\");\n return { enabled: false };\n }\n async set(options) {\n console.warn(\"Cannot set active bundle in web\", options);\n return;\n }\n async getDeviceId() {\n console.warn(\"Cannot get ID in web\");\n return { deviceId: \"default\" };\n }\n async getBuiltinVersion() {\n console.warn(\"Cannot get version in web\");\n return { version: \"default\" };\n }\n async getPluginVersion() {\n console.warn(\"Cannot get plugin version in web\");\n return { version: \"default\" };\n }\n async delete(options) {\n console.warn(\"Cannot delete bundle in web\", options);\n }\n async list() {\n console.warn(\"Cannot list bundles in web\");\n return { bundles: [] };\n }\n async reset(options) {\n console.warn(\"Cannot reset version in web\", options);\n }\n async current() {\n console.warn(\"Cannot get current bundle in web\");\n return { bundle: BUNDLE_BUILTIN, native: \"0.0.0\" };\n }\n async reload() {\n console.warn(\"Cannot reload current bundle in web\");\n return;\n }\n async getLatest() {\n console.warn(\"Cannot getLatest current bundle in web\");\n return {\n version: \"0.0.0\",\n message: \"Cannot getLatest current bundle in web\",\n };\n }\n async setChannel(options) {\n console.warn(\"Cannot setChannel in web\", options);\n return {\n status: \"error\",\n error: \"Cannot setChannel in web\",\n };\n }\n async unsetChannel(options) {\n console.warn(\"Cannot unsetChannel in web\", options);\n return;\n }\n async setCustomId(options) {\n console.warn(\"Cannot setCustomId in web\", options);\n return;\n }\n async getChannel() {\n console.warn(\"Cannot getChannel in web\");\n return {\n status: \"error\",\n error: \"Cannot getChannel in web\",\n };\n }\n async notifyAppReady() {\n console.warn(\"Cannot notify App Ready in web\");\n return { bundle: BUNDLE_BUILTIN };\n }\n async setMultiDelay(options) {\n console.warn(\"Cannot setMultiDelay in web\", options === null || options === void 0 ? void 0 : options.delayConditions);\n return;\n }\n async setDelay(option) {\n console.warn(\"Cannot setDelay in web\", option);\n return;\n }\n async cancelDelay() {\n console.warn(\"Cannot cancelDelay in web\");\n return;\n }\n}\n//# sourceMappingURL=web.js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wBAAwB,EAAE,MAAM,CAAC;IACtD,QAAQ;IACR;IACA,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,OAAO,CAAC,IAAI,CAAC,2BAA2B,CAAC;IACjD,QAAQ;IACR;IACA;;;;;;;;;;;;;;;"}
@@ -719,10 +719,16 @@ extension CustomError: LocalizedError {
719
719
  }
720
720
  }
721
721
 
722
+ private func verifyChecksum(file: URL, expectedHash: String) -> Bool {
723
+ let actualHash = calcChecksumV2(filePath: file)
724
+ return actualHash == expectedHash
725
+ }
726
+
722
727
  public func downloadManifest(manifest: [ManifestEntry], version: String, sessionKey: String) throws -> BundleInfo {
723
728
  let id = self.randomString(length: 10)
724
729
  print("\(self.TAG) downloadManifest start \(id)")
725
730
  let destFolder = self.getBundleDirectory(id: id)
731
+ let builtinFolder = Bundle.main.bundleURL.appendingPathComponent("public")
726
732
 
727
733
  try FileManager.default.createDirectory(at: cacheFolder, withIntermediateDirectories: true, attributes: nil)
728
734
  try FileManager.default.createDirectory(at: destFolder, withIntermediateDirectories: true, attributes: nil)
@@ -751,25 +757,25 @@ extension CustomError: LocalizedError {
751
757
  let cacheFileName = "\(fileHash)_\(fileNameWithoutPath)"
752
758
  let cacheFilePath = cacheFolder.appendingPathComponent(cacheFileName)
753
759
  let destFilePath = destFolder.appendingPathComponent(fileName)
760
+ let builtinFilePath = builtinFolder.appendingPathComponent(fileName)
754
761
 
755
762
  // Create necessary subdirectories in the destination folder
756
763
  try FileManager.default.createDirectory(at: destFilePath.deletingLastPathComponent(), withIntermediateDirectories: true, attributes: nil)
757
764
 
758
765
  dispatchGroup.enter()
759
766
 
760
- if FileManager.default.fileExists(atPath: cacheFilePath.path) {
761
- // File exists in cache, copy to destination
762
- do {
763
- try FileManager.default.copyItem(at: cacheFilePath, to: destFilePath)
764
- print("\(self.TAG) downloadManifest \(fileName) copy from cache \(id)")
765
- completedFiles += 1
766
- self.notifyDownload(id: id, percent: self.calcTotalPercent(percent: Int((Double(completedFiles) / Double(totalFiles)) * 100), min: 10, max: 70))
767
- dispatchGroup.leave()
768
- } catch {
769
- downloadError = error
770
- print("\(self.TAG) downloadManifest \(fileName) cache error \(id): \(error)")
771
- dispatchGroup.leave()
772
- }
767
+ if FileManager.default.fileExists(atPath: builtinFilePath.path) && verifyChecksum(file: builtinFilePath, expectedHash: fileHash) {
768
+ try FileManager.default.copyItem(at: builtinFilePath, to: destFilePath)
769
+ print("\(self.TAG) downloadManifest \(fileName) using builtin file \(id)")
770
+ completedFiles += 1
771
+ self.notifyDownload(id: id, percent: self.calcTotalPercent(percent: Int((Double(completedFiles) / Double(totalFiles)) * 100), min: 10, max: 70))
772
+ dispatchGroup.leave()
773
+ } else if FileManager.default.fileExists(atPath: cacheFilePath.path) && verifyChecksum(file: cacheFilePath, expectedHash: fileHash) {
774
+ try FileManager.default.copyItem(at: cacheFilePath, to: destFilePath)
775
+ print("\(self.TAG) downloadManifest \(fileName) copy from cache \(id)")
776
+ completedFiles += 1
777
+ self.notifyDownload(id: id, percent: self.calcTotalPercent(percent: Int((Double(completedFiles) / Double(totalFiles)) * 100), min: 10, max: 70))
778
+ dispatchGroup.leave()
773
779
  } else {
774
780
  // File not in cache, download, decompress, and save to both cache and destination
775
781
  AF.download(downloadUrl).responseData { response in
@@ -973,7 +979,7 @@ extension CustomError: LocalizedError {
973
979
  let finalPath = tempDataPath.deletingLastPathComponent().appendingPathComponent("\(id)")
974
980
  do {
975
981
  var checksumDecrypted = checksum
976
- if !self.hasOldPrivateKeyPropertyInConfig {
982
+ if !self.hasOldPrivateKeyPropertyInConfig && !sessionKey.isEmpty {
977
983
  try self.decryptFileV2(filePath: tempDataPath, sessionKey: sessionKey, version: version)
978
984
  } else {
979
985
  try self.decryptFile(filePath: tempDataPath, sessionKey: sessionKey, version: version)
@@ -1334,13 +1340,13 @@ extension CustomError: LocalizedError {
1334
1340
  }
1335
1341
  case let .failure(error):
1336
1342
  if let data = response.data, let bodyString = String(data: data, encoding: .utf8) {
1337
- if (bodyString.contains("channel_not_found") && response.response?.statusCode == 400 && !self.defaultChannel.isEmpty) {
1343
+ if bodyString.contains("channel_not_found") && response.response?.statusCode == 400 && !self.defaultChannel.isEmpty {
1338
1344
  getChannel.channel = self.defaultChannel
1339
1345
  getChannel.status = "default"
1340
1346
  return
1341
1347
  }
1342
1348
  }
1343
-
1349
+
1344
1350
  print("\(self.TAG) Error get Channel", response.value ?? "", error)
1345
1351
  getChannel.message = "Error get Channel \(String(describing: response.value)))"
1346
1352
  getChannel.error = "response_error"
@@ -43,7 +43,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
43
43
  CAPPluginMethod(name: "getBuiltinVersion", returnType: CAPPluginReturnPromise)
44
44
  ]
45
45
  public var implementation = CapacitorUpdater()
46
- private let PLUGIN_VERSION: String = "6.4.1"
46
+ private let PLUGIN_VERSION: String = "6.6.3"
47
47
  static let updateUrlDefault = "https://plugin.capgo.app/updates"
48
48
  static let statsUrlDefault = "https://plugin.capgo.app/stats"
49
49
  static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
@@ -125,7 +125,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
125
125
  if resetWhenUpdate {
126
126
  self.cleanupObsoleteVersions()
127
127
  }
128
-
128
+
129
129
  // Load the server
130
130
  // This is very much swift specific, android does not do that
131
131
  // In android we depend on the serverBasePath capacitor property
@@ -136,7 +136,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
136
136
  if !self.initialLoad() {
137
137
  print("\(self.implementation.TAG) unable to force reload, the plugin might fallback to the builtin version")
138
138
  }
139
-
139
+
140
140
  let nc = NotificationCenter.default
141
141
  nc.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
142
142
  nc.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
@@ -291,7 +291,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
291
291
  DispatchQueue.global(qos: .background).async {
292
292
  do {
293
293
  let next = try self.implementation.download(url: url!, version: version, sessionKey: sessionKey)
294
- if !self.implementation.hasOldPrivateKeyPropertyInConfig {
294
+ if !self.implementation.hasOldPrivateKeyPropertyInConfig && !sessionKey.isEmpty {
295
295
  checksum = try self.implementation.decryptChecksum(checksum: checksum, version: version)
296
296
  }
297
297
  if (checksum != "" || self.implementation.publicKey != "") && next.getChecksum() != checksum {
@@ -698,7 +698,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
698
698
  }
699
699
  self.notifyListeners("noNeedUpdate", data: ["bundle": current.toJSON()])
700
700
  self.sendReadyToJs(current: current, msg: msg)
701
- print("\(self.implementation.TAG) endBackGroundTaskWithNotif \(msg)")
701
+ print("\(self.implementation.TAG) endBackGroundTaskWithNotif \(msg) current: \(current.getVersionName()) latestVersionName: \(latestVersionName)")
702
702
  self.endBackGroundTask()
703
703
  }
704
704
 
@@ -775,7 +775,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
775
775
  self.endBackGroundTaskWithNotif(msg: "Latest version is in error state. Aborting update.", latestVersionName: latestVersionName, current: current)
776
776
  return
777
777
  }
778
- if !self.implementation.hasOldPrivateKeyPropertyInConfig {
778
+ if !self.implementation.hasOldPrivateKeyPropertyInConfig && !sessionKey.isEmpty {
779
779
  res.checksum = try self.implementation.decryptChecksum(checksum: res.checksum, version: latestVersionName)
780
780
  }
781
781
  if res.checksum != "" && next.getChecksum() != res.checksum && res.manifest == nil {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "6.4.1",
3
+ "version": "6.6.3",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",
@@ -56,25 +56,25 @@
56
56
  "prepublishOnly": "npm run build"
57
57
  },
58
58
  "devDependencies": {
59
- "@capacitor/android": "^6.0.0",
60
- "@capacitor/cli": "^6.0.0",
61
- "@capacitor/core": "^6.0.0",
59
+ "@capacitor/android": "^6.2.0",
60
+ "@capacitor/cli": "^6.2.0",
61
+ "@capacitor/core": "^6.2.0",
62
62
  "@capacitor/docgen": "^0.3.0",
63
- "@capacitor/ios": "^6.0.0",
63
+ "@capacitor/ios": "^6.2.0",
64
64
  "@ionic/eslint-config": "^0.4.0",
65
65
  "@ionic/prettier-config": "^4.0.0",
66
66
  "@ionic/swiftlint-config": "^1.1.2",
67
- "@types/node": "^22.7.5",
68
- "@typescript-eslint/eslint-plugin": "^7.11.0",
69
- "@typescript-eslint/parser": "^7.11.0",
70
- "eslint": "^8.57.0",
67
+ "@types/node": "^22.10.1",
68
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
69
+ "@typescript-eslint/parser": "^7.18.0",
70
+ "eslint": "^8.57.1",
71
71
  "eslint-plugin-import": "^2.31.0",
72
- "prettier": "^3.3.3",
73
- "prettier-plugin-java": "^2.6.4",
72
+ "prettier": "^3.4.2",
73
+ "prettier-plugin-java": "^2.6.5",
74
74
  "rimraf": "^6.0.1",
75
- "rollup": "^4.24.0",
75
+ "rollup": "^4.28.0",
76
76
  "swiftlint": "^2.0.0",
77
- "typescript": "^5.6.3"
77
+ "typescript": "^5.7.2"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "@capacitor/core": "^6.0.0"