@capgo/capacitor-updater 7.19.1 → 7.19.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/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +2 -8
- package/android/src/main/java/ee/forgr/capacitor_updater/DelayUpdateUtils.java +5 -11
- package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +3 -4
- package/ios/Sources/CapacitorUpdaterPlugin/DelayUpdateUtils.swift +2 -4
- package/package.json +1 -1
|
@@ -65,7 +65,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
65
65
|
private static final String channelUrlDefault = "https://plugin.capgo.app/channel_self";
|
|
66
66
|
private static final String CUSTOM_ID_PREF_KEY = "CapacitorUpdater.customId";
|
|
67
67
|
|
|
68
|
-
private final String PLUGIN_VERSION = "7.19.
|
|
68
|
+
private final String PLUGIN_VERSION = "7.19.2";
|
|
69
69
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
70
70
|
|
|
71
71
|
private SharedPreferences.Editor editor;
|
|
@@ -185,13 +185,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
185
185
|
}
|
|
186
186
|
this.currentVersionNative = new Version(this.getConfig().getString("version", pInfo.versionName));
|
|
187
187
|
this.currentBuildVersion = Integer.toString(pInfo.versionCode);
|
|
188
|
-
this.delayUpdateUtils = new DelayUpdateUtils(
|
|
189
|
-
this.prefs,
|
|
190
|
-
this.editor,
|
|
191
|
-
this.currentVersionNative,
|
|
192
|
-
CapacitorUpdaterPlugin.this::installNext,
|
|
193
|
-
logger
|
|
194
|
-
);
|
|
188
|
+
this.delayUpdateUtils = new DelayUpdateUtils(this.prefs, this.editor, this.currentVersionNative, logger);
|
|
195
189
|
} catch (final PackageManager.NameNotFoundException e) {
|
|
196
190
|
logger.error("Error instantiating implementation " + e.getMessage());
|
|
197
191
|
return;
|
|
@@ -19,19 +19,11 @@ public class DelayUpdateUtils {
|
|
|
19
19
|
private final SharedPreferences prefs;
|
|
20
20
|
private final SharedPreferences.Editor editor;
|
|
21
21
|
private final Version currentVersionNative;
|
|
22
|
-
private final Runnable installNext;
|
|
23
22
|
|
|
24
|
-
public DelayUpdateUtils(
|
|
25
|
-
SharedPreferences prefs,
|
|
26
|
-
SharedPreferences.Editor editor,
|
|
27
|
-
Version currentVersionNative,
|
|
28
|
-
Runnable installNext,
|
|
29
|
-
Logger logger
|
|
30
|
-
) {
|
|
23
|
+
public DelayUpdateUtils(SharedPreferences prefs, SharedPreferences.Editor editor, Version currentVersionNative, Logger logger) {
|
|
31
24
|
this.prefs = prefs;
|
|
32
25
|
this.editor = editor;
|
|
33
26
|
this.currentVersionNative = currentVersionNative;
|
|
34
|
-
this.installNext = installNext;
|
|
35
27
|
this.logger = logger;
|
|
36
28
|
}
|
|
37
29
|
|
|
@@ -96,7 +88,7 @@ public class DelayUpdateUtils {
|
|
|
96
88
|
break;
|
|
97
89
|
case DelayUntilNext.kill:
|
|
98
90
|
if (source == CancelDelaySource.KILLED) {
|
|
99
|
-
|
|
91
|
+
logger.info("Kill delay (value: " + value + ") condition removed at index " + index + " after app kill");
|
|
100
92
|
} else {
|
|
101
93
|
delayConditionListToKeep.add(condition);
|
|
102
94
|
logger.info(
|
|
@@ -160,7 +152,9 @@ public class DelayUpdateUtils {
|
|
|
160
152
|
index++;
|
|
161
153
|
}
|
|
162
154
|
|
|
163
|
-
if (
|
|
155
|
+
if (delayConditionListToKeep.isEmpty()) {
|
|
156
|
+
this.cancelDelay("checkCancelDelay");
|
|
157
|
+
} else {
|
|
164
158
|
this.setMultiDelay(convertDelayConditionsToJson(delayConditionListToKeep));
|
|
165
159
|
}
|
|
166
160
|
}
|
|
@@ -51,7 +51,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
51
51
|
CAPPluginMethod(name: "isShakeMenuEnabled", returnType: CAPPluginReturnPromise)
|
|
52
52
|
]
|
|
53
53
|
public var implementation = CapgoUpdater()
|
|
54
|
-
private let PLUGIN_VERSION: String = "7.19.
|
|
54
|
+
private let PLUGIN_VERSION: String = "7.19.2"
|
|
55
55
|
static let updateUrlDefault = "https://plugin.capgo.app/updates"
|
|
56
56
|
static let statsUrlDefault = "https://plugin.capgo.app/stats"
|
|
57
57
|
static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
|
|
@@ -173,9 +173,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
173
173
|
CryptoCipher.setLogger(logger)
|
|
174
174
|
|
|
175
175
|
// Initialize DelayUpdateUtils
|
|
176
|
-
self.delayUpdateUtils = DelayUpdateUtils(currentVersionNative: currentVersionNative,
|
|
177
|
-
self?.installNext()
|
|
178
|
-
}, logger: logger)
|
|
176
|
+
self.delayUpdateUtils = DelayUpdateUtils(currentVersionNative: currentVersionNative, logger: logger)
|
|
179
177
|
let config = (self.bridge?.viewController as? CAPBridgeViewController)?.instanceDescriptor().legacyConfig
|
|
180
178
|
implementation.appId = Bundle.main.infoDictionary?["CFBundleIdentifier"] as? String ?? ""
|
|
181
179
|
implementation.appId = config?["appId"] as? String ?? implementation.appId
|
|
@@ -318,6 +316,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
318
316
|
return
|
|
319
317
|
}
|
|
320
318
|
self.statsUrl = url
|
|
319
|
+
self.implementation.statsUrl = url
|
|
321
320
|
call.resolve()
|
|
322
321
|
}
|
|
323
322
|
|
|
@@ -22,7 +22,6 @@ public class DelayUpdateUtils {
|
|
|
22
22
|
private let logger: Logger
|
|
23
23
|
|
|
24
24
|
private let currentVersionNative: Version
|
|
25
|
-
private let installNext: () -> Void
|
|
26
25
|
|
|
27
26
|
public enum CancelDelaySource {
|
|
28
27
|
case killed
|
|
@@ -38,9 +37,8 @@ public class DelayUpdateUtils {
|
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
|
|
41
|
-
public init(currentVersionNative: Version,
|
|
40
|
+
public init(currentVersionNative: Version, logger: Logger) {
|
|
42
41
|
self.currentVersionNative = currentVersionNative
|
|
43
|
-
self.installNext = installNext
|
|
44
42
|
self.logger = logger
|
|
45
43
|
}
|
|
46
44
|
|
|
@@ -84,7 +82,7 @@ public class DelayUpdateUtils {
|
|
|
84
82
|
|
|
85
83
|
case "kill":
|
|
86
84
|
if source == .killed {
|
|
87
|
-
|
|
85
|
+
logger.info("Kill delay (value: \(value ?? "")) condition removed at index \(index) after app kill")
|
|
88
86
|
} else {
|
|
89
87
|
delayConditionListToKeep.append(condition)
|
|
90
88
|
logger.info("Kill delay (value: \(value ?? "")) condition kept at index \(index) (source: \(source.description))")
|