@capgo/capacitor-updater 8.45.9 → 8.45.10
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/build.gradle
CHANGED
|
@@ -54,7 +54,7 @@ dependencies {
|
|
|
54
54
|
implementation "androidx.work:work-runtime:$work_version"
|
|
55
55
|
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_version"
|
|
56
56
|
implementation "com.google.android.gms:play-services-tasks:18.4.1"
|
|
57
|
-
implementation "com.google.guava:guava:33.
|
|
57
|
+
implementation "com.google.guava:guava:33.6.0-android"
|
|
58
58
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
59
59
|
implementation project(':capacitor-android')
|
|
60
60
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
@@ -90,7 +90,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
90
90
|
private static final int SPLASH_SCREEN_MAX_RETRIES = 20;
|
|
91
91
|
private static final long PENDING_BUNDLE_APP_READY_MIN_TIMEOUT_MS = 30000L;
|
|
92
92
|
|
|
93
|
-
private final String pluginVersion = "8.45.
|
|
93
|
+
private final String pluginVersion = "8.45.10";
|
|
94
94
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
95
95
|
|
|
96
96
|
private SharedPreferences.Editor editor;
|
|
@@ -1505,49 +1505,51 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
1505
1505
|
|
|
1506
1506
|
@PluginMethod
|
|
1507
1507
|
public void reload(final PluginCall call) {
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
this.implementation.prepareResetStateForTransition();
|
|
1519
|
-
didApplyPendingBundle = true;
|
|
1520
|
-
} else {
|
|
1521
|
-
didApplyPendingBundle = this.implementation.stagePendingReload(next);
|
|
1522
|
-
}
|
|
1523
|
-
if (didApplyPendingBundle && this._reload()) {
|
|
1508
|
+
startNewThread(() -> {
|
|
1509
|
+
try {
|
|
1510
|
+
final BundleInfo current = this.implementation.getCurrentBundle();
|
|
1511
|
+
final BundleInfo next = this.implementation.getNextBundle();
|
|
1512
|
+
|
|
1513
|
+
if (next != null && !next.isErrorStatus() && !next.getId().equals(current.getId())) {
|
|
1514
|
+
final CapgoUpdater.ResetState previousState = this.implementation.captureResetState();
|
|
1515
|
+
final String previousBundleName = this.implementation.getCurrentBundle().getVersionName();
|
|
1516
|
+
logger.info("Applying pending bundle before reload: " + next.getVersionName());
|
|
1517
|
+
final boolean didApplyPendingBundle;
|
|
1524
1518
|
if (next.isBuiltin()) {
|
|
1525
|
-
this.implementation.
|
|
1519
|
+
this.implementation.prepareResetStateForTransition();
|
|
1520
|
+
didApplyPendingBundle = true;
|
|
1526
1521
|
} else {
|
|
1527
|
-
this.implementation.
|
|
1522
|
+
didApplyPendingBundle = this.implementation.stagePendingReload(next);
|
|
1528
1523
|
}
|
|
1529
|
-
this.
|
|
1530
|
-
|
|
1531
|
-
|
|
1524
|
+
if (didApplyPendingBundle && this._reload()) {
|
|
1525
|
+
if (next.isBuiltin()) {
|
|
1526
|
+
this.implementation.finalizeResetTransition(previousBundleName, false);
|
|
1527
|
+
} else {
|
|
1528
|
+
this.implementation.finalizePendingReload(next, previousBundleName);
|
|
1529
|
+
}
|
|
1530
|
+
this.notifyBundleSet(next);
|
|
1531
|
+
this.implementation.setNextBundle(null);
|
|
1532
|
+
call.resolve();
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
this.implementation.restoreResetState(previousState);
|
|
1536
|
+
this.restoreLiveBundleStateAfterFailedReload();
|
|
1537
|
+
logger.error("Reload failed after applying pending bundle: " + next.getVersionName());
|
|
1538
|
+
call.reject("Reload failed after applying pending bundle: " + next.getVersionName());
|
|
1532
1539
|
return;
|
|
1533
1540
|
}
|
|
1534
|
-
this.implementation.restoreResetState(previousState);
|
|
1535
|
-
this.restoreLiveBundleStateAfterFailedReload();
|
|
1536
|
-
logger.error("Reload failed after applying pending bundle: " + next.getVersionName());
|
|
1537
|
-
call.reject("Reload failed after applying pending bundle: " + next.getVersionName());
|
|
1538
|
-
return;
|
|
1539
|
-
}
|
|
1540
1541
|
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1542
|
+
if (this._reload()) {
|
|
1543
|
+
call.resolve();
|
|
1544
|
+
} else {
|
|
1545
|
+
logger.error("Reload failed");
|
|
1546
|
+
call.reject("Reload failed");
|
|
1547
|
+
}
|
|
1548
|
+
} catch (final Exception e) {
|
|
1549
|
+
logger.error("Could not reload " + e.getMessage());
|
|
1550
|
+
call.reject("Could not reload", e);
|
|
1546
1551
|
}
|
|
1547
|
-
}
|
|
1548
|
-
logger.error("Could not reload " + e.getMessage());
|
|
1549
|
-
call.reject("Could not reload", e);
|
|
1550
|
-
}
|
|
1552
|
+
});
|
|
1551
1553
|
}
|
|
1552
1554
|
|
|
1553
1555
|
@PluginMethod
|
|
@@ -72,7 +72,7 @@ public class CapacitorUpdaterPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
72
72
|
CAPPluginMethod(name: "completeFlexibleUpdate", returnType: CAPPluginReturnPromise)
|
|
73
73
|
]
|
|
74
74
|
public var implementation = CapgoUpdater()
|
|
75
|
-
private let pluginVersion: String = "8.45.
|
|
75
|
+
private let pluginVersion: String = "8.45.10"
|
|
76
76
|
static let updateUrlDefault = "https://plugin.capgo.app/updates"
|
|
77
77
|
static let statsUrlDefault = "https://plugin.capgo.app/stats"
|
|
78
78
|
static let channelUrlDefault = "https://plugin.capgo.app/channel_self"
|