@capgo/capacitor-updater 6.9.0 → 6.11.2

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 ADDED
@@ -0,0 +1,35 @@
1
+ // swift-tools-version: 5.9
2
+ import PackageDescription
3
+
4
+ let package = Package(
5
+ name: "CapgoCapacitorUpdater",
6
+ platforms: [.iOS(.v13)],
7
+ products: [
8
+ .library(
9
+ name: "CapacitorUpdaterPlugin",
10
+ targets: ["CapacitorUpdaterPlugin"])
11
+ ],
12
+ dependencies: [
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", branch: "6.0.0"),
14
+ .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.10.2")),
15
+ .package(url: "https://github.com/ZipArchive/ZipArchive.git", .upToNextMajor(from: "2.6.0")),
16
+ .package(url: "https://github.com/mxcl/Version.git", .upToNextMajor(from: "2.1.0"))
17
+ ],
18
+ targets: [
19
+ .target(
20
+ name: "CapacitorUpdaterPlugin",
21
+ dependencies: [
22
+ .product(name: "Capacitor", package: "capacitor-swift-pm"),
23
+ .product(name: "Cordova", package: "capacitor-swift-pm"),
24
+ .product(name: "ZipArchive", package: "ZipArchive"),
25
+ .product(name: "Alamofire", package: "Alamofire"),
26
+ .product(name: "Version", package: "Version")
27
+ ],
28
+ path: "ios/Plugin"),
29
+ .testTarget(
30
+ name: "CapacitorUpdaterPluginTests",
31
+ dependencies: ["CapacitorUpdaterPlugin"],
32
+ path: "ios/PluginTests")
33
+ ],
34
+ swiftLanguageVersions: [.v5]
35
+ )
@@ -60,7 +60,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
60
60
  private static final String channelUrlDefault =
61
61
  "https://plugin.capgo.app/channel_self";
62
62
 
63
- private final String PLUGIN_VERSION = "6.9.0";
63
+ private final String PLUGIN_VERSION = "6.11.2";
64
64
  private static final String DELAY_CONDITION_PREFERENCES = "";
65
65
 
66
66
  private SharedPreferences.Editor editor;
@@ -5,12 +5,22 @@
5
5
  */
6
6
 
7
7
  import Foundation
8
+ #if canImport(ZipArchive)
9
+ import ZipArchive
10
+ #else
8
11
  import SSZipArchive
12
+ #endif
9
13
  import Alamofire
10
14
  import zlib
11
15
  import CryptoKit
12
16
  import Compression
13
17
 
18
+ #if canImport(ZipArchive)
19
+ typealias ZipArchiveHelper = ZipArchive
20
+ #else
21
+ typealias ZipArchiveHelper = SSZipArchive
22
+ #endif
23
+
14
24
  extension Collection {
15
25
  subscript(safe index: Index) -> Element? {
16
26
  return indices.contains(index) ? self[index] : nil
@@ -527,7 +537,7 @@ extension CustomError: LocalizedError {
527
537
  let semaphore = DispatchSemaphore(value: 0)
528
538
  var unzipError: NSError?
529
539
 
530
- let success = SSZipArchive.unzipFile(atPath: sourceZip.path,
540
+ let success = ZipArchiveHelper.unzipFile(atPath: sourceZip.path,
531
541
  toDestination: destUnZip.path,
532
542
  preserveAttributes: true,
533
543
  overwrite: true,
@@ -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.9.0"
48
+ private let PLUGIN_VERSION: String = "6.11.2"
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.9.0",
3
+ "version": "6.11.2",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Live update for capacitor apps",
6
6
  "main": "dist/plugin.cjs.js",
@@ -13,7 +13,8 @@
13
13
  "android/build.gradle",
14
14
  "dist/",
15
15
  "ios/Plugin/",
16
- "CapgoCapacitorUpdater.podspec"
16
+ "CapgoCapacitorUpdater.podspec",
17
+ "Package.swift"
17
18
  ],
18
19
  "author": "Martin Donadieu",
19
20
  "repository": {
@@ -41,6 +42,7 @@
41
42
  "scripts": {
42
43
  "verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
43
44
  "verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin && cd ..",
45
+ "verify:iosSPM": "xcodebuild -workspace ios/Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS",
44
46
  "verify:android": "cd android && ./gradlew clean build test && cd ..",
45
47
  "verify:web": "npm run build",
46
48
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",