Skip to content

Commit 527a089

Browse files
chore: bump wry from 0.53.5 to 0.54.4 (#5544)
* chore: bump wry from 0.53.5 to 0.54.4 Aligns webkit2gtk-sys pin with =2.0.2, allowing Dioxus desktop and Tauri 2.x apps to coexist in the same Cargo workspace. * upgrade to wry 0.55, newest tao * pin git commit for compile * link checker * min version bump --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
1 parent 65b47a6 commit 527a089

8 files changed

Lines changed: 894 additions & 1009 deletions

File tree

Cargo.lock

Lines changed: 839 additions & 992 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,19 +344,19 @@ form_urlencoded = "1.2.2"
344344
winnow = "0.7.14"
345345

346346
# desktop
347-
wry = { version = "0.53.5", default-features = false }
348-
tao = { version = "0.34.0", features = ["rwh_05"] }
347+
wry = { version = "0.55.1", default-features = false }
348+
tao = { version = "0.35.2", features = ["rwh_05"] }
349349
infer = "0.19.0"
350350
dunce = "1.0.5"
351351
percent-encoding = "2.3.2"
352-
muda = "0.17.0"
352+
muda = "0.19.1"
353353
objc2 = { version = "0.6.4", features = ["exception"] }
354354
objc2-foundation = { version = "0.3.2", default-features = false }
355355
objc2-ui-kit = { version = "0.3.2", default-features = false }
356356
objc2-app-kit = { version = "0.3.2", default-features = false }
357-
tray-icon = "0.21.0"
358-
open = "5.3.2"
359-
webbrowser = "1.0"
357+
tray-icon = "0.24.0"
358+
open = "5.3.5"
359+
webbrowser = "1.2.1"
360360

361361
# web
362362
gloo-dialogs = "0.2.0"

packages/cli/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ dunce = { workspace = true }
7575
dirs = { workspace = true }
7676
reqwest = { workspace = true, default-features = false, features = ["rustls-tls", "json"] }
7777
tower = { workspace = true }
78-
git2 = "0.20.4"
78+
git2 = { version = "=0.20.4" }
79+
auth-git2 = { version = "=0.5.6" }
7980

8081
# path lookup
8182
which = { version = "8.0.0" }

packages/cli/assets/android/gen/app/build.gradle.kts.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ android {
7070
dependencies {
7171
implementation("androidx.webkit:webkit:1.13.0")
7272
implementation("androidx.appcompat:appcompat:1.7.1")
73+
implementation("androidx.lifecycle:lifecycle-process:2.8.7")
7374
implementation("com.google.android.material:material:1.13.0")
7475
{{#each gradle_dependencies}}
7576
implementation("{{ this }}")

packages/cli/assets/android/gen/app/src/main/AndroidManifest.xml.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{#if large_heap}}android:largeHeap="{{ large_heap }}"{{/if}}
2727
android:networkSecurityConfig="@xml/network_security_config">
2828
<activity android:configChanges="orientation|screenLayout|screenSize|keyboardHidden" android:exported="true"
29-
android:label="@string/app_name" android:name="dev.dioxus.main.MainActivity">
29+
android:label="@string/app_name" android:launchMode="singleTask" android:name="dev.dioxus.main.MainActivity">
3030
<meta-data android:name="android.app.lib_name" android:value="{{ lib_name }}" />
3131
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
3232
<intent-filter>

packages/const-serialize/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,5 @@ The rust [nomicon](https://doc.rust-lang.org/nomicon/data.html) defines the memo
5353
## Limitations
5454

5555
- Only constant sized types are supported. This means that you can't serialize a type like `Vec<T>`. These types are difficult to create in const contexts in general
56-
- Only types with a well defined memory layout are supported (see <https://github.com/rust-lang/rfcs/pull/3727> and <https://onevariable.com/blog/pods-from-scratch>). `repr(Rust)` enums don't have a well defined layout, so they are not supported. `repr(C, u8)` enums can be used instead
56+
- Only types with a well defined memory layout are supported (see <https://github.com/rust-lang/rfcs/pull/3727>). `repr(Rust)` enums don't have a well defined layout, so they are not supported. `repr(C, u8)` enums can be used instead
5757
- Const rust does not support mutable references or points, so this crate leans heavily on functional data structures for data processing.

packages/desktop/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ serde = { workspace = true }
2727
serde_json = { workspace = true }
2828
thiserror = { workspace = true }
2929
tracing = { workspace = true }
30-
wry = { workspace = true, default-features = false, features = ["os-webview", "protocol", "drag-drop"] }
30+
wry = { workspace = true, default-features = false, features = ["os-webview", "protocol"] }
3131
futures-channel = { workspace = true }
3232
tokio = { workspace = true, features = [
3333
"sync",
@@ -59,7 +59,7 @@ webbrowser = { workspace = true }
5959
signal-hook = "0.3.18"
6060

6161
[target.'cfg(target_os = "linux")'.dependencies]
62-
wry = { workspace = true, features = ["os-webview", "protocol", "drag-drop", "linux-body"] }
62+
wry = { workspace = true, features = ["os-webview", "protocol", "linux-body"] }
6363

6464
[target.'cfg(any(target_os = "windows",target_os = "macos",target_os = "linux",target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd"))'.dependencies]
6565
global-hotkey = "0.7.0"

packages/desktop/src/mobile.rs

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
/// Expose the `Java_dev_dioxus_main_WryActivity_create` function to the JNI layer.
2-
/// We hardcode these to have a single trampoline for host Java code to call into.
1+
/// Expose the `Java_dev_dioxus_main_Rust_*` JNI trampolines that wry's Kotlin layer calls into.
2+
/// We hardcode the package to `dev.dioxus.main` so host Java/Kotlin always has a single set of
3+
/// symbols to bind against, without having to plumb the top-level package name down into this crate.
34
///
4-
/// This saves us from having to plumb the top-level package name all the way down into
5-
/// this file. This is better for modularity (ie just call dioxus' main to run the app) as
6-
/// well as cache thrashing since this crate doesn't rely on external env vars.
5+
/// As of wry 0.55 the Kotlin lifecycle methods (create/start/stop/...) live on a `Rust` object
6+
/// rather than `WryActivity`'s companion object, so the third arg to `tao::android_binding!` is
7+
/// `Rust` — passing `WryActivity` would emit the wrong JNI symbol names and crash at startup with
8+
/// `UnsatisfiedLinkError`.
79
///
810
/// The CLI is expecting to find `dev.dioxus.main` in the final library. If you find a need to
911
/// change this, you'll need to change the CLI as well.
@@ -15,7 +17,41 @@ pub extern "C" fn start_app() {
1517
use dioxus_core::{Element, VirtualDom};
1618
use std::any::Any;
1719

18-
tao::android_binding!(dev_dioxus, main, WryActivity, wry::android_setup, root, tao);
20+
// tao 0.35 dropped its automatic `ndk_context::initialize_android_context` call
21+
// (see https://github.com/tauri-apps/tao/issues/1220). Many android-aware crates —
22+
// including parts of wry itself — call `ndk_context::android_context()` and panic if
23+
// it's uninitialized, which then poisons wry's static mutexes and turns the original
24+
// panic into a confusing `PoisonError` at the next JNI callback. Initialize it here
25+
// before handing off to wry's own setup.
26+
//
27+
// Guarded by `Once` because `WryActivity.onCreate` (and therefore this setup) runs
28+
// again on activity re-creation — rotation, theme changes, back/foreground cycles —
29+
// and `ndk_context::initialize_android_context` asserts `previous.is_none()`, which
30+
// would abort the process on every re-entry. The global only needs the JavaVM + an
31+
// activity-like Context pointer for consumers to attach a JNI thread; we don't need
32+
// to refresh it per-activity.
33+
unsafe fn android_setup(
34+
package: &str,
35+
env: ::wry::prelude::JNIEnv<'_>,
36+
looper: &::ndk::looper::ThreadLooper,
37+
activity: ::wry::prelude::GlobalRef,
38+
) {
39+
static NDK_CONTEXT_INIT: std::sync::Once = std::sync::Once::new();
40+
NDK_CONTEXT_INIT.call_once(|| {
41+
let vm = env.get_java_vm().unwrap();
42+
unsafe {
43+
::ndk_context::initialize_android_context(
44+
vm.get_java_vm_pointer() as *mut _,
45+
activity.as_obj().as_raw() as *mut _,
46+
);
47+
}
48+
});
49+
unsafe {
50+
wry::android_setup(package, env, looper, activity);
51+
}
52+
}
53+
54+
tao::android_binding!(dev_dioxus, main, Rust, android_setup, root, tao);
1955
wry::android_binding!(dev_dioxus, main, wry);
2056

2157
#[cfg(target_os = "android")]

0 commit comments

Comments
 (0)