@otakit/capacitor-updater 1.1.0 → 2.0.0
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/README.md +39 -14
- package/android/src/main/java/com/updatekit/updater/BundleInfo.java +34 -2
- package/android/src/main/java/com/updatekit/updater/BundleStore.java +9 -2
- package/android/src/main/java/com/updatekit/updater/HostedManifestKeys.java +5 -6
- package/android/src/main/java/com/updatekit/updater/ManifestClient.java +44 -55
- package/android/src/main/java/com/updatekit/updater/ManifestVerifier.java +24 -25
- package/android/src/main/java/com/updatekit/updater/UpdaterPlugin.java +164 -74
- package/dist/esm/definitions.d.ts +11 -25
- package/dist/esm/definitions.d.ts.map +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +0 -4
- package/dist/esm/web.d.ts.map +1 -1
- package/dist/esm/web.js +0 -8
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +0 -10
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +0 -10
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/UpdaterPlugin/BundleInfo.swift +5 -0
- package/ios/Sources/UpdaterPlugin/BundleStore.swift +3 -0
- package/ios/Sources/UpdaterPlugin/HostedManifestKeys.swift +5 -5
- package/ios/Sources/UpdaterPlugin/ManifestClient.swift +44 -45
- package/ios/Sources/UpdaterPlugin/ManifestVerifier.swift +25 -24
- package/ios/Sources/UpdaterPlugin/UpdaterPlugin.m +0 -2
- package/ios/Sources/UpdaterPlugin/UpdaterPlugin.swift +141 -67
- package/package.json +1 -1
|
@@ -37,12 +37,15 @@ public class UpdaterPlugin extends Plugin {
|
|
|
37
37
|
private boolean allowInsecureUrls = false;
|
|
38
38
|
private String updateMode = UPDATE_MODE_NEXT_LAUNCH;
|
|
39
39
|
private String updateUrl;
|
|
40
|
+
private String cdnUrl;
|
|
40
41
|
private String appId;
|
|
41
42
|
private String channel;
|
|
43
|
+
private String runtimeVersion;
|
|
42
44
|
private java.util.List<ManifestVerifier.KeyEntry> manifestKeys = new java.util.ArrayList<>();
|
|
43
45
|
private long checkIntervalMs = 600_000;
|
|
44
46
|
private final AtomicBoolean checkInProgress = new AtomicBoolean(false);
|
|
45
47
|
private static final String DEFAULT_UPDATE_URL = "https://www.otakit.app/api/v1";
|
|
48
|
+
private static final String DEFAULT_CDN_URL = "https://cdn.otakit.app";
|
|
46
49
|
private static final String API_PATH_SUFFIX = "/api/v1";
|
|
47
50
|
private static final String UPDATE_MODE_MANUAL = "manual";
|
|
48
51
|
private static final String UPDATE_MODE_NEXT_LAUNCH = "next-launch";
|
|
@@ -71,13 +74,19 @@ public class UpdaterPlugin extends Plugin {
|
|
|
71
74
|
}
|
|
72
75
|
} catch (PackageManager.NameNotFoundException ignored) {}
|
|
73
76
|
|
|
74
|
-
this.store = new BundleStore(getContext(), builtinVersion, nativeBuild);
|
|
75
77
|
this.updateUrl = resolveUpdateUrl(
|
|
76
78
|
getConfig().getString("serverUrl"),
|
|
77
79
|
System.getenv("OTAKIT_SERVER_URL")
|
|
78
80
|
);
|
|
81
|
+
this.cdnUrl = resolveCdnUrl(
|
|
82
|
+
getConfig().getString("cdnUrl"),
|
|
83
|
+
System.getenv("OTAKIT_CDN_URL"),
|
|
84
|
+
this.updateUrl
|
|
85
|
+
);
|
|
79
86
|
this.appId = getConfig().getString("appId");
|
|
80
87
|
this.channel = trimToNull(getConfig().getString("channel"));
|
|
88
|
+
this.runtimeVersion = trimToNull(getConfig().getString("runtimeVersion"));
|
|
89
|
+
this.store = new BundleStore(getContext(), builtinVersion, nativeBuild, this.runtimeVersion);
|
|
81
90
|
this.allowInsecureUrls = getConfig().getBoolean("allowInsecureUrls", false);
|
|
82
91
|
String configuredUpdateMode = getConfig().getString("updateMode", UPDATE_MODE_NEXT_LAUNCH);
|
|
83
92
|
this.updateMode = resolveUpdateMode(configuredUpdateMode);
|
|
@@ -114,13 +123,15 @@ public class UpdaterPlugin extends Plugin {
|
|
|
114
123
|
manifestKeys.add(new ManifestVerifier.KeyEntry("_invalid_", new byte[0]));
|
|
115
124
|
}
|
|
116
125
|
|
|
117
|
-
if (manifestKeys.isEmpty() && HostedManifestKeys.
|
|
126
|
+
if (manifestKeys.isEmpty() && HostedManifestKeys.matchesManagedManifestUrl(cdnUrl)) {
|
|
118
127
|
manifestKeys.addAll(HostedManifestKeys.createDefaultKeys());
|
|
119
128
|
}
|
|
120
129
|
|
|
121
130
|
this.appReadyTimeoutMs = Math.max(1000, getConfig().getInt("appReadyTimeout", 10_000));
|
|
122
131
|
this.checkIntervalMs = Math.max(600_000, getConfig().getInt("checkInterval", 600_000));
|
|
123
132
|
|
|
133
|
+
pruneIncompatibleBundles();
|
|
134
|
+
|
|
124
135
|
BundleInfo current = store.getCurrentBundle();
|
|
125
136
|
if (current.status == BundleStatus.TRIAL) {
|
|
126
137
|
rollbackCurrentBundle("app_restarted_before_notify");
|
|
@@ -170,7 +181,15 @@ public class UpdaterPlugin extends Plugin {
|
|
|
170
181
|
}
|
|
171
182
|
}
|
|
172
183
|
|
|
173
|
-
if (shouldThrottleCheck()) return;
|
|
184
|
+
if (!UPDATE_MODE_IMMEDIATE.equals(updateMode) && shouldThrottleCheck()) return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (
|
|
188
|
+
TRIGGER_LAUNCH.equals(trigger) &&
|
|
189
|
+
!UPDATE_MODE_IMMEDIATE.equals(updateMode) &&
|
|
190
|
+
shouldThrottleCheck()
|
|
191
|
+
) {
|
|
192
|
+
return;
|
|
174
193
|
}
|
|
175
194
|
|
|
176
195
|
// Acquire in-flight guard (submit-time)
|
|
@@ -181,7 +200,6 @@ public class UpdaterPlugin extends Plugin {
|
|
|
181
200
|
executor.execute(() -> {
|
|
182
201
|
try {
|
|
183
202
|
BundleInfo result = performCheckAndDownload(null, true);
|
|
184
|
-
recordCheckTimestamp();
|
|
185
203
|
if (result != null) {
|
|
186
204
|
activateStagedBundleForReload();
|
|
187
205
|
reloadWebView();
|
|
@@ -278,8 +296,7 @@ public class UpdaterPlugin extends Plugin {
|
|
|
278
296
|
|
|
279
297
|
@PluginMethod
|
|
280
298
|
public void check(PluginCall call) {
|
|
281
|
-
|
|
282
|
-
if (shouldThrottleCheck() || !checkInProgress.compareAndSet(false, true)) {
|
|
299
|
+
if (!checkInProgress.compareAndSet(false, true)) {
|
|
283
300
|
String stagedId = store.getStagedBundleId();
|
|
284
301
|
if (stagedId != null) {
|
|
285
302
|
BundleInfo staged = store.getBundle(stagedId);
|
|
@@ -290,6 +307,9 @@ public class UpdaterPlugin extends Plugin {
|
|
|
290
307
|
result.put("sha256", staged.sha256 != null ? staged.sha256 : "");
|
|
291
308
|
result.put("size", 0);
|
|
292
309
|
result.put("downloaded", true);
|
|
310
|
+
if (staged.runtimeVersion != null) {
|
|
311
|
+
result.put("runtimeVersion", staged.runtimeVersion);
|
|
312
|
+
}
|
|
293
313
|
if (staged.releaseId != null) {
|
|
294
314
|
result.put("releaseId", staged.releaseId);
|
|
295
315
|
}
|
|
@@ -304,10 +324,10 @@ public class UpdaterPlugin extends Plugin {
|
|
|
304
324
|
executor.execute(() -> {
|
|
305
325
|
try {
|
|
306
326
|
ManifestClient.LatestManifest latest = fetchLatest(targetChannel);
|
|
307
|
-
// check() does NOT record timestamp — only download() and automatic paths do.
|
|
308
|
-
// This keeps check() -> download() working without the throttle blocking download().
|
|
309
327
|
if (latest == null) {
|
|
310
328
|
call.resolve((JSObject) null);
|
|
329
|
+
} else if (isCurrentBundleLatest(latest, targetChannel)) {
|
|
330
|
+
call.resolve((JSObject) null);
|
|
311
331
|
} else {
|
|
312
332
|
BundleInfo staged = findMatchingStagedBundle(latest, targetChannel);
|
|
313
333
|
call.resolve(manifestToJSObject(latest, staged != null));
|
|
@@ -322,8 +342,7 @@ public class UpdaterPlugin extends Plugin {
|
|
|
322
342
|
|
|
323
343
|
@PluginMethod
|
|
324
344
|
public void download(PluginCall call) {
|
|
325
|
-
|
|
326
|
-
if (shouldThrottleCheck() || !checkInProgress.compareAndSet(false, true)) {
|
|
345
|
+
if (!checkInProgress.compareAndSet(false, true)) {
|
|
327
346
|
String stagedId = store.getStagedBundleId();
|
|
328
347
|
if (stagedId != null) {
|
|
329
348
|
BundleInfo staged = store.getBundle(stagedId);
|
|
@@ -338,7 +357,6 @@ public class UpdaterPlugin extends Plugin {
|
|
|
338
357
|
executor.execute(() -> {
|
|
339
358
|
try {
|
|
340
359
|
BundleInfo bundle = performCheckAndDownload(null, true);
|
|
341
|
-
recordCheckTimestamp();
|
|
342
360
|
if (bundle == null) {
|
|
343
361
|
call.resolve((JSObject) null);
|
|
344
362
|
} else {
|
|
@@ -352,42 +370,6 @@ public class UpdaterPlugin extends Plugin {
|
|
|
352
370
|
});
|
|
353
371
|
}
|
|
354
372
|
|
|
355
|
-
@PluginMethod
|
|
356
|
-
public void debugCheck(PluginCall call) {
|
|
357
|
-
String requestedChannel = call.getString("channel");
|
|
358
|
-
String targetChannel = resolveTargetChannel(requestedChannel);
|
|
359
|
-
executor.execute(() -> {
|
|
360
|
-
try {
|
|
361
|
-
ManifestClient.LatestManifest latest = fetchLatest(targetChannel);
|
|
362
|
-
if (latest == null) {
|
|
363
|
-
call.resolve((JSObject) null);
|
|
364
|
-
} else {
|
|
365
|
-
BundleInfo staged = findMatchingStagedBundle(latest, targetChannel);
|
|
366
|
-
call.resolve(manifestToJSObject(latest, staged != null));
|
|
367
|
-
}
|
|
368
|
-
} catch (Exception e) {
|
|
369
|
-
call.reject("debugCheck failed: " + e.getMessage());
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
@PluginMethod
|
|
375
|
-
public void debugDownload(PluginCall call) {
|
|
376
|
-
String requestedChannel = call.getString("channel");
|
|
377
|
-
executor.execute(() -> {
|
|
378
|
-
try {
|
|
379
|
-
BundleInfo bundle = performCheckAndDownload(requestedChannel, true);
|
|
380
|
-
if (bundle == null) {
|
|
381
|
-
call.resolve((JSObject) null);
|
|
382
|
-
} else {
|
|
383
|
-
call.resolve(bundle.toJSObject());
|
|
384
|
-
}
|
|
385
|
-
} catch (Exception e) {
|
|
386
|
-
call.reject("debugDownload failed: " + e.getMessage());
|
|
387
|
-
}
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
|
|
391
373
|
@PluginMethod
|
|
392
374
|
public void apply(PluginCall call) {
|
|
393
375
|
String stagedId = store.getStagedBundleId();
|
|
@@ -505,16 +487,11 @@ public class UpdaterPlugin extends Plugin {
|
|
|
505
487
|
throw new IllegalStateException("Missing appId in plugin config");
|
|
506
488
|
}
|
|
507
489
|
|
|
508
|
-
BundleInfo current = store.getCurrentBundle();
|
|
509
|
-
|
|
510
490
|
return ManifestClient.fetchLatest(
|
|
511
|
-
|
|
491
|
+
cdnUrl,
|
|
512
492
|
appId,
|
|
513
493
|
channel,
|
|
514
|
-
|
|
515
|
-
current.releaseId,
|
|
516
|
-
store.getNativeBuild(),
|
|
517
|
-
"android",
|
|
494
|
+
runtimeVersion,
|
|
518
495
|
allowInsecureUrls,
|
|
519
496
|
manifestKeys
|
|
520
497
|
);
|
|
@@ -530,6 +507,19 @@ public class UpdaterPlugin extends Plugin {
|
|
|
530
507
|
return null;
|
|
531
508
|
}
|
|
532
509
|
|
|
510
|
+
if (!isCompatibleRuntime(latest.runtimeVersion)) {
|
|
511
|
+
throw new IllegalStateException(
|
|
512
|
+
"Manifest runtimeVersion does not match the installed app runtime"
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
if (isCurrentBundleLatest(latest, targetChannel)) {
|
|
517
|
+
if (emitEvents) {
|
|
518
|
+
notifyListeners("noUpdateAvailable", new JSObject());
|
|
519
|
+
}
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
|
|
533
523
|
BundleInfo staged = findMatchingStagedBundle(latest, targetChannel);
|
|
534
524
|
if (emitEvents) {
|
|
535
525
|
notifyListeners("updateAvailable", manifestToJSObject(latest, staged != null));
|
|
@@ -545,6 +535,7 @@ public class UpdaterPlugin extends Plugin {
|
|
|
545
535
|
latest.version,
|
|
546
536
|
latest.sha256,
|
|
547
537
|
latest.size,
|
|
538
|
+
latest.runtimeVersion,
|
|
548
539
|
targetChannel,
|
|
549
540
|
latest.releaseId
|
|
550
541
|
);
|
|
@@ -558,6 +549,7 @@ public class UpdaterPlugin extends Plugin {
|
|
|
558
549
|
refreshed.version,
|
|
559
550
|
refreshed.sha256,
|
|
560
551
|
refreshed.size,
|
|
552
|
+
refreshed.runtimeVersion,
|
|
561
553
|
targetChannel,
|
|
562
554
|
refreshed.releaseId
|
|
563
555
|
);
|
|
@@ -580,7 +572,7 @@ public class UpdaterPlugin extends Plugin {
|
|
|
580
572
|
|
|
581
573
|
private BundleInfo downloadAndStage(URL url, String version, String expectedSha256)
|
|
582
574
|
throws Exception {
|
|
583
|
-
return downloadAndStage(url, version, expectedSha256, 0, null, null);
|
|
575
|
+
return downloadAndStage(url, version, expectedSha256, 0, null, null, null);
|
|
584
576
|
}
|
|
585
577
|
|
|
586
578
|
private BundleInfo downloadAndStage(
|
|
@@ -588,6 +580,7 @@ public class UpdaterPlugin extends Plugin {
|
|
|
588
580
|
String version,
|
|
589
581
|
String expectedSha256,
|
|
590
582
|
int expectedSize,
|
|
583
|
+
String runtimeVersion,
|
|
591
584
|
String channel,
|
|
592
585
|
String releaseId
|
|
593
586
|
) throws Exception {
|
|
@@ -635,6 +628,7 @@ public class UpdaterPlugin extends Plugin {
|
|
|
635
628
|
BundleInfo info = new BundleInfo(
|
|
636
629
|
bundleId,
|
|
637
630
|
version,
|
|
631
|
+
runtimeVersion,
|
|
638
632
|
BundleStatus.PENDING,
|
|
639
633
|
System.currentTimeMillis(),
|
|
640
634
|
expectedSha256,
|
|
@@ -730,6 +724,12 @@ public class UpdaterPlugin extends Plugin {
|
|
|
730
724
|
store.setStagedBundleId(null);
|
|
731
725
|
return store.getCurrentBundle();
|
|
732
726
|
}
|
|
727
|
+
if (!isCompatibleRuntime(staged)) {
|
|
728
|
+
try {
|
|
729
|
+
store.deleteBundle(staged.id);
|
|
730
|
+
} catch (Exception ignored) {}
|
|
731
|
+
return store.getCurrentBundle();
|
|
732
|
+
}
|
|
733
733
|
|
|
734
734
|
store.setCurrentBundleId(staged.id);
|
|
735
735
|
store.setStagedBundleId(null);
|
|
@@ -747,6 +747,12 @@ public class UpdaterPlugin extends Plugin {
|
|
|
747
747
|
store.setStagedBundleId(null);
|
|
748
748
|
return;
|
|
749
749
|
}
|
|
750
|
+
if (!isCompatibleRuntime(staged)) {
|
|
751
|
+
try {
|
|
752
|
+
store.deleteBundle(staged.id);
|
|
753
|
+
} catch (Exception ignored) {}
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
750
756
|
|
|
751
757
|
store.setCurrentBundleId(staged.id);
|
|
752
758
|
store.setStagedBundleId(null);
|
|
@@ -874,15 +880,63 @@ public class UpdaterPlugin extends Plugin {
|
|
|
874
880
|
object.put("sha256", latest.sha256);
|
|
875
881
|
object.put("size", latest.size);
|
|
876
882
|
object.put("downloaded", downloaded);
|
|
883
|
+
if (latest.runtimeVersion != null) {
|
|
884
|
+
object.put("runtimeVersion", latest.runtimeVersion);
|
|
885
|
+
}
|
|
877
886
|
if (latest.releaseId != null) {
|
|
878
887
|
object.put("releaseId", latest.releaseId);
|
|
879
888
|
}
|
|
880
|
-
if (latest.minNativeBuild != null) {
|
|
881
|
-
object.put("minNativeBuild", latest.minNativeBuild);
|
|
882
|
-
}
|
|
883
889
|
return object;
|
|
884
890
|
}
|
|
885
891
|
|
|
892
|
+
private boolean isCurrentBundleLatest(
|
|
893
|
+
ManifestClient.LatestManifest latest,
|
|
894
|
+
String targetChannel
|
|
895
|
+
) {
|
|
896
|
+
return doesBundleMatchLatest(store.getCurrentBundle(), latest, targetChannel);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
private boolean doesBundleMatchLatest(
|
|
900
|
+
BundleInfo bundle,
|
|
901
|
+
ManifestClient.LatestManifest latest,
|
|
902
|
+
String targetChannel
|
|
903
|
+
) {
|
|
904
|
+
if (bundle == null) {
|
|
905
|
+
return false;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
if (!java.util.Objects.equals(trimToNull(bundle.channel), targetChannel)) {
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
if (
|
|
913
|
+
!java.util.Objects.equals(
|
|
914
|
+
trimToNull(bundle.runtimeVersion),
|
|
915
|
+
trimToNull(latest.runtimeVersion)
|
|
916
|
+
)
|
|
917
|
+
) {
|
|
918
|
+
return false;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
if (
|
|
922
|
+
latest.releaseId != null &&
|
|
923
|
+
bundle.releaseId != null &&
|
|
924
|
+
latest.releaseId.equals(bundle.releaseId)
|
|
925
|
+
) {
|
|
926
|
+
return true;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
if (
|
|
930
|
+
latest.sha256 != null &&
|
|
931
|
+
bundle.sha256 != null &&
|
|
932
|
+
latest.sha256.equals(bundle.sha256)
|
|
933
|
+
) {
|
|
934
|
+
return true;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
return latest.version != null && latest.version.equals(bundle.version);
|
|
938
|
+
}
|
|
939
|
+
|
|
886
940
|
private BundleInfo findMatchingStagedBundle(
|
|
887
941
|
ManifestClient.LatestManifest latest,
|
|
888
942
|
String targetChannel
|
|
@@ -902,24 +956,11 @@ public class UpdaterPlugin extends Plugin {
|
|
|
902
956
|
return null;
|
|
903
957
|
}
|
|
904
958
|
|
|
905
|
-
if (
|
|
906
|
-
|
|
907
|
-
staged.releaseId != null &&
|
|
908
|
-
latest.releaseId.equals(staged.releaseId)
|
|
909
|
-
) {
|
|
910
|
-
return staged;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
if (
|
|
914
|
-
latest.version != null &&
|
|
915
|
-
latest.version.equals(staged.version) &&
|
|
916
|
-
latest.sha256 != null &&
|
|
917
|
-
latest.sha256.equals(staged.sha256)
|
|
918
|
-
) {
|
|
919
|
-
return staged;
|
|
959
|
+
if (!java.util.Objects.equals(trimToNull(staged.runtimeVersion), trimToNull(latest.runtimeVersion))) {
|
|
960
|
+
return null;
|
|
920
961
|
}
|
|
921
962
|
|
|
922
|
-
return null;
|
|
963
|
+
return doesBundleMatchLatest(staged, latest, targetChannel) ? staged : null;
|
|
923
964
|
}
|
|
924
965
|
|
|
925
966
|
private void moveDirectory(File source, File destination) throws Exception {
|
|
@@ -1016,6 +1057,28 @@ public class UpdaterPlugin extends Plugin {
|
|
|
1016
1057
|
return DEFAULT_UPDATE_URL;
|
|
1017
1058
|
}
|
|
1018
1059
|
|
|
1060
|
+
private String resolveCdnUrl(String configured, String env, String resolvedUpdateUrl) {
|
|
1061
|
+
String configuredValue = trimToNull(configured);
|
|
1062
|
+
if (configuredValue != null) {
|
|
1063
|
+
return normalizeCdnUrl(configuredValue);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
String envValue = trimToNull(env);
|
|
1067
|
+
if (envValue != null) {
|
|
1068
|
+
return normalizeCdnUrl(envValue);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
if (
|
|
1072
|
+
resolvedUpdateUrl != null &&
|
|
1073
|
+
!DEFAULT_UPDATE_URL.equalsIgnoreCase(resolvedUpdateUrl) &&
|
|
1074
|
+
resolvedUpdateUrl.toLowerCase(java.util.Locale.ROOT).endsWith(API_PATH_SUFFIX)
|
|
1075
|
+
) {
|
|
1076
|
+
return resolvedUpdateUrl.substring(0, resolvedUpdateUrl.length() - API_PATH_SUFFIX.length());
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
return DEFAULT_CDN_URL;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1019
1082
|
private String normalizeUpdateUrl(String raw) {
|
|
1020
1083
|
String trimmed = raw.trim().replaceAll("/+$", "");
|
|
1021
1084
|
if (trimmed.toLowerCase(java.util.Locale.ROOT).endsWith(API_PATH_SUFFIX)) {
|
|
@@ -1024,6 +1087,10 @@ public class UpdaterPlugin extends Plugin {
|
|
|
1024
1087
|
return trimmed + API_PATH_SUFFIX;
|
|
1025
1088
|
}
|
|
1026
1089
|
|
|
1090
|
+
private String normalizeCdnUrl(String raw) {
|
|
1091
|
+
return raw.trim().replaceAll("/+$", "");
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1027
1094
|
private String trimToNull(String value) {
|
|
1028
1095
|
if (value == null) {
|
|
1029
1096
|
return null;
|
|
@@ -1061,6 +1128,29 @@ public class UpdaterPlugin extends Plugin {
|
|
|
1061
1128
|
);
|
|
1062
1129
|
}
|
|
1063
1130
|
|
|
1131
|
+
private void pruneIncompatibleBundles() {
|
|
1132
|
+
for (BundleInfo bundle : store.listDownloadedBundleInfos()) {
|
|
1133
|
+
if (!isCompatibleRuntime(bundle)) {
|
|
1134
|
+
try {
|
|
1135
|
+
store.deleteBundle(bundle.id);
|
|
1136
|
+
} catch (Exception ignored) {}
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
BundleInfo failed = store.getFailedBundle();
|
|
1141
|
+
if (failed != null && !isCompatibleRuntime(failed)) {
|
|
1142
|
+
store.setFailedBundle(null);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
private boolean isCompatibleRuntime(String bundleRuntimeVersion) {
|
|
1147
|
+
return java.util.Objects.equals(trimToNull(bundleRuntimeVersion), runtimeVersion);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
private boolean isCompatibleRuntime(BundleInfo bundle) {
|
|
1151
|
+
return isCompatibleRuntime(bundle.runtimeVersion);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1064
1154
|
private long getFreeDiskSpace() {
|
|
1065
1155
|
try {
|
|
1066
1156
|
android.os.StatFs statFs = new android.os.StatFs(
|
|
@@ -19,6 +19,8 @@ export interface BundleInfo {
|
|
|
19
19
|
id: string;
|
|
20
20
|
/** Semantic version string */
|
|
21
21
|
version: string;
|
|
22
|
+
/** Native compatibility lane for this bundle. */
|
|
23
|
+
runtimeVersion?: string;
|
|
22
24
|
/** Current status of the bundle */
|
|
23
25
|
status: BundleStatus;
|
|
24
26
|
/** ISO timestamp when bundle was downloaded */
|
|
@@ -33,6 +35,8 @@ export interface BundleInfo {
|
|
|
33
35
|
export interface LatestVersion {
|
|
34
36
|
/** Version string */
|
|
35
37
|
version: string;
|
|
38
|
+
/** Native compatibility lane for this update. */
|
|
39
|
+
runtimeVersion?: string;
|
|
36
40
|
/** Download URL */
|
|
37
41
|
url: string;
|
|
38
42
|
/** SHA-256 checksum */
|
|
@@ -43,8 +47,6 @@ export interface LatestVersion {
|
|
|
43
47
|
downloaded?: boolean;
|
|
44
48
|
/** Release history ID associated with this manifest */
|
|
45
49
|
releaseId?: string;
|
|
46
|
-
/** Minimum native build required */
|
|
47
|
-
minNativeBuild?: number;
|
|
48
50
|
}
|
|
49
51
|
export interface BundleListResult {
|
|
50
52
|
bundles: BundleInfo[];
|
|
@@ -70,38 +72,28 @@ export interface OtaKitConfig {
|
|
|
70
72
|
appId: string;
|
|
71
73
|
/** Optional named release track. Omit to use the base channel. */
|
|
72
74
|
channel?: string;
|
|
75
|
+
/** Optional native compatibility lane. Set this when a new store build should start a new OTA line. */
|
|
76
|
+
runtimeVersion?: string;
|
|
73
77
|
/** Overall update behavior. Defaults to next-launch. */
|
|
74
78
|
updateMode?: OtaKitUpdateMode;
|
|
75
79
|
/**
|
|
76
80
|
* Minimum milliseconds between automatic update checks.
|
|
77
|
-
* Applies to
|
|
78
|
-
*
|
|
81
|
+
* Applies only to automatic checks in `next-launch` and `next-resume`.
|
|
82
|
+
* Manual APIs and `immediate` mode bypass this throttle. Defaults to 600000 (10 min).
|
|
79
83
|
*/
|
|
80
84
|
checkInterval?: number;
|
|
81
85
|
/** Milliseconds to wait for notifyAppReady(). Defaults to 10000. */
|
|
82
86
|
appReadyTimeout?: number;
|
|
83
|
-
/** Custom API base URL for
|
|
87
|
+
/** Custom API base URL for stats and other control-plane requests. */
|
|
84
88
|
serverUrl?: string;
|
|
89
|
+
/** Custom CDN base URL for manifest and bundle delivery. */
|
|
90
|
+
cdnUrl?: string;
|
|
85
91
|
/** Custom manifest verification keys for self-hosted or custom trust. */
|
|
86
92
|
manifestKeys?: OtaKitManifestKey[];
|
|
87
93
|
/** Allow HTTP only for localhost development. Defaults to false. */
|
|
88
94
|
allowInsecureUrls?: boolean;
|
|
89
95
|
}
|
|
90
96
|
export interface OtaKitDebugApi {
|
|
91
|
-
/**
|
|
92
|
-
* Check the server for a newer version without downloading it.
|
|
93
|
-
* You can optionally pass { channel } for a one-off debug override.
|
|
94
|
-
*/
|
|
95
|
-
check(options?: {
|
|
96
|
-
channel?: string;
|
|
97
|
-
}): Promise<LatestVersion | null>;
|
|
98
|
-
/**
|
|
99
|
-
* Check the server and download the latest bundle if available.
|
|
100
|
-
* Ensures the latest bundle is staged for later activation.
|
|
101
|
-
*/
|
|
102
|
-
download(options?: {
|
|
103
|
-
channel?: string;
|
|
104
|
-
}): Promise<BundleInfo | null>;
|
|
105
97
|
/**
|
|
106
98
|
* Reset to the builtin bundle and reload the WebView.
|
|
107
99
|
*
|
|
@@ -202,12 +194,6 @@ export interface OtaKitBridgePlugin {
|
|
|
202
194
|
apply(): Promise<void>;
|
|
203
195
|
notifyAppReady(): Promise<void>;
|
|
204
196
|
debugGetState(): Promise<OtaKitDebugState>;
|
|
205
|
-
debugCheck(options?: {
|
|
206
|
-
channel?: string;
|
|
207
|
-
}): Promise<LatestVersion | null>;
|
|
208
|
-
debugDownload(options?: {
|
|
209
|
-
channel?: string;
|
|
210
|
-
}): Promise<BundleInfo | null>;
|
|
211
197
|
debugReset(): Promise<void>;
|
|
212
198
|
debugListBundles(): Promise<BundleListResult>;
|
|
213
199
|
debugDeleteBundle(options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D;;GAEG;AACH,oBAAY,YAAY;IACtB,+BAA+B;IAC/B,OAAO,YAAY;IACnB,iDAAiD;IACjD,OAAO,YAAY;IACnB,mCAAmC;IACnC,KAAK,UAAU;IACf,wBAAwB;IACxB,OAAO,YAAY;IACnB,yDAAyD;IACzD,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE5D;;GAEG;AACH,oBAAY,YAAY;IACtB,+BAA+B;IAC/B,OAAO,YAAY;IACnB,iDAAiD;IACjD,OAAO,YAAY;IACnB,mCAAmC;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,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAC3D,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,WAAW,CACT,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,GACtC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,WAAW,CAAC,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC7F,WAAW,CACT,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,GACnC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,WAAW,CACT,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,UAAU,CAAC;QAAC,EAAE,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAC9E,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACjC,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC"}
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,YAAY,EAKb,MAAM,eAAe,CAAC;AA6EvB,QAAA,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,YAAY,EAKb,MAAM,eAAe,CAAC;AA6EvB,QAAA,MAAM,MAAM,EAAE,YAgBb,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -70,8 +70,6 @@ const OtaKit = {
|
|
|
70
70
|
update,
|
|
71
71
|
notifyAppReady: () => NativeOtaKit.notifyAppReady(),
|
|
72
72
|
debug: {
|
|
73
|
-
check: async (options) => normalizeNullable(await NativeOtaKit.debugCheck(options)),
|
|
74
|
-
download: async (options) => normalizeNullable(await NativeOtaKit.debugDownload(options)),
|
|
75
73
|
reset: () => NativeOtaKit.debugReset(),
|
|
76
74
|
listBundles: () => NativeOtaKit.debugListBundles(),
|
|
77
75
|
deleteBundle: (options) => NativeOtaKit.debugDeleteBundle(options),
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAWjD,MAAM,YAAY,GAAG,cAAc,CAAqB,QAAQ,EAAE;IAChE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;CAC1D,CAAC,CAAC;AAEH;;GAEG;AACH,SAAS,aAAa,CAAC,GAAY;IACjC,OAAO,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AAClF,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAI,KAAQ;IACpC,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7C,CAAC;AAED,SAAS,aAAa,CAAC,KAAuB;IAC5C,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,cAAc,EAAE,KAAK,C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C,WAAW,CAAC,IAAI,CAAC,YAAY,CAAgC;IACvF,kBAAkB,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE;CAC5D,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -10,10 +10,6 @@ export declare class OtaKitWeb extends WebPlugin implements OtaKitBridgePlugin {
|
|
|
10
10
|
check(): Promise<LatestVersion | null>;
|
|
11
11
|
download(): Promise<BundleInfo | null>;
|
|
12
12
|
apply(): Promise<void>;
|
|
13
|
-
debugCheck(): Promise<LatestVersion | null>;
|
|
14
|
-
debugDownload(_options?: {
|
|
15
|
-
channel?: string;
|
|
16
|
-
}): Promise<BundleInfo | null>;
|
|
17
13
|
notifyAppReady(): Promise<void>;
|
|
18
14
|
debugReset(): Promise<void>;
|
|
19
15
|
debugListBundles(): Promise<BundleListResult>;
|
package/dist/esm/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,aAAa,EAEb,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,qBAAa,SAAU,SAAQ,SAAU,YAAW,kBAAkB;IACpE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAI7B;IAEI,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAS1C,KAAK,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAKtC,QAAQ,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAKtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,aAAa,EAEb,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,qBAAa,SAAU,SAAQ,SAAU,YAAW,kBAAkB;IACpE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAI7B;IAEI,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAS1C,KAAK,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAKtC,QAAQ,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAKtC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAI7C,iBAAiB,CAAC,QAAQ,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhE,mBAAmB,IAAI,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;CAGxD"}
|
package/dist/esm/web.js
CHANGED
|
@@ -29,14 +29,6 @@ export class OtaKitWeb extends WebPlugin {
|
|
|
29
29
|
console.warn('OtaKit.apply() is not supported on web');
|
|
30
30
|
throw new Error('OtaKit.apply() is not supported on web');
|
|
31
31
|
}
|
|
32
|
-
async debugCheck() {
|
|
33
|
-
console.warn('OtaKit.debug.check() is not supported on web');
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
async debugDownload(_options) {
|
|
37
|
-
console.warn('OtaKit.debug.download() is not supported on web');
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
32
|
async notifyAppReady() {
|
|
41
33
|
// No-op on web, but don't warn - apps should call this unconditionally
|
|
42
34
|
}
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,SAAS;IACrB,cAAc,GAAe;QAC5C,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,SAAyB;KAClC,CAAC;IAEF,KAAK,CAAC,aAAa;QACjB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,cAAc;YAC5B,QAAQ,EAAE,IAAI,CAAC,cAAc;YAC7B,MAAM,EAAE,IAAI;YACZ,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO;SAC5C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C;;;GAGG;AACH,MAAM,OAAO,SAAU,SAAQ,SAAS;IACrB,cAAc,GAAe;QAC5C,EAAE,EAAE,SAAS;QACb,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,SAAyB;KAClC,CAAC;IAEF,KAAK,CAAC,aAAa;QACjB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,cAAc;YAC5B,QAAQ,EAAE,IAAI,CAAC,cAAc;YAC7B,MAAM,EAAE,IAAI;YACZ,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO;SAC5C,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QACvD,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,uEAAuE;IACzE,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,QAA8B;QACpD,OAAO,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAC;IACtE,CAAC;IAED,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -90,8 +90,6 @@ const OtaKit = {
|
|
|
90
90
|
update,
|
|
91
91
|
notifyAppReady: () => NativeOtaKit.notifyAppReady(),
|
|
92
92
|
debug: {
|
|
93
|
-
check: async (options) => normalizeNullable(await NativeOtaKit.debugCheck(options)),
|
|
94
|
-
download: async (options) => normalizeNullable(await NativeOtaKit.debugDownload(options)),
|
|
95
93
|
reset: () => NativeOtaKit.debugReset(),
|
|
96
94
|
listBundles: () => NativeOtaKit.debugListBundles(),
|
|
97
95
|
deleteBundle: (options) => NativeOtaKit.debugDeleteBundle(options),
|
|
@@ -131,14 +129,6 @@ class OtaKitWeb extends core.WebPlugin {
|
|
|
131
129
|
console.warn('OtaKit.apply() is not supported on web');
|
|
132
130
|
throw new Error('OtaKit.apply() is not supported on web');
|
|
133
131
|
}
|
|
134
|
-
async debugCheck() {
|
|
135
|
-
console.warn('OtaKit.debug.check() is not supported on web');
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
async debugDownload(_options) {
|
|
139
|
-
console.warn('OtaKit.debug.download() is not supported on web');
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
132
|
async notifyAppReady() {
|
|
143
133
|
// No-op on web, but don't warn - apps should call this unconditionally
|
|
144
134
|
}
|