@capacitor/android 9.0.0-alpha.7 → 9.0.0-beta.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.
@@ -1,10 +1,10 @@
1
1
  ext {
2
2
  androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.13.0'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.8.0'
4
4
  androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.3.0'
5
- androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.19.0'
6
- androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.8.9'
7
- androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.16.0'
5
+ androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.19.1'
6
+ androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.9.1'
7
+ androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.17.1'
8
8
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
9
9
  androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
10
10
  androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
@@ -20,7 +20,7 @@ buildscript {
20
20
  }
21
21
  }
22
22
  dependencies {
23
- classpath 'com.android.tools.build:gradle:9.2.1'
23
+ classpath 'com.android.tools.build:gradle:9.4.1'
24
24
 
25
25
  if (System.getenv("CAP_PUBLISH") == "true") {
26
26
  classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
@@ -14,3 +14,15 @@
14
14
  }
15
15
 
16
16
  -keep public class * extends com.getcapacitor.Plugin { *; }
17
+
18
+ # The annotation types are read at runtime via reflection. If they are not kept, R8 full mode
19
+ # treats them as never instantiated and optimizes the annotation cached in PluginHandle to null,
20
+ # even with -keepattributes *Annotation*.
21
+ -keep @interface com.getcapacitor.annotation.** { *; }
22
+ -keep @interface com.getcapacitor.PluginMethod { *; }
23
+
24
+ # Callback methods are found by reflection, including on non-public base classes.
25
+ -keepclassmembers class * extends com.getcapacitor.Plugin {
26
+ @com.getcapacitor.annotation.ActivityCallback <methods>;
27
+ @com.getcapacitor.annotation.PermissionCallback <methods>;
28
+ }
@@ -490,9 +490,12 @@ public class CapacitorHttpUrlConnection implements ICapacitorHttpUrlConnection {
490
490
  }
491
491
 
492
492
  public void setSSLSocketFactory(Bridge bridge) {
493
- // Attach SSL Certificates if Enterprise Plugin is available
493
+ // Attach SSL Certificates if an SSL Pinning plugin is available
494
494
  try {
495
- Class<?> sslPinningImpl = Class.forName("io.ionic.sslpinning.SSLPinning");
495
+ Class<?> sslPinningImpl = findSSLPinningClass();
496
+ if (sslPinningImpl == null) {
497
+ return;
498
+ }
496
499
  Method method = sslPinningImpl.getDeclaredMethod("getSSLSocketFactory", Bridge.class);
497
500
  SSLSocketFactory sslSocketFactory = (SSLSocketFactory) method.invoke(
498
501
  sslPinningImpl.getDeclaredConstructor().newInstance(),
@@ -503,4 +506,13 @@ public class CapacitorHttpUrlConnection implements ICapacitorHttpUrlConnection {
503
506
  }
504
507
  } catch (Exception ignored) {}
505
508
  }
509
+
510
+ private static Class<?> findSSLPinningClass() {
511
+ for (String className : new String[] { "io.ionic.sslpinning.SSLPinning", "com.getcapacitor.community.sslpinning.SSLPinning" }) {
512
+ try {
513
+ return Class.forName(className);
514
+ } catch (ClassNotFoundException ignored) {}
515
+ }
516
+ return null;
517
+ }
506
518
  }
@@ -450,7 +450,10 @@ public class HttpRequestHandler {
450
450
 
451
451
  public static Boolean isDomainExcludedFromSSL(Bridge bridge, URL url) {
452
452
  try {
453
- Class<?> sslPinningImpl = Class.forName("io.ionic.sslpinning.SSLPinning");
453
+ Class<?> sslPinningImpl = findSSLPinningClass();
454
+ if (sslPinningImpl == null) {
455
+ return false;
456
+ }
454
457
  Method method = sslPinningImpl.getDeclaredMethod("isDomainExcluded", Bridge.class, URL.class);
455
458
  return (Boolean) method.invoke(sslPinningImpl.getDeclaredConstructor().newInstance(), bridge, url);
456
459
  } catch (Exception ignored) {
@@ -458,6 +461,15 @@ public class HttpRequestHandler {
458
461
  }
459
462
  }
460
463
 
464
+ private static Class<?> findSSLPinningClass() {
465
+ for (String className : new String[] { "io.ionic.sslpinning.SSLPinning", "com.getcapacitor.community.sslpinning.SSLPinning" }) {
466
+ try {
467
+ return Class.forName(className);
468
+ } catch (ClassNotFoundException ignored) {}
469
+ }
470
+ return null;
471
+ }
472
+
461
473
  @FunctionalInterface
462
474
  public interface ProgressEmitter {
463
475
  void emit(Integer bytes, Integer contentLength);
@@ -1,6 +1,6 @@
1
1
  ext {
2
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
3
- cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '15.0.0'
2
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.8.0'
3
+ cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '15.1.0'
4
4
  }
5
5
 
6
6
  buildscript {
@@ -9,7 +9,7 @@ buildscript {
9
9
  mavenCentral()
10
10
  }
11
11
  dependencies {
12
- classpath 'com.android.tools.build:gradle:9.2.1'
12
+ classpath 'com.android.tools.build:gradle:9.4.1'
13
13
  }
14
14
  }
15
15
 
@@ -0,0 +1 @@
1
+ <resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@xml/config" />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/android",
3
- "version": "9.0.0-alpha.7",
3
+ "version": "9.0.0-beta.0",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
@@ -26,7 +26,7 @@
26
26
  "verify": "./gradlew :capacitor-android:clean :capacitor-android:lint :capacitor-android:build :capacitor-android:test"
27
27
  },
28
28
  "peerDependencies": {
29
- "@capacitor/core": "^9.0.0-alpha.7"
29
+ "@capacitor/core": "^9.0.0-beta.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"