diff --git a/Cargo.lock b/Cargo.lock index 8e0968c..ed22575 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2348,7 +2348,7 @@ dependencies = [ [[package]] name = "localdesktop" -version = "1.2.0" +version = "1.2.1" dependencies = [ "android-sdkmanager-rs", "android_logger", diff --git a/Cargo.toml b/Cargo.toml index cd99f17..ebb8e7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "localdesktop" -version = "1.2.0" +version = "1.2.1" edition = "2021" build = "build.rs" default-run = "build_apk" diff --git a/assets/libs/arm64-v8a/libproot.so b/assets/libs/arm64-v8a/libproot.so index 3e31246..e335988 100755 Binary files a/assets/libs/arm64-v8a/libproot.so and b/assets/libs/arm64-v8a/libproot.so differ diff --git a/patches/build-proot-android/README.md b/patches/build-proot-android/README.md index 145f497..41d17b3 100644 --- a/patches/build-proot-android/README.md +++ b/patches/build-proot-android/README.md @@ -30,6 +30,11 @@ guest rootfs is still dropped, except on the app's own files (a directory bound into the guest, such as `/home`), so a script or binary written there can be made executable. +And in `src/extension/fake_id0/fake_id0.c`: `fstat` on a socket, eventfd or other descriptor +that isn't a file gets the real `fstat`, instead of a `stat` of its `/proc/self/fd` link +(`socket:[N]`), which fails. Node checks its standard streams with `fstat`, and a child process +gets sockets for them, so every Node or Electron child process aborted at startup. + The shipped `libproot.so` is built with `./build.sh` (NDK r26d). On macOS, put a GNU `install` (or a wrapper that handles `install -D`) first in `PATH`. diff --git a/patches/build-proot-android/build/proot/src/extension/fake_id0/fake_id0.c b/patches/build-proot-android/build/proot/src/extension/fake_id0/fake_id0.c index 9477f1c..94ecec2 100644 --- a/patches/build-proot-android/build/proot/src/extension/fake_id0/fake_id0.c +++ b/patches/build-proot-android/build/proot/src/extension/fake_id0/fake_id0.c @@ -807,7 +807,9 @@ static int handle_sysexit_end(Tracee *tracee, Config *config) path[result] = '\0'; - if ((strcmp(path + strlen(path) - strlen(" (deleted)"), " (deleted)") == 0) || (strncmp(path, "pipe", 4) == 0)) { + /* Not a file to stat by its path: deleted, or a pipe, socket, eventfd and the like, whose + * link reads "pipe:[N]", "socket:[N]", "anon_inode:[eventfd]". */ + if ((strcmp(path + strlen(path) - strlen(" (deleted)"), " (deleted)") == 0) || (path[0] != '/')) { register_chained_syscall(tracee, sysnum, peek_reg(tracee, ORIGINAL, SYSARG_1), peek_reg(tracee, ORIGINAL, SYSARG_2), 0, 0, 0, 0); } else { write_data(tracee, peek_reg(tracee, MODIFIED, SYSARG_3), path, sizeof(path));