@capgo/capacitor-updater 6.14.19 → 6.14.22

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.
package/Package.swift CHANGED
@@ -10,10 +10,11 @@ let package = Package(
10
10
  targets: ["CapacitorUpdaterPlugin"])
11
11
  ],
12
12
  dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "main"),
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "6.0.0"),
14
14
  .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.10.2")),
15
15
  .package(url: "https://github.com/ZipArchive/ZipArchive.git", exact: "2.4.3"),
16
- .package(url: "https://github.com/mrackwitz/Version.git", .upToNextMajor(from: "0.8.0"))
16
+ .package(url: "https://github.com/mrackwitz/Version.git", exact: "0.8.0"),
17
+ .package(url: "https://github.com/attaswift/BigInt.git", exact: "5.2.0")
17
18
  ],
18
19
  targets: [
19
20
  .target(
@@ -23,7 +24,8 @@ let package = Package(
23
24
  .product(name: "Cordova", package: "capacitor-swift-pm"),
24
25
  .product(name: "ZipArchive", package: "ZipArchive"),
25
26
  .product(name: "Alamofire", package: "Alamofire"),
26
- .product(name: "Version", package: "Version")
27
+ .product(name: "Version", package: "Version"),
28
+ .product(name: "BigInt", package: "BigInt")
27
29
  ],
28
30
  path: "ios/Plugin"),
29
31
  .testTarget(
@@ -57,7 +57,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
57
57
  private static final String statsUrlDefault = "https://plugin.capgo.app/stats";
58
58
  private static final String channelUrlDefault = "https://plugin.capgo.app/channel_self";
59
59
 
60
- private final String PLUGIN_VERSION = "6.14.19";
60
+ private final String PLUGIN_VERSION = "6.14.22";
61
61
  private static final String DELAY_CONDITION_PREFERENCES = "";
62
62
 
63
63
  private SharedPreferences.Editor editor;
@@ -213,12 +213,22 @@ import UIKit
213
213
 
214
214
  if !success || unzipError != nil {
215
215
  self.sendStats(action: "unzip_fail")
216
+ try? FileManager.default.removeItem(at: destUnZip)
216
217
  throw unzipError ?? CustomError.cannotUnzip
217
218
  }
218
219
 
219
220
  if try unflatFolder(source: destUnZip, dest: destPersist) {
220
221
  try deleteFolder(source: destUnZip)
221
222
  }
223
+
224
+ // Cleanup: remove the downloaded/decrypted zip after successful extraction
225
+ do {
226
+ if FileManager.default.fileExists(atPath: sourceZip.path) {
227
+ try FileManager.default.removeItem(at: sourceZip)
228
+ }
229
+ } catch {
230
+ print("\(CapacitorUpdater.TAG) Could not delete source zip at \(sourceZip.path): \(error)")
231
+ }
222
232
  }
223
233
 
224
234
  private func createInfoObject() -> InfoObject {
@@ -45,7 +45,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
45
45
  CAPPluginMethod(name: "getNextBundle", returnType: CAPPluginReturnPromise)
46
46
  ]
47
47
  public var implementation = CapacitorUpdater()
48
- private let PLUGIN_VERSION: String = "6.14.19"
48
+ private let PLUGIN_VERSION: String = "6.14.22"
49
49
  static let updateUrlDefault = "https://plugin.capgo.app/updates"
50
50
  static let statsUrlDefault = "https://plugin.capgo.app/stats"
51
51
  static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-updater",
3
- "version": "6.14.19",
3
+ "version": "6.14.22",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",