@capgo/capacitor-updater 8.4.3 → 8.40.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.
@@ -11,9 +11,9 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '15.5'
14
+ s.ios.deployment_target = '15.0'
15
15
  s.dependency 'Capacitor'
16
- s.dependency 'SSZipArchive', '2.6.0'
16
+ s.dependency 'ZIPFoundation', '~> 0.9'
17
17
  s.dependency 'Alamofire', '5.10.2'
18
18
  s.dependency 'Version', '0.8.0'
19
19
  # We cannot update to latest because it not published anymore in cocoa https://github.com/attaswift/BigInt/issues/94
package/Package.swift CHANGED
@@ -3,7 +3,7 @@ import PackageDescription
3
3
 
4
4
  let package = Package(
5
5
  name: "CapgoCapacitorUpdater",
6
- platforms: [.iOS("15.5")],
6
+ platforms: [.iOS("15.0")],
7
7
  products: [
8
8
  .library(
9
9
  name: "CapgoCapacitorUpdater",
@@ -12,7 +12,7 @@ let package = Package(
12
12
  dependencies: [
13
13
  .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0-alpha.3"),
14
14
  .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.10.2")),
15
- .package(url: "https://github.com/ZipArchive/ZipArchive.git", exact: "2.6.0"),
15
+ .package(url: "https://github.com/weichsel/ZIPFoundation.git", from: "0.9.0"),
16
16
  .package(url: "https://github.com/mrackwitz/Version.git", exact: "0.8.0"),
17
17
  .package(url: "https://github.com/attaswift/BigInt.git", from: "5.7.0")
18
18
  ],
@@ -22,7 +22,7 @@ let package = Package(
22
22
  dependencies: [
23
23
  .product(name: "Capacitor", package: "capacitor-swift-pm"),
24
24
  .product(name: "Cordova", package: "capacitor-swift-pm"),
25
- .product(name: "ZipArchive", package: "ZipArchive"),
25
+ .product(name: "ZIPFoundation", package: "ZIPFoundation"),
26
26
  .product(name: "Alamofire", package: "Alamofire"),
27
27
  .product(name: "Version", package: "Version"),
28
28
  .product(name: "BigInt", package: "BigInt")
package/README.md CHANGED
@@ -74,32 +74,6 @@ First follow the migration guide of Capacitor:
74
74
 
75
75
  [https://capacitorjs.com/docs/updating/8-0](https://capacitorjs.com/docs/updating/8-0/)
76
76
 
77
- ### iOS Minimum Version Requirement
78
-
79
- The iOS minimum deployment target has been bumped to **15.5** to ensure that iOS devices with [CVE-2022-36943](https://nvd.nist.gov/vuln/detail/CVE-2022-36943) are excluded. This is the minimum version of the iOS zip library that has the security fix implemented.
80
-
81
- #### Swift Package Manager (SPM) Workaround
82
-
83
- Capacitor currently has a bug ([ionic-team/capacitor#7556](https://github.com/ionic-team/capacitor/issues/7556)) that does not allow setting the iOS deployment target to 15.5 when using SPM.
84
-
85
- If you need SPM support, you can temporarily use our fork:
86
-
87
- **GitHub:** [https://github.com/Cap-go/capacitor-plus](https://github.com/Cap-go/capacitor-plus)
88
-
89
- To use it, replace the CLI package `@capacitor/cli` with `@capacitor-plus/cli`:
90
-
91
- ```bash
92
- npm uninstall @capacitor/cli
93
- npm install @capacitor-plus/cli
94
- ```
95
-
96
- Then use the CLI as usual:
97
-
98
- ```bash
99
- npx capacitor sync
100
- ```
101
-
102
-
103
77
  ## Migration to v7.34
104
78
 
105
79
  - **Channel storage change**: `setChannel()` now stores channel assignments locally on the device instead of in the cloud. This provides better offline support and reduces backend load.
@@ -110,9 +84,9 @@ npx capacitor sync
110
84
 
111
85
  ## Migration to v7
112
86
 
113
- The min version of IOS is now 15.5 instead of 15 as Capacitor 8 requirement.
114
- This is due to bump of ZipArchive to latest, a key dependency of this project is the zlib library. zlib before version 1.2.12 allows memory corruption when deflating (i.e., when compressing) if the input has many distant matches according to [CVE-2018-25032](https://nvd.nist.gov/vuln/detail/cve-2018-25032).
115
- zlib is a native library so we need to bump the minimum iOS version to 15.5 as ZipArchive did the same in their latest versions.
87
+ The minimum iOS version is now **15.0** to match Capacitor 7/8 requirements.
88
+
89
+ Starting from v8, the plugin uses [ZIPFoundation](https://github.com/weichsel/ZIPFoundation) instead of SSZipArchive/ZipArchive for ZIP extraction. ZIPFoundation uses Apple's native `libcompression` framework, which removes the previous zlib dependency and its associated security constraints.
116
90
 
117
91
  ## Compatibility
118
92
 
@@ -283,142 +257,7 @@ Capacitor Updater works by unzipping a compiled app bundle to the native device
283
257
  <docgen-config>
284
258
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
285
259
 
286
- CapacitorUpdater can be configured with these options:
287
-
288
- | Prop | Type | Description | Default | Since |
289
- | ----------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------- |
290
- | **`appReadyTimeout`** | <code>number</code> | Configure the number of milliseconds the native plugin should wait before considering an update 'failed'. Only available for Android and iOS. | <code>10000 // (10 seconds)</code> | |
291
- | **`responseTimeout`** | <code>number</code> | Configure the number of seconds the native plugin should wait before considering API timeout. Only available for Android and iOS. | <code>20 // (20 second)</code> | |
292
- | **`autoDeleteFailed`** | <code>boolean</code> | Configure whether the plugin should use automatically delete failed bundles. Only available for Android and iOS. | <code>true</code> | |
293
- | **`autoDeletePrevious`** | <code>boolean</code> | Configure whether the plugin should use automatically delete previous bundles after a successful update. Only available for Android and iOS. | <code>true</code> | |
294
- | **`autoUpdate`** | <code>boolean</code> | Configure whether the plugin should use Auto Update via an update server. Only available for Android and iOS. | <code>true</code> | |
295
- | **`resetWhenUpdate`** | <code>boolean</code> | Automatically delete previous downloaded bundles when a newer native app bundle is installed to the device. Setting this to false can broke the auto update flow if the user download from the store a native app bundle that is older than the current downloaded bundle. Upload will be prevented by channel setting downgrade_under_native. Only available for Android and iOS. | <code>true</code> | |
296
- | **`updateUrl`** | <code>string</code> | Configure the URL / endpoint to which update checks are sent. Only available for Android and iOS. | <code>https://plugin.capgo.app/updates</code> | |
297
- | **`channelUrl`** | <code>string</code> | Configure the URL / endpoint for channel operations. Only available for Android and iOS. | <code>https://plugin.capgo.app/channel_self</code> | |
298
- | **`statsUrl`** | <code>string</code> | Configure the URL / endpoint to which update statistics are sent. Only available for Android and iOS. Set to "" to disable stats reporting. | <code>https://plugin.capgo.app/stats</code> | |
299
- | **`publicKey`** | <code>string</code> | Configure the public key for end to end live update encryption Version 2 Only available for Android and iOS. | <code>undefined</code> | 6.2.0 |
300
- | **`version`** | <code>string</code> | Configure the current version of the app. This will be used for the first update request. If not set, the plugin will get the version from the native code. Only available for Android and iOS. | <code>undefined</code> | 4.17.48 |
301
- | **`directUpdate`** | <code>boolean \| 'always' \| 'atInstall' \| 'onLaunch'</code> | Configure when the plugin should direct install updates. Only for autoUpdate mode. Works well for apps less than 10MB and with uploads done using --partial flag. Zip or apps more than 10MB will be relatively slow for users to update. - false: Never do direct updates (use default behavior: download at start, set when backgrounded) - atInstall: Direct update only when app is installed, updated from store, otherwise act as directUpdate = false - onLaunch: Direct update only on app installed, updated from store or after app kill, otherwise act as directUpdate = false - always: Direct update in all previous cases (app installed, updated from store, after app kill or app resume), never act as directUpdate = false - true: (deprecated) Same as "always" for backward compatibility Only available for Android and iOS. | <code>false</code> | 5.1.0 |
302
- | **`autoSplashscreen`** | <code>boolean</code> | Automatically handle splashscreen hiding when using directUpdate. When enabled, the plugin will automatically hide the splashscreen after updates are applied or when no update is needed. This removes the need to manually listen for appReady events and call SplashScreen.hide(). Only works when directUpdate is set to "atInstall", "always", "onLaunch", or true. Requires the @capacitor/splash-screen plugin to be installed and configured with launchAutoHide: false. Requires autoUpdate and directUpdate to be enabled. Only available for Android and iOS. | <code>false</code> | 7.6.0 |
303
- | **`autoSplashscreenLoader`** | <code>boolean</code> | Display a native loading indicator on top of the splashscreen while automatic direct updates are running. Only takes effect when {@link autoSplashscreen} is enabled. Requires the @capacitor/splash-screen plugin to be installed and configured with launchAutoHide: false. Only available for Android and iOS. | <code>false</code> | 7.19.0 |
304
- | **`autoSplashscreenTimeout`** | <code>number</code> | Automatically hide the splashscreen after the specified number of milliseconds when using automatic direct updates. If the timeout elapses, the update continues to download in the background while the splashscreen is dismissed. Set to `0` (zero) to disable the timeout. When the timeout fires, the direct update flow is skipped and the downloaded bundle is installed on the next background/launch. Requires {@link autoSplashscreen} to be enabled. Only available for Android and iOS. | <code>10000 // (10 seconds)</code> | 7.19.0 |
305
- | **`periodCheckDelay`** | <code>number</code> | Configure the delay period for period update check. the unit is in seconds. Only available for Android and iOS. Cannot be less than 600 seconds (10 minutes). | <code>0 (disabled)</code> | |
306
- | **`localS3`** | <code>boolean</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
307
- | **`localHost`** | <code>string</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
308
- | **`localWebHost`** | <code>string</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
309
- | **`localSupa`** | <code>string</code> | Configure the CLI to use a local server for testing or self-hosted update server. | <code>undefined</code> | 4.17.48 |
310
- | **`localSupaAnon`** | <code>string</code> | Configure the CLI to use a local server for testing. | <code>undefined</code> | 4.17.48 |
311
- | **`localApi`** | <code>string</code> | Configure the CLI to use a local api for testing. | <code>undefined</code> | 6.3.3 |
312
- | **`localApiFiles`** | <code>string</code> | Configure the CLI to use a local file api for testing. | <code>undefined</code> | 6.3.3 |
313
- | **`allowModifyUrl`** | <code>boolean</code> | Allow the plugin to modify the updateUrl, statsUrl and channelUrl dynamically from the JavaScript side. | <code>false</code> | 5.4.0 |
314
- | **`allowModifyAppId`** | <code>boolean</code> | Allow the plugin to modify the appId dynamically from the JavaScript side. | <code>false</code> | 7.14.0 |
315
- | **`allowManualBundleError`** | <code>boolean</code> | Allow marking bundles as errored from JavaScript while using manual update flows. When enabled, {@link CapacitorUpdaterPlugin.setBundleError} can change a bundle status to `error`. | <code>false</code> | 7.20.0 |
316
- | **`persistCustomId`** | <code>boolean</code> | Persist the customId set through {@link CapacitorUpdaterPlugin.setCustomId} across app restarts. Only available for Android and iOS. | <code>false (will be true by default in a future major release v8.x.x)</code> | 7.17.3 |
317
- | **`persistModifyUrl`** | <code>boolean</code> | Persist the updateUrl, statsUrl and channelUrl set through {@link CapacitorUpdaterPlugin.setUpdateUrl}, {@link CapacitorUpdaterPlugin.setStatsUrl} and {@link CapacitorUpdaterPlugin.setChannelUrl} across app restarts. Only available for Android and iOS. | <code>false</code> | 7.20.0 |
318
- | **`allowSetDefaultChannel`** | <code>boolean</code> | Allow or disallow the {@link CapacitorUpdaterPlugin.setChannel} method to modify the defaultChannel. When set to `false`, calling `setChannel()` will return an error with code `disabled_by_config`. | <code>true</code> | 7.34.0 |
319
- | **`defaultChannel`** | <code>string</code> | Set the default channel for the app in the config. Case sensitive. This will setting will override the default channel set in the cloud, but will still respect overrides made in the cloud. This requires the channel to allow devices to self dissociate/associate in the channel settings. https://capgo.app/docs/public-api/channels/#channel-configuration-options | <code>undefined</code> | 5.5.0 |
320
- | **`appId`** | <code>string</code> | Configure the app id for the app in the config. | <code>undefined</code> | 6.0.0 |
321
- | **`keepUrlPathAfterReload`** | <code>boolean</code> | Configure the plugin to keep the URL path after a reload. WARNING: When a reload is triggered, 'window.history' will be cleared. | <code>false</code> | 6.8.0 |
322
- | **`disableJSLogging`** | <code>boolean</code> | Disable the JavaScript logging of the plugin. if true, the plugin will not log to the JavaScript console. only the native log will be done | <code>false</code> | 7.3.0 |
323
- | **`shakeMenu`** | <code>boolean</code> | Enable shake gesture to show update menu for debugging/testing purposes | <code>false</code> | 7.5.0 |
324
-
325
- ### Examples
326
-
327
- In `capacitor.config.json`:
328
260
 
329
- ```json
330
- {
331
- "plugins": {
332
- "CapacitorUpdater": {
333
- "appReadyTimeout": 1000 // (1 second, minimum 1000),
334
- "responseTimeout": 10 // (10 second),
335
- "autoDeleteFailed": false,
336
- "autoDeletePrevious": false,
337
- "autoUpdate": false,
338
- "resetWhenUpdate": false,
339
- "updateUrl": https://example.com/api/auto_update,
340
- "channelUrl": https://example.com/api/channel,
341
- "statsUrl": https://example.com/api/stats,
342
- "publicKey": undefined,
343
- "version": undefined,
344
- "directUpdate": undefined,
345
- "autoSplashscreen": undefined,
346
- "autoSplashscreenLoader": undefined,
347
- "autoSplashscreenTimeout": undefined,
348
- "periodCheckDelay": 3600 (1 hour),
349
- "localS3": undefined,
350
- "localHost": undefined,
351
- "localWebHost": undefined,
352
- "localSupa": undefined,
353
- "localSupaAnon": undefined,
354
- "localApi": undefined,
355
- "localApiFiles": undefined,
356
- "allowModifyUrl": undefined,
357
- "allowModifyAppId": undefined,
358
- "allowManualBundleError": undefined,
359
- "persistCustomId": undefined,
360
- "persistModifyUrl": undefined,
361
- "allowSetDefaultChannel": undefined,
362
- "defaultChannel": undefined,
363
- "appId": undefined,
364
- "keepUrlPathAfterReload": undefined,
365
- "disableJSLogging": undefined,
366
- "shakeMenu": undefined
367
- }
368
- }
369
- }
370
- ```
371
-
372
- In `capacitor.config.ts`:
373
-
374
- ```ts
375
- /// <reference types="@capgo/capacitor-updater" />
376
-
377
- import { CapacitorConfig } from '@capacitor/cli';
378
-
379
- const config: CapacitorConfig = {
380
- plugins: {
381
- CapacitorUpdater: {
382
- appReadyTimeout: 1000 // (1 second, minimum 1000),
383
- responseTimeout: 10 // (10 second),
384
- autoDeleteFailed: false,
385
- autoDeletePrevious: false,
386
- autoUpdate: false,
387
- resetWhenUpdate: false,
388
- updateUrl: https://example.com/api/auto_update,
389
- channelUrl: https://example.com/api/channel,
390
- statsUrl: https://example.com/api/stats,
391
- publicKey: undefined,
392
- version: undefined,
393
- directUpdate: undefined,
394
- autoSplashscreen: undefined,
395
- autoSplashscreenLoader: undefined,
396
- autoSplashscreenTimeout: undefined,
397
- periodCheckDelay: 3600 (1 hour),
398
- localS3: undefined,
399
- localHost: undefined,
400
- localWebHost: undefined,
401
- localSupa: undefined,
402
- localSupaAnon: undefined,
403
- localApi: undefined,
404
- localApiFiles: undefined,
405
- allowModifyUrl: undefined,
406
- allowModifyAppId: undefined,
407
- allowManualBundleError: undefined,
408
- persistCustomId: undefined,
409
- persistModifyUrl: undefined,
410
- allowSetDefaultChannel: undefined,
411
- defaultChannel: undefined,
412
- appId: undefined,
413
- keepUrlPathAfterReload: undefined,
414
- disableJSLogging: undefined,
415
- shakeMenu: undefined,
416
- },
417
- },
418
- };
419
-
420
- export default config;
421
- ```
422
261
 
423
262
  </docgen-config>
424
263
 
@@ -85,7 +85,7 @@ public class CapacitorUpdaterPlugin extends Plugin {
85
85
  private static final String[] BREAKING_EVENT_NAMES = { "breakingAvailable", "majorAvailable" };
86
86
  private static final String LAST_FAILED_BUNDLE_PREF_KEY = "CapacitorUpdater.lastFailedBundle";
87
87
 
88
- private final String pluginVersion = "8.4.3";
88
+ private final String pluginVersion = "8.40.0";
89
89
  private static final String DELAY_CONDITION_PREFERENCES = "";
90
90
 
91
91
  private SharedPreferences.Editor editor;