@capacitor/android 8.0.0-alpha.2 → 8.0.0-alpha.3
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/capacitor/build.gradle +13 -13
- package/capacitor/src/main/java/com/getcapacitor/Bridge.java +13 -13
- package/capacitor/src/main/java/com/getcapacitor/JSExport.java +24 -24
- package/capacitor/src/main/java/com/getcapacitor/MessageHandler.java +7 -7
- package/capacitor/src/main/java/com/getcapacitor/plugin/CapacitorCookies.java +17 -17
- package/package.json +2 -2
- package/capacitor/src/main/res/layout/bridge_layout_main.xml +0 -15
package/capacitor/build.gradle
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
ext {
|
|
2
|
-
androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.
|
|
4
|
-
androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.
|
|
5
|
-
androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.
|
|
6
|
-
androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.8.
|
|
7
|
-
androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.
|
|
2
|
+
androidxActivityVersion = project.hasProperty('androidxActivityVersion') ? rootProject.ext.androidxActivityVersion : '1.11.0'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
|
|
4
|
+
androidxCoordinatorLayoutVersion = project.hasProperty('androidxCoordinatorLayoutVersion') ? rootProject.ext.androidxCoordinatorLayoutVersion : '1.3.0'
|
|
5
|
+
androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.17.0'
|
|
6
|
+
androidxFragmentVersion = project.hasProperty('androidxFragmentVersion') ? rootProject.ext.androidxFragmentVersion : '1.8.9'
|
|
7
|
+
androidxWebkitVersion = project.hasProperty('androidxWebkitVersion') ? rootProject.ext.androidxWebkitVersion : '1.14.0'
|
|
8
8
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
9
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.
|
|
10
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
11
|
-
cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '
|
|
9
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
|
|
10
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
|
|
11
|
+
cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '14.0.1'
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
buildscript {
|
|
16
|
-
ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '
|
|
16
|
+
ext.kotlin_version = project.hasProperty("kotlin_version") ? rootProject.ext.kotlin_version : '2.2.20'
|
|
17
17
|
repositories {
|
|
18
18
|
google()
|
|
19
19
|
mavenCentral()
|
|
@@ -22,7 +22,7 @@ buildscript {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
dependencies {
|
|
25
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
25
|
+
classpath 'com.android.tools.build:gradle:8.13.0'
|
|
26
26
|
|
|
27
27
|
if (System.getenv("CAP_PUBLISH") == "true") {
|
|
28
28
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
@@ -90,7 +90,7 @@ dependencies {
|
|
|
90
90
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
91
91
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
92
92
|
implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
|
|
93
|
-
testImplementation 'org.json:json:
|
|
94
|
-
testImplementation 'org.mockito:mockito-core:5.
|
|
93
|
+
testImplementation 'org.json:json:20250517'
|
|
94
|
+
testImplementation 'org.mockito:mockito-core:5.20.0'
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -462,9 +462,9 @@ public class Bridge {
|
|
|
462
462
|
if (ex instanceof SocketTimeoutException) {
|
|
463
463
|
Logger.error(
|
|
464
464
|
"Unable to load app. Ensure the server is running at " +
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
465
|
+
appUrl +
|
|
466
|
+
", or modify the " +
|
|
467
|
+
"appUrl setting in capacitor.config.json (make sure to npx cap copy after to commit changes).",
|
|
468
468
|
ex
|
|
469
469
|
);
|
|
470
470
|
}
|
|
@@ -748,9 +748,9 @@ public class Bridge {
|
|
|
748
748
|
private void logInvalidPluginException(Class<? extends Plugin> clazz) {
|
|
749
749
|
Logger.error(
|
|
750
750
|
"NativePlugin " +
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
751
|
+
clazz.getName() +
|
|
752
|
+
" is invalid. Ensure the @CapacitorPlugin annotation exists on the plugin class and" +
|
|
753
|
+
" the class extends Plugin"
|
|
754
754
|
);
|
|
755
755
|
}
|
|
756
756
|
|
|
@@ -825,13 +825,13 @@ public class Bridge {
|
|
|
825
825
|
if (Logger.shouldLog()) {
|
|
826
826
|
Logger.verbose(
|
|
827
827
|
"callback: " +
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
828
|
+
call.getCallbackId() +
|
|
829
|
+
", pluginId: " +
|
|
830
|
+
plugin.getId() +
|
|
831
|
+
", methodName: " +
|
|
832
|
+
methodName +
|
|
833
|
+
", methodData: " +
|
|
834
|
+
call.getData().toString()
|
|
835
835
|
);
|
|
836
836
|
}
|
|
837
837
|
|
|
@@ -64,16 +64,16 @@ public class JSExport {
|
|
|
64
64
|
for (PluginHandle plugin : plugins) {
|
|
65
65
|
lines.add(
|
|
66
66
|
"(function(w) {\n" +
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
"var a = (w.Capacitor = w.Capacitor || {});\n" +
|
|
68
|
+
"var p = (a.Plugins = a.Plugins || {});\n" +
|
|
69
|
+
"var t = (p['" +
|
|
70
|
+
plugin.getId() +
|
|
71
|
+
"'] = {});\n" +
|
|
72
|
+
"t.addListener = function(eventName, callback) {\n" +
|
|
73
|
+
" return w.Capacitor.addListener('" +
|
|
74
|
+
plugin.getId() +
|
|
75
|
+
"', eventName, callback);\n" +
|
|
76
|
+
"}"
|
|
77
77
|
);
|
|
78
78
|
Collection<PluginMethodHandle> methods = plugin.getMethods();
|
|
79
79
|
for (PluginMethodHandle method : methods) {
|
|
@@ -171,12 +171,12 @@ public class JSExport {
|
|
|
171
171
|
case PluginMethod.RETURN_NONE:
|
|
172
172
|
lines.add(
|
|
173
173
|
"return w.Capacitor.nativeCallback('" +
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
plugin.getId() +
|
|
175
|
+
"', '" +
|
|
176
|
+
method.getName() +
|
|
177
|
+
"', " +
|
|
178
|
+
CATCHALL_OPTIONS_PARAM +
|
|
179
|
+
")"
|
|
180
180
|
);
|
|
181
181
|
break;
|
|
182
182
|
case PluginMethod.RETURN_PROMISE:
|
|
@@ -187,14 +187,14 @@ public class JSExport {
|
|
|
187
187
|
case PluginMethod.RETURN_CALLBACK:
|
|
188
188
|
lines.add(
|
|
189
189
|
"return w.Capacitor.nativeCallback('" +
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
190
|
+
plugin.getId() +
|
|
191
|
+
"', '" +
|
|
192
|
+
method.getName() +
|
|
193
|
+
"', " +
|
|
194
|
+
CATCHALL_OPTIONS_PARAM +
|
|
195
|
+
", " +
|
|
196
|
+
CALLBACK_PARAM +
|
|
197
|
+
")"
|
|
198
198
|
);
|
|
199
199
|
break;
|
|
200
200
|
default:
|
|
@@ -69,13 +69,13 @@ public class MessageHandler {
|
|
|
69
69
|
Logger.verbose(
|
|
70
70
|
Logger.tags("Plugin"),
|
|
71
71
|
"To native (Cordova plugin): callbackId: " +
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
callbackId +
|
|
73
|
+
", service: " +
|
|
74
|
+
service +
|
|
75
|
+
", action: " +
|
|
76
|
+
action +
|
|
77
|
+
", actionArgs: " +
|
|
78
|
+
actionArgs
|
|
79
79
|
);
|
|
80
80
|
|
|
81
81
|
this.callCordovaPluginMethod(callbackId, service, action, actionArgs);
|
|
@@ -47,30 +47,30 @@ public class CapacitorCookies extends Plugin {
|
|
|
47
47
|
@PluginMethod
|
|
48
48
|
public void getCookies(PluginCall call) {
|
|
49
49
|
this.bridge.eval("document.cookie", (value) -> {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
String cookies = value.substring(1, value.length() - 1);
|
|
51
|
+
String[] cookieArray = cookies.split(";");
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
JSObject cookieMap = new JSObject();
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
for (String cookie : cookieArray) {
|
|
56
|
+
if (cookie.length() > 0) {
|
|
57
|
+
String[] keyValue = cookie.split("=", 2);
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
if (keyValue.length == 2) {
|
|
60
|
+
String key = keyValue[0].trim();
|
|
61
|
+
String val = keyValue[1].trim();
|
|
62
|
+
try {
|
|
63
|
+
key = URLDecoder.decode(keyValue[0].trim(), StandardCharsets.UTF_8.name());
|
|
64
|
+
val = URLDecoder.decode(keyValue[1].trim(), StandardCharsets.UTF_8.name());
|
|
65
|
+
} catch (UnsupportedEncodingException ignored) {}
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
}
|
|
67
|
+
cookieMap.put(key, val);
|
|
69
68
|
}
|
|
70
69
|
}
|
|
70
|
+
}
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
call.resolve(cookieMap);
|
|
73
|
+
});
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
@PluginMethod
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/android",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.3",
|
|
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)",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"verify": "./gradlew clean lint build test -b capacitor/build.gradle"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@capacitor/core": "^8.0.0-alpha.
|
|
26
|
+
"@capacitor/core": "^8.0.0-alpha.3"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
4
|
-
xmlns:tools="http://schemas.android.com/tools"
|
|
5
|
-
android:layout_width="match_parent"
|
|
6
|
-
android:layout_height="match_parent"
|
|
7
|
-
tools:context="com.getcapacitor.BridgeActivity"
|
|
8
|
-
>
|
|
9
|
-
|
|
10
|
-
<com.getcapacitor.CapacitorWebView
|
|
11
|
-
android:id="@+id/webview"
|
|
12
|
-
android:layout_width="fill_parent"
|
|
13
|
-
android:layout_height="fill_parent" />
|
|
14
|
-
|
|
15
|
-
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|