@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
|
@@ -146,7 +146,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
146
146
|
static final int APPLICATION_EXIT_REASON_USER_REQUESTED = 10;
|
|
147
147
|
static final int APPLICATION_EXIT_REASON_DEPENDENCY_DIED = 12;
|
|
148
148
|
|
|
149
|
-
private final String pluginVersion = "6.51.
|
|
149
|
+
private final String pluginVersion = "6.51.21";
|
|
150
150
|
private static final String DELAY_CONDITION_PREFERENCES = "";
|
|
151
151
|
|
|
152
152
|
private SharedPreferences.Editor editor;
|
|
@@ -2139,9 +2139,10 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
2139
2139
|
);
|
|
2140
2140
|
}
|
|
2141
2141
|
} else {
|
|
2142
|
-
final boolean enabled =
|
|
2143
|
-
|
|
2144
|
-
|
|
2142
|
+
final boolean enabled =
|
|
2143
|
+
configuredMode != null
|
|
2144
|
+
? "true".equals(configuredMode)
|
|
2145
|
+
: Boolean.TRUE.equals(this.getConfig().getBoolean("autoUpdate", true));
|
|
2145
2146
|
this.autoUpdateMode = enabled
|
|
2146
2147
|
? autoUpdateModeForLegacyDirectUpdateMode(this.resolveLegacyDirectUpdateModeFromConfig())
|
|
2147
2148
|
: AUTO_UPDATE_MODE_OFF;
|
|
@@ -4013,33 +4014,30 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
4013
4014
|
this.editor.putBoolean(PREVIEW_SESSION_ALERT_PENDING_PREF_KEY, false);
|
|
4014
4015
|
this.editor.apply();
|
|
4015
4016
|
|
|
4016
|
-
new Handler(Looper.getMainLooper()).postDelayed(
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
if (getActivity() == null || getActivity().isFinishing()) {
|
|
4023
|
-
this.previewSessionAlertPending = true;
|
|
4024
|
-
this.editor.putBoolean(PREVIEW_SESSION_ALERT_PENDING_PREF_KEY, true);
|
|
4025
|
-
this.editor.apply();
|
|
4026
|
-
return;
|
|
4027
|
-
}
|
|
4028
|
-
|
|
4029
|
-
new AlertDialog.Builder(getActivity())
|
|
4030
|
-
.setTitle("Preview started")
|
|
4031
|
-
.setMessage("shake".equals(this.shakeMenuGesture) ? "Shake to open menu." : "Three-finger pinch to open menu.")
|
|
4032
|
-
.setPositiveButton("Got it", (dialog, which) -> dialog.dismiss())
|
|
4033
|
-
.show();
|
|
4034
|
-
} catch (final Exception e) {
|
|
4017
|
+
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
|
4018
|
+
try {
|
|
4019
|
+
if (!Boolean.TRUE.equals(this.previewSessionEnabled)) {
|
|
4020
|
+
return;
|
|
4021
|
+
}
|
|
4022
|
+
if (getActivity() == null || getActivity().isFinishing()) {
|
|
4035
4023
|
this.previewSessionAlertPending = true;
|
|
4036
4024
|
this.editor.putBoolean(PREVIEW_SESSION_ALERT_PENDING_PREF_KEY, true);
|
|
4037
4025
|
this.editor.apply();
|
|
4038
|
-
|
|
4026
|
+
return;
|
|
4039
4027
|
}
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4028
|
+
|
|
4029
|
+
new AlertDialog.Builder(getActivity())
|
|
4030
|
+
.setTitle("Preview started")
|
|
4031
|
+
.setMessage("shake".equals(this.shakeMenuGesture) ? "Shake to open menu." : "Three-finger pinch to open menu.")
|
|
4032
|
+
.setPositiveButton("Got it", (dialog, which) -> dialog.dismiss())
|
|
4033
|
+
.show();
|
|
4034
|
+
} catch (final Exception e) {
|
|
4035
|
+
this.previewSessionAlertPending = true;
|
|
4036
|
+
this.editor.putBoolean(PREVIEW_SESSION_ALERT_PENDING_PREF_KEY, true);
|
|
4037
|
+
this.editor.apply();
|
|
4038
|
+
logger.warn("Could not show preview session notice: " + e.getMessage());
|
|
4039
|
+
}
|
|
4040
|
+
}, 600);
|
|
4043
4041
|
}
|
|
4044
4042
|
|
|
4045
4043
|
@PluginMethod
|
|
@@ -4785,8 +4783,8 @@ public class CapacitorUpdaterPlugin extends Plugin {
|
|
|
4785
4783
|
final String messageUpdate = initialDirectUpdateAllowed
|
|
4786
4784
|
? "Update will occur now."
|
|
4787
4785
|
: this.shouldAutoSetNextBundle()
|
|
4788
|
-
|
|
4789
|
-
|
|
4786
|
+
? "Update will occur next time app moves to background."
|
|
4787
|
+
: "Update will be downloaded and made available.";
|
|
4790
4788
|
Thread newTask = startNewThread(() -> {
|
|
4791
4789
|
if (CapacitorUpdaterPlugin.this.shouldBlockAutoUpdateForPreviewSession()) {
|
|
4792
4790
|
CapacitorUpdaterPlugin.this.clearBackgroundDownloadState();
|