@capgo/capacitor-updater 8.54.2 → 9.0.1

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.
Files changed (45) hide show
  1. package/CapgoCapacitorUpdater.podspec +2 -2
  2. package/Package.swift +3 -4
  3. package/README.md +162 -417
  4. package/android/build.gradle +7 -7
  5. package/android/consumer-rules.pro +48 -0
  6. package/android/proguard-rules.pro +1 -23
  7. package/android/src/main/java/ee/forgr/capacitor_updater/CapacitorUpdaterPlugin.java +1420 -404
  8. package/android/src/main/java/ee/forgr/capacitor_updater/CapgoUpdater.java +1100 -308
  9. package/android/src/main/java/ee/forgr/capacitor_updater/CryptoCipher.java +102 -65
  10. package/android/src/main/java/ee/forgr/capacitor_updater/DownloadService.java +155 -18
  11. package/android/src/main/java/ee/forgr/capacitor_updater/DownloadWorkerManager.java +22 -2
  12. package/android/src/main/java/ee/forgr/capacitor_updater/HeadlessUpdateWorker.java +82 -21
  13. package/android/src/main/java/ee/forgr/capacitor_updater/Http3.java +356 -0
  14. package/android/src/main/java/ee/forgr/capacitor_updater/HttpEngineTransport.java +553 -0
  15. package/dist/docs.json +44 -566
  16. package/dist/esm/definitions.d.ts +97 -215
  17. package/dist/esm/definitions.js.map +1 -1
  18. package/ios/Sources/CapacitorUpdaterPlugin/CapacitorUpdaterPlugin.swift +197 -84
  19. package/ios/Sources/CapacitorUpdaterPlugin/CapgoUpdater.swift +402 -139
  20. package/ios/Sources/CapacitorUpdaterPlugin/CryptoCipher.swift +81 -55
  21. package/ios/Sources/CapacitorUpdaterPlugin/RedirectPolicyDelegate.swift +24 -0
  22. package/ios/Sources/CapacitorUpdaterPlugin/ShakeMenu.swift +2 -1
  23. package/ios/Sources/CapacitorUpdaterPlugin/WKWebView+CapgoObjcBridge.swift +20 -0
  24. package/ios/Tests/CapacitorUpdaterPluginTests/BuiltinHashesTests.swift +210 -0
  25. package/ios/Tests/CapacitorUpdaterPluginTests/BundleHardeningTests.swift +292 -0
  26. package/ios/Tests/CapacitorUpdaterPluginTests/CapacitorUpdaterPluginTests.swift +3905 -0
  27. package/ios/Tests/CapacitorUpdaterPluginTests/CapgoSemanticVersionTests.swift +64 -0
  28. package/ios/Tests/CapacitorUpdaterPluginTests/ChecksumRequiredTests.swift +151 -0
  29. package/ios/Tests/CapacitorUpdaterPluginTests/CliCryptoFixtureTests.swift +249 -0
  30. package/ios/Tests/CapacitorUpdaterPluginTests/HttpsOnlyBuiltinMinimumTests.swift +528 -0
  31. package/ios/Tests/CapacitorUpdaterPluginTests/InstallPerfTests.swift +174 -0
  32. package/ios/Tests/CapacitorUpdaterPluginTests/ListChannelsTests.swift +74 -0
  33. package/ios/Tests/CapacitorUpdaterPluginTests/LoggerSecurityTests.swift +149 -0
  34. package/ios/Tests/CapacitorUpdaterPluginTests/NativeContractTests.swift +160 -0
  35. package/ios/Tests/CapacitorUpdaterPluginTests/NetworkTransportTests.swift +1095 -0
  36. package/ios/Tests/CapacitorUpdaterPluginTests/PopulateDeltaCacheTests.swift +573 -0
  37. package/ios/Tests/CapacitorUpdaterPluginTests/RedirectPolicyTests.swift +63 -0
  38. package/ios/Tests/CapacitorUpdaterPluginTests/RsaContractTests.swift +281 -0
  39. package/ios/Tests/CapacitorUpdaterPluginTests/SessionKeyRequiredTests.swift +192 -0
  40. package/ios/Tests/CapacitorUpdaterPluginTests/TestZipWriter.swift +235 -0
  41. package/ios/Tests/CapacitorUpdaterPluginTests/UpdateLifecycleTests.swift +454 -0
  42. package/ios/Tests/CapacitorUpdaterPluginTests/WebKitOverlayGuardTests.swift +32 -0
  43. package/ios/Tests/CapacitorUpdaterPluginTests/ZipArchiveReaderTests.swift +302 -0
  44. package/ios/Tests/CapacitorUpdaterPluginTests/ZipBundleExtractionTests.swift +122 -0
  45. package/package.json +15 -13
@@ -1,6 +1,6 @@
1
1
  ext {
2
2
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.8.0'
4
4
  androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
5
5
  androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
6
6
  okhttpVersion = project.hasProperty('okhttpVersion') ? rootProject.ext.okhttpVersion : '4.12.0'
@@ -12,7 +12,7 @@ buildscript {
12
12
  mavenCentral()
13
13
  }
14
14
  dependencies {
15
- classpath 'com.android.tools.build:gradle:8.13.0'
15
+ classpath 'com.android.tools.build:gradle:9.4.1'
16
16
  }
17
17
  }
18
18
 
@@ -20,13 +20,13 @@ apply plugin: 'com.android.library'
20
20
 
