@capgo/capacitor-updater 5.2.12 → 5.2.14
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.
|
@@ -58,7 +58,7 @@ public class CapacitorUpdaterPlugin
|
|
|
58
58
|
private static final String channelUrlDefault =
|
|
59
59
|
"https://api.capgo.app/channel_self";
|
|
60
60
|
|
|
61
|
-
private final String PLUGIN_VERSION = "5.2.
|
|
61
|
+
private final String PLUGIN_VERSION = "5.2.14";
|
|
62
62
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
63
63
|
|
|
64
64
|
private SharedPreferences.Editor editor;
|
|
@@ -85,6 +85,16 @@ public class CapacitorUpdaterPlugin
|
|
|
85
85
|
@Override
|
|
86
86
|
public void load() {
|
|
87
87
|
super.load();
|
|
88
|
+
new Thread(() -> {
|
|
89
|
+
try {
|
|
90
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady load");
|
|
91
|
+
CapacitorUpdaterPlugin.this.semaphoreReady.await(0, TimeUnit.SECONDS);
|
|
92
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady load done");
|
|
93
|
+
} catch (InterruptedException e) {
|
|
94
|
+
e.printStackTrace();
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
.start();
|
|
88
98
|
this.prefs =
|
|
89
99
|
this.getContext()
|
|
90
100
|
.getSharedPreferences(
|
|
@@ -184,13 +194,14 @@ public class CapacitorUpdaterPlugin
|
|
|
184
194
|
ret.put("status", "update installed");
|
|
185
195
|
CapacitorUpdaterPlugin.this.implementation.set(latest);
|
|
186
196
|
CapacitorUpdaterPlugin.this._reload();
|
|
187
|
-
CapacitorUpdaterPlugin.this.notifyListeners("appReady", ret);
|
|
188
197
|
new Thread(() -> {
|
|
189
198
|
try {
|
|
199
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady directUpdateFinish");
|
|
190
200
|
CapacitorUpdaterPlugin.this.semaphoreReady.await(
|
|
191
201
|
CapacitorUpdaterPlugin.this.appReadyTimeout,
|
|
192
202
|
TimeUnit.SECONDS
|
|
193
203
|
);
|
|
204
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady directUpdateFinish done");
|
|
194
205
|
} catch (InterruptedException e) {
|
|
195
206
|
e.printStackTrace();
|
|
196
207
|
}
|
|
@@ -456,7 +467,16 @@ public class CapacitorUpdaterPlugin
|
|
|
456
467
|
|
|
457
468
|
private boolean _reload() {
|
|
458
469
|
final String path = this.implementation.getCurrentBundlePath();
|
|
459
|
-
|
|
470
|
+
new Thread(() -> {
|
|
471
|
+
try {
|
|
472
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady _reload");
|
|
473
|
+
CapacitorUpdaterPlugin.this.semaphoreReady.await(0, TimeUnit.SECONDS);
|
|
474
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady _reload done");
|
|
475
|
+
} catch (InterruptedException e) {
|
|
476
|
+
e.printStackTrace();
|
|
477
|
+
}
|
|
478
|
+
})
|
|
479
|
+
.start();
|
|
460
480
|
Log.i(CapacitorUpdater.TAG, "Reloading: " + path);
|
|
461
481
|
if (this.implementation.isUsingBuiltin()) {
|
|
462
482
|
this.bridge.setServerAssetPath(path);
|
|
@@ -674,7 +694,9 @@ public class CapacitorUpdaterPlugin
|
|
|
674
694
|
"Current bundle loaded successfully. ['notifyAppReady()' was called] " +
|
|
675
695
|
bundle
|
|
676
696
|
);
|
|
697
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady countDown");
|
|
677
698
|
this.semaphoreReady.countDown();
|
|
699
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady countDown done");
|
|
678
700
|
call.resolve();
|
|
679
701
|
} catch (final Exception e) {
|
|
680
702
|
Log.e(
|
|
@@ -885,7 +907,26 @@ public class CapacitorUpdaterPlugin
|
|
|
885
907
|
ret.put("bundle", current.toJSON());
|
|
886
908
|
this.notifyListeners("noNeedUpdate", ret);
|
|
887
909
|
ret.put("message", msg);
|
|
888
|
-
|
|
910
|
+
new Thread(() -> {
|
|
911
|
+
try {
|
|
912
|
+
Log.i(
|
|
913
|
+
CapacitorUpdater.TAG,
|
|
914
|
+
"semaphoreReady endBackGroundTaskWithNotif"
|
|
915
|
+
);
|
|
916
|
+
CapacitorUpdaterPlugin.this.semaphoreReady.await(
|
|
917
|
+
CapacitorUpdaterPlugin.this.appReadyTimeout,
|
|
918
|
+
TimeUnit.SECONDS
|
|
919
|
+
);
|
|
920
|
+
Log.i(
|
|
921
|
+
CapacitorUpdater.TAG,
|
|
922
|
+
"semaphoreReady endBackGroundTaskWithNotif done"
|
|
923
|
+
);
|
|
924
|
+
} catch (InterruptedException e) {
|
|
925
|
+
e.printStackTrace();
|
|
926
|
+
}
|
|
927
|
+
CapacitorUpdaterPlugin.this.notifyListeners("appReady", ret);
|
|
928
|
+
})
|
|
929
|
+
.start();
|
|
889
930
|
Log.i(CapacitorUpdater.TAG, "endBackGroundTaskWithNotif " + msg);
|
|
890
931
|
}
|
|
891
932
|
|
|
@@ -1257,10 +1298,12 @@ public class CapacitorUpdaterPlugin
|
|
|
1257
1298
|
Log.i(CapacitorUpdater.TAG, "Auto update is disabled");
|
|
1258
1299
|
new Thread(() -> {
|
|
1259
1300
|
try {
|
|
1301
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady Auto update");
|
|
1260
1302
|
CapacitorUpdaterPlugin.this.semaphoreReady.await(
|
|
1261
1303
|
CapacitorUpdaterPlugin.this.appReadyTimeout,
|
|
1262
1304
|
TimeUnit.SECONDS
|
|
1263
1305
|
);
|
|
1306
|
+
Log.i(CapacitorUpdater.TAG, "semaphoreReady Auto update done");
|
|
1264
1307
|
} catch (InterruptedException e) {
|
|
1265
1308
|
e.printStackTrace();
|
|
1266
1309
|
}
|
|
@@ -15,7 +15,7 @@ import Version
|
|
|
15
15
|
@objc(CapacitorUpdaterPlugin)
|
|
16
16
|
public class CapacitorUpdaterPlugin: CAPPlugin {
|
|
17
17
|
private var implementation = CapacitorUpdater()
|
|
18
|
-
private let PLUGIN_VERSION: String = "5.2.
|
|
18
|
+
private let PLUGIN_VERSION: String = "5.2.14"
|
|
19
19
|
static let updateUrlDefault = "https://api.capgo.app/updates"
|
|
20
20
|
static let statsUrlDefault = "https://api.capgo.app/stats"
|
|
21
21
|
static let channelUrlDefault = "https://api.capgo.app/channel_self"
|