@capgo/capacitor-updater 6.51.18 → 6.51.21
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/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +27 -29
- package/android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java +302 -316
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java +227 -64
- package/android/src/main/java/ee/forgr/capacitor_updater/Logger.java +12 -1
- package/android/src/main/java/ee/forgr/capacitor_updater/ShakeMenu.java +12 -16
- package/dist/esm/history.js +7 -7
- package/dist/esm/history.js.map +1 -1
- package/dist/plugin.cjs.js +7 -7
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +7 -7
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +157 -54
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +13 -3
- package/ios/Sources/CapacitorUpdaterPlugin/CryptoCipher.swift +30 -37
- package/ios/Sources/CapacitorUpdaterPlugin/DelayUpdateUtils.swift +16 -41
- package/ios/Sources/CapacitorUpdaterPlugin/ShakeMenu.swift +2 -2
- package/package.json +6 -8
|
@@ -151,59 +151,34 @@ public class DelayUpdateUtils {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
public func setMultiDelay(delayConditions: String) -> Bool {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return true
|
|
159
|
-
} catch {
|
|
160
|
-
logger.error("Failed to delay update, [Error calling 'setMultiDelay()']: \(error)")
|
|
161
|
-
return false
|
|
162
|
-
}
|
|
154
|
+
UserDefaults.standard.set(delayConditions, forKey: DelayUpdateUtils.DELAY_CONDITION_PREFERENCES)
|
|
155
|
+
UserDefaults.standard.synchronize()
|
|
156
|
+
logger.info("Delay update saved")
|
|
157
|
+
return true
|
|
163
158
|
}
|
|
164
159
|
|
|
165
160
|
public func setBackgroundTimestamp(_ backgroundTimestamp: Int64) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
logger.info("Background timestamp saved")
|
|
170
|
-
} catch {
|
|
171
|
-
logger.error("Failed to save background timestamp, [Error calling 'setBackgroundTimestamp()']: \(error)")
|
|
172
|
-
}
|
|
161
|
+
UserDefaults.standard.set(backgroundTimestamp, forKey: DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY)
|
|
162
|
+
UserDefaults.standard.synchronize()
|
|
163
|
+
logger.info("Background timestamp saved")
|
|
173
164
|
}
|
|
174
165
|
|
|
175
166
|
public func unsetBackgroundTimestamp() {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
logger.info("Background timestamp removed")
|
|
180
|
-
} catch {
|
|
181
|
-
// swiftlint:disable:next line_length
|
|
182
|
-
logger.error("Failed to remove background timestamp, [Error calling 'unsetBackgroundTimestamp()']: \(error)")
|
|
183
|
-
}
|
|
167
|
+
UserDefaults.standard.removeObject(forKey: DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY)
|
|
168
|
+
UserDefaults.standard.synchronize()
|
|
169
|
+
logger.info("Background timestamp removed")
|
|
184
170
|
}
|
|
185
171
|
|
|
186
172
|
private func getBackgroundTimestamp() -> Int64 {
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
let timestamp = UserDefaults.standard.object(forKey: key) as? Int64 ?? 0
|
|
190
|
-
return timestamp
|
|
191
|
-
} catch {
|
|
192
|
-
logger.error("Failed to get background timestamp, [Error calling 'getBackgroundTimestamp()']: \(error)")
|
|
193
|
-
return 0
|
|
194
|
-
}
|
|
173
|
+
let key = DelayUpdateUtils.BACKGROUND_TIMESTAMP_KEY
|
|
174
|
+
return UserDefaults.standard.object(forKey: key) as? Int64 ?? 0
|
|
195
175
|
}
|
|
196
176
|
|
|
197
177
|
public func cancelDelay(source: String) -> Bool {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
return true
|
|
203
|
-
} catch {
|
|
204
|
-
logger.error("Failed to cancel update delay: \(error)")
|
|
205
|
-
return false
|
|
206
|
-
}
|
|
178
|
+
UserDefaults.standard.removeObject(forKey: DelayUpdateUtils.DELAY_CONDITION_PREFERENCES)
|
|
179
|
+
UserDefaults.standard.synchronize()
|
|
180
|
+
logger.info("All delays canceled from \(source)")
|
|
181
|
+
return true
|
|
207
182
|
}
|
|
208
183
|
|
|
209
184
|
// MARK: - Helper methods
|
|
@@ -792,9 +792,9 @@ extension UIWindow {
|
|
|
792
792
|
message: "Update downloaded! Reload to apply version \(latest.version)?",
|
|
793
793
|
plugin: plugin,
|
|
794
794
|
bridge: bridge,
|
|
795
|
-
onReload: {
|
|
795
|
+
onReload: {
|
|
796
796
|
_ = updater.set(bundle: bundle)
|
|
797
|
-
_ = plugin
|
|
797
|
+
_ = plugin._reload()
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
800
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/capacitor-updater",
|
|
3
|
-
"version": "6.51.
|
|
3
|
+
"version": "6.51.21",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "Live update for capacitor apps",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"test:maestro:ios:smoke": "./scripts/test-maestro-ios.sh",
|
|
64
64
|
"lint": "bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint",
|
|
65
65
|
"fmt": "bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format",
|
|
66
|
-
"eslint": "eslint .
|
|
66
|
+
"eslint": "eslint .",
|
|
67
67
|
"prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
68
68
|
"swiftlint": "node-swiftlint",
|
|
69
69
|
"docgen": "node scripts/generate-docs.js",
|
|
@@ -87,12 +87,13 @@
|
|
|
87
87
|
"@capacitor/core": "^6.0.0",
|
|
88
88
|
"@capacitor/docgen": "^0.3.0",
|
|
89
89
|
"@capacitor/ios": "^6.0.0",
|
|
90
|
-
"@ionic/eslint-config": "^0.
|
|
90
|
+
"@ionic/eslint-config": "^0.5.0",
|
|
91
|
+
"@typescript-eslint/eslint-plugin": "^8.70.0",
|
|
92
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
91
93
|
"@ionic/prettier-config": "^4.0.0",
|
|
92
94
|
"@ionic/swiftlint-config": "^2.0.0",
|
|
93
95
|
"@types/node": "^26.0.0",
|
|
94
|
-
"eslint": "^
|
|
95
|
-
"eslint-plugin-import": "^2.32.0",
|
|
96
|
+
"eslint": "^10.0.0",
|
|
96
97
|
"husky": "^9.1.7",
|
|
97
98
|
"prettier": "^3.6.2",
|
|
98
99
|
"prettier-plugin-java": "^2.7.4",
|
|
@@ -107,9 +108,6 @@
|
|
|
107
108
|
},
|
|
108
109
|
"prettier": "@ionic/prettier-config",
|
|
109
110
|
"swiftlint": "@ionic/swiftlint-config",
|
|
110
|
-
"eslintConfig": {
|
|
111
|
-
"extends": "@ionic/eslint-config/recommended"
|
|
112
|
-
},
|
|
113
111
|
"capacitor": {
|
|
114
112
|
"ios": {
|
|
115
113
|
"src": "ios"
|