21
21
  android {
22
22
  namespace = "ee.forgr.capacitor_updater"
23
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
23
+ compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 37
24
24
  defaultConfig {
25
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
26
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
25
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26
27
26
  versionCode 1
28
27
  versionName "1.0"
29
28
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29
+ consumerProguardFiles 'consumer-rules.pro'
30
30
  }
31
31
  buildTypes {
32
32
  release {
@@ -35,7 +35,7 @@ android {
35
35
  }
36
36
  }
37
37
  lintOptions {
38
- abortOnError false
38
+ abortOnError = false
39
39
  }
40
40
  compileOptions {
41
41
  sourceCompatibility JavaVersion.VERSION_21
@@ -63,7 +63,7 @@ dependencies {
63
63
  testImplementation "junit:junit:$junitVersion"
64
64
  testImplementation 'org.mockito:mockito-core:5.24.0'
65
65
  testImplementation 'org.json:json:20250517'
66
- testImplementation 'org.robolectric:robolectric:4.17'
66
+ testImplementation 'org.robolectric:robolectric:4.18'
67
67
  testImplementation 'androidx.arch.core:core-testing:2.2.0'
68
68
  testImplementation "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
69
69
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
@@ -0,0 +1,48 @@
1
+ # Consumer ProGuard / R8 rules: merged into apps that depend on this library (Capacitor 9 enables release minify by default).
2
+
3
+ # Capacitor reflects plugin classes and @PluginMethod entries; keep this plugin and its methods.
4
+ -keep @com.getcapacitor.annotation.CapacitorPlugin class ee.forgr.capacitor_updater.CapacitorUpdaterPlugin { *; }
5
+ -keepclassmembers class ee.forgr.capacitor_updater.CapacitorUpdaterPlugin {
6
+ @com.getcapacitor.PluginMethod <methods>;
7
+ }
8
+
9
+ # Inner types on the plugin (for example autoSplashscreen helper call construction).
10
+ -keep class ee.forgr.capacitor_updater.CapacitorUpdaterPlugin$* { *; }
11
+
12
+ # Splash automation calls other plugins through PluginHandle; Capacitor may route that by name, so keep invoke.
13
+ -keepclassmembers class * implements com.getcapacitor.PluginHandle {
14
+ public void invoke(java.lang.String, com.getcapacitor.PluginCall);
15
+ }
16
+
17
+ # FireAndForgetPluginCall supplies a null MessageHandler; keep the constructor signature PluginCall uses at runtime.
18
+ -keep class com.getcapacitor.PluginCall {
19
+ <init>(com.getcapacitor.MessageHandler, java.lang.String, java.lang.String, java.lang.String, com.getcapacitor.JSObject);
20
+ }
21
+
22
+ # Constructor parameter type for the kept PluginCall signature above.
23
+ -keep class com.getcapacitor.MessageHandler { *; }
24
+
25
+ # Optional Background Runner integration: Class.forName for the worker when that plugin is installed.
26
+ -keep class io.ionic.backgroundrunner.plugin.RunnerWorker {
27
+ <init>(android.content.Context, androidx.work.WorkerParameters);
28
+ }
29
+
30
+ # Document start script support reflects WebViewFeature and WebViewCompat by name on older API levels.
31
+ -keepclassmembers class androidx.webkit.WebViewFeature {
32
+ public static final java.lang.String DOCUMENT_START_SCRIPT;
33
+ public static boolean isFeatureSupported(java.lang.String);
34
+ }
35
+ -keep class androidx.webkit.WebViewCompat {
36
+ public static void addDocumentStartJavaScript(android.webkit.WebView, java.lang.String, java.util.Set);
37
+ }
38
+
39
+ # WorkManager constructs these worker classes by class object or class name at runtime.
40
+ -keepclassmembers class ee.forgr.capacitor_updater.DownloadService {
41
+ <init>(android.content.Context, androidx.work.WorkerParameters);
42
+ }
43
+ -keepclassmembers class ee.forgr.capacitor_updater.HeadlessUpdateWorker {
44
+ <init>(android.content.Context, androidx.work.WorkerParameters);
45
+ }
46
+
47
+ # Used by Capacitor and androidx APIs that read annotations and generic types at runtime.
48
+ -keepattributes *Annotation*, Signature
@@ -20,26 +20,4 @@
20
20
  # hide the original source file name.
21
21
  #-renamesourcefileattribute SourceFile
22
22
 
23
- # Preserve annotation and signature metadata used by runtime checks
24
- -keepattributes *Annotation*, Signature
25
-
26
- # Preserve the entire Capgo plugin package
27
- -keep class ee.forgr.capacitor_updater.** { *; }
28
-
29
- # Preserve Capacitor classes and members accessed via reflection for autoSplashscreen
30
- # These rules are safe even if SplashScreen plugin is not present - they only reference core Capacitor classes
31
- -keep class com.getcapacitor.Bridge {
32
- com.getcapacitor.MessageHandler msgHandler;
33
- }
34
-
35
- -keep class com.getcapacitor.MessageHandler { *; }
36
-
37
- -keep class com.getcapacitor.PluginCall {
38
- <init>(com.getcapacitor.MessageHandler, java.lang.String, java.lang.String, java.lang.String, com.getcapacitor.JSObject);
39
- }
40
-
41
- # Keep SplashScreen plugin methods that are called via reflection
42
- # This applies to any plugin, not just SplashScreen
43
- -keep class * implements com.getcapacitor.PluginHandle {
44
- public void invoke(java.lang.String, com.getcapacitor.PluginCall);
45
- }
23
+ # Rules needed by consuming apps ship in consumer-rules.pro (see consumerProguardFiles in build.gradle).