@capgo/capacitor-updater 5.51.17 → 5.51.23
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 +51 -42
- package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +44 -30
- package/android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java +437 -351
- package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipher.java +51 -18
- package/android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java +330 -92
- 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/docs.json +4 -4
- package/dist/esm/definitions.d.ts +12 -9
- package/dist/esm/definitions.js.map +1 -1
- 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 +245 -95
- package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +190 -35
- package/ios/Sources/CapacitorUpdaterPlugin/CryptoCipher.swift +39 -31
- package/ios/Sources/CapacitorUpdaterPlugin/DelayUpdateUtils.swift +16 -41
- package/ios/Sources/CapacitorUpdaterPlugin/ShakeMenu.swift +6 -3
- package/package.json +6 -8
|
@@ -233,8 +233,7 @@ public class ShakeMenu implements ShakeDetector.Listener, ThreeFingerPinchDetect
|
|
|
233
233
|
isShowing = false;
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
})
|
|
237
|
-
.start();
|
|
236
|
+
}).start();
|
|
238
237
|
}
|
|
239
238
|
|
|
240
239
|
private void setPreviewMenuButtonsEnabled(List<Button> buttons, boolean enabled) {
|
|
@@ -383,8 +382,7 @@ public class ShakeMenu implements ShakeDetector.Listener, ThreeFingerPinchDetect
|
|
|
383
382
|
} finally {
|
|
384
383
|
isShowing = false;
|
|
385
384
|
}
|
|
386
|
-
})
|
|
387
|
-
.start();
|
|
385
|
+
}).start();
|
|
388
386
|
}
|
|
389
387
|
|
|
390
388
|
private void showConfiguredDefaultMenu() {
|
|
@@ -571,8 +569,7 @@ public class ShakeMenu implements ShakeDetector.Listener, ThreeFingerPinchDetect
|
|
|
571
569
|
presentChannelPicker(channels);
|
|
572
570
|
});
|
|
573
571
|
});
|
|
574
|
-
})
|
|
575
|
-
.start();
|
|
572
|
+
}).start();
|
|
576
573
|
} catch (Exception e) {
|
|
577
574
|
logger.error("Error showing channel selector: " + e.getMessage());
|
|
578
575
|
isShowing = false;
|
|
@@ -765,11 +762,12 @@ public class ShakeMenu implements ShakeDetector.Listener, ThreeFingerPinchDetect
|
|
|
765
762
|
String latestKind = getString(latestRes, "kind");
|
|
766
763
|
String latestMessage = getString(latestRes, "message");
|
|
767
764
|
|
|
768
|
-
String detail =
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
765
|
+
String detail =
|
|
766
|
+
latestMessage != null && !latestMessage.isEmpty()
|
|
767
|
+
? latestMessage
|
|
768
|
+
: latestError != null && !latestError.isEmpty()
|
|
769
|
+
? latestError
|
|
770
|
+
: latestKind != null && !latestKind.isEmpty()
|
|
773
771
|
? latestKind
|
|
774
772
|
: "server did not provide a message";
|
|
775
773
|
|
|
@@ -837,9 +835,8 @@ public class ShakeMenu implements ShakeDetector.Listener, ThreeFingerPinchDetect
|
|
|
837
835
|
|
|
838
836
|
// A manifest-only response has no zip URL; downloadManifest
|
|
839
837
|
// tolerates the placeholder URL the plugin already uses.
|
|
840
|
-
final String downloadUrl =
|
|
841
|
-
? "https://404.capgo.app/no.zip"
|
|
842
|
-
: latestUrl;
|
|
838
|
+
final String downloadUrl =
|
|
839
|
+
latestUrl == null || latestUrl.isEmpty() ? "https://404.capgo.app/no.zip" : latestUrl;
|
|
843
840
|
|
|
844
841
|
// Download the update
|
|
845
842
|
try {
|
|
@@ -896,8 +893,7 @@ public class ShakeMenu implements ShakeDetector.Listener, ThreeFingerPinchDetect
|
|
|
896
893
|
});
|
|
897
894
|
}
|
|
898
895
|
);
|
|
899
|
-
})
|
|
900
|
-
.start();
|
|
896
|
+
}).start();
|
|
901
897
|
} catch (Exception e) {
|
|
902
898
|
logger.error("Error selecting channel: " + e.getMessage());
|
|
903
899
|
isShowing = false;
|
package/dist/docs.json
CHANGED
|
@@ -4631,7 +4631,7 @@
|
|
|
4631
4631
|
"name": "example"
|
|
4632
4632
|
}
|
|
4633
4633
|
],
|
|
4634
|
-
"docs": "Configure how the plugin checks for, downloads, and applies live updates.\n\nThe plugin checks for updates when the app moves to the foreground. When\n{@link periodCheckDelay} is greater than 0, it also checks on a repeating timer\nwhile the app stays open.\n\nBoolean values keep their existing behavior:\n- `true`: Same as `\"atBackground\"`.\n- `false`: Same as `\"off\"`.\n\nString values merge the previous Auto Update and Direct Update configuration:\n- `\"off\"`: Disable automatic update checks.\n- `\"atBackground\"`: Check and download automatically on each foreground check, then apply the update the next time the app moves to background.\n- `\"atInstall\"`: Apply immediately only after a fresh install or native app store update; otherwise use `\"atBackground\"` behavior.\n- `\"onLaunch\"`: Apply immediately only when the app is brought to the foreground from a killed state (cold start). After that first check, fall back to `\"atBackground\"` behavior.\n- `\"always\"`: Check on every foreground transition and apply immediately whenever an update is available.\n- `\"onlyDownload\"`: Check and download automatically, emit `updateAvailable`, and never set the next bundle or apply an update automatically.\n\nOnly available for Android and iOS.",
|
|
4634
|
+
"docs": "Configure how the plugin checks for, downloads, and applies live updates.\n\nThe plugin checks for updates when the app moves to the foreground. When\n{@link periodCheckDelay} is greater than 0, it also checks on a repeating timer\nwhile the app stays open.\n\nBoolean values keep their existing behavior:\n- `true`: Same as `\"atBackground\"`.\n- `false`: Same as `\"off\"`.\n\nString values merge the previous Auto Update and Direct Update configuration:\n- `\"off\"`: Disable automatic update checks.\n- `\"atBackground\"`: Check and download automatically on each foreground check, then apply the update the next time the app moves to background.\n- `\"atInstall\"`: Apply immediately only after a fresh install or native app store update; otherwise use `\"atBackground\"` behavior.\n- `\"onLaunch\"`: Apply immediately only when the app is brought to the foreground from a killed state (cold start). After that first check, fall back to `\"atBackground\"` behavior.\n- `\"always\"`: Check on every foreground transition and apply immediately whenever an update is available.\n- `\"onlyDownload\"`: Check and download automatically, emit `updateAvailable`, and never set the next bundle or apply an update automatically.\n\nInstant apply modes (`\"atInstall\"`, `\"onLaunch\"`, `\"always\"`) apply while the user is waiting.\nUpload with `npx @capgo/cli@latest bundle upload --delta` so only changed files download. A full zip upload slows the user experience.\nThese modes require `autoSplashscreen: true` and `@capacitor/splash-screen` installed with `launchAutoHide: false`.\n\nOnly available for Android and iOS.",
|
|
4635
4635
|
"complexTypes": [],
|
|
4636
4636
|
"type": "boolean | 'always' | 'off' | 'atBackground' | 'atInstall' | 'onLaunch' | 'onlyDownload' | undefined"
|
|
4637
4637
|
},
|
|
@@ -4735,7 +4735,7 @@
|
|
|
4735
4735
|
"name": "directUpdate",
|
|
4736
4736
|
"tags": [
|
|
4737
4737
|
{
|
|
4738
|
-
"text": "Use {@link PluginsConfig.CapacitorUpdater.autoUpdate} string modes instead.\
|
|
4738
|
+
"text": "Use {@link PluginsConfig.CapacitorUpdater.autoUpdate} string modes instead.\n\nOnly available for Android and iOS.",
|
|
4739
4739
|
"name": "deprecated"
|
|
4740
4740
|
},
|
|
4741
4741
|
{
|
|
@@ -4747,7 +4747,7 @@
|
|
|
4747
4747
|
"name": "since"
|
|
4748
4748
|
}
|
|
4749
4749
|
],
|
|
4750
|
-
"docs": "Configure when the plugin should direct install updates. Only for autoUpdate mode.",
|
|
4750
|
+
"docs": "Configure when the plugin should direct install updates. Only for autoUpdate mode.\nInstant apply (`atInstall`, `onLaunch`, `always`) should be uploaded with `--delta` so the update does not slow the user experience. A full zip, especially over 10MB, is relatively slow for users.\nThese modes require `autoSplashscreen: true` and `@capacitor/splash-screen` installed with `launchAutoHide: false`.\nThis flag makes the CLI upload delta in CI and ask for confirmation in local uploads.\n- false: Never do direct updates\n- atInstall: Same as `\"atInstall\"` for {@link autoUpdate}\n- onLaunch: Same as `\"onLaunch\"` for {@link autoUpdate}\n- always: Same as `\"always\"` for {@link autoUpdate}\n- true: (deprecated) Same as \"always\" for backward compatibility",
|
|
4751
4751
|
"complexTypes": [],
|
|
4752
4752
|
"type": "boolean | 'always' | 'atInstall' | 'onLaunch' | undefined"
|
|
4753
4753
|
},
|
|
@@ -4763,7 +4763,7 @@
|
|
|
4763
4763
|
"name": "since"
|
|
4764
4764
|
}
|
|
4765
4765
|
],
|
|
4766
|
-
"docs": "Automatically
|
|
4766
|
+
"docs": "Automatically hide the splashscreen after instant apply updates finish, or when no update is needed.\nRequired when using instant apply modes (`\"atInstall\"`, `\"onLaunch\"`, `\"always\"`), including the deprecated `directUpdate` values `\"atInstall\"`, `\"onLaunch\"`, `\"always\"`, and `true`.\n`@capacitor/splash-screen` must be installed and configured with `launchAutoHide: false`.\nThis removes the need to manually listen for appReady events and call SplashScreen.hide().\n\nOnly available for Android and iOS.",
|
|
4767
4767
|
"complexTypes": [],
|
|
4768
4768
|
"type": "boolean | undefined"
|
|
4769
4769
|
},
|
|
@@ -63,6 +63,10 @@ declare module '@capacitor/cli' {
|
|
|
63
63
|
* - `"always"`: Check on every foreground transition and apply immediately whenever an update is available.
|
|
64
64
|
* - `"onlyDownload"`: Check and download automatically, emit `updateAvailable`, and never set the next bundle or apply an update automatically.
|
|
65
65
|
*
|
|
66
|
+
* Instant apply modes (`"atInstall"`, `"onLaunch"`, `"always"`) apply while the user is waiting.
|
|
67
|
+
* Upload with `npx @capgo/cli@latest bundle upload --delta` so only changed files download. A full zip upload slows the user experience.
|
|
68
|
+
* These modes require `autoSplashscreen: true` and `@capacitor/splash-screen` installed with `launchAutoHide: false`.
|
|
69
|
+
*
|
|
66
70
|
* Only available for Android and iOS.
|
|
67
71
|
*
|
|
68
72
|
* @default true
|
|
@@ -131,17 +135,17 @@ declare module '@capacitor/cli' {
|
|
|
131
135
|
version?: string;
|
|
132
136
|
/**
|
|
133
137
|
* Configure when the plugin should direct install updates. Only for autoUpdate mode.
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* Zip or apps more than 10MB will be relatively slow for users to update.
|
|
138
|
+
* Instant apply (`atInstall`, `onLaunch`, `always`) should be uploaded with `--delta` so the update does not slow the user experience. A full zip, especially over 10MB, is relatively slow for users.
|
|
139
|
+
* These modes require `autoSplashscreen: true` and `@capacitor/splash-screen` installed with `launchAutoHide: false`.
|
|
140
|
+
* This flag makes the CLI upload delta in CI and ask for confirmation in local uploads.
|
|
138
141
|
* - false: Never do direct updates
|
|
139
142
|
* - atInstall: Same as `"atInstall"` for {@link autoUpdate}
|
|
140
143
|
* - onLaunch: Same as `"onLaunch"` for {@link autoUpdate}
|
|
141
144
|
* - always: Same as `"always"` for {@link autoUpdate}
|
|
142
145
|
* - true: (deprecated) Same as "always" for backward compatibility
|
|
143
146
|
*
|
|
144
|
-
*
|
|
147
|
+
* @deprecated Use {@link PluginsConfig.CapacitorUpdater.autoUpdate} string modes instead.
|
|
148
|
+
*
|
|
145
149
|
* Only available for Android and iOS.
|
|
146
150
|
*
|
|
147
151
|
* @default false
|
|
@@ -149,11 +153,10 @@ declare module '@capacitor/cli' {
|
|
|
149
153
|
*/
|
|
150
154
|
directUpdate?: boolean | 'atInstall' | 'always' | 'onLaunch';
|
|
151
155
|
/**
|
|
152
|
-
* Automatically
|
|
156
|
+
* Automatically hide the splashscreen after instant apply updates finish, or when no update is needed.
|
|
157
|
+
* Required when using instant apply modes (`"atInstall"`, `"onLaunch"`, `"always"`), including the deprecated `directUpdate` values `"atInstall"`, `"onLaunch"`, `"always"`, and `true`.
|
|
158
|
+
* `@capacitor/splash-screen` must be installed and configured with `launchAutoHide: false`.
|
|
153
159
|
* This removes the need to manually listen for appReady events and call SplashScreen.hide().
|
|
154
|
-
* Only works when autoUpdate is set to "atInstall", "always", or "onLaunch", or when the deprecated directUpdate option is set to "atInstall", "always", "onLaunch", or true.
|
|
155
|
-
* Requires the @capacitor/splash-screen plugin to be installed and configured with launchAutoHide: false.
|
|
156
|
-
* Requires Auto Update and Direct Update behavior to be enabled.
|
|
157
160
|
*
|
|
158
161
|
* Only available for Android and iOS.
|
|
159
162
|
*
|