Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "localdesktop"
version = "3.1.0"
version = "3.1.1"
edition = "2021"
build = "build.rs"
default-run = "build_apk"
Expand Down
Binary file modified assets/libs/arm64-v8a/libproot.so
Binary file not shown.
8 changes: 8 additions & 0 deletions patches/build-proot-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ One of them is in `src/syscall/seccomp.c`: the seccomp filter traps only the
instead of every `ioctl`, so GPU drivers in the guest (Turnip on KGSL) don't
stop at the tracer on each command submission.

Another is in `src/extension/fake_id0/chmod.c`: `chmod` on a file outside the
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.

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`.

See https://github.com/green-green-avk/proot for more info.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <linux/limits.h>

#include "syscall/sysnum.h"
Expand Down Expand Up @@ -28,8 +30,13 @@ int handle_chmod_enter_end(Tracee *tracee, Reg path_sysarg, Reg mode_sysarg,
status = read_sysarg_path(tracee, path, path_sysarg, CURRENT);
if(status < 0)
return status;
// If the file exists outside the guestfs, drop the syscall.
// If the file exists outside the guestfs, drop the syscall, unless it is
// the app's own (a directory bound into the guest, such as /home): then
// let the real chmod through, or an executable written there never runs.
else if(status == 1) {
struct stat host;
if(stat(path, &host) == 0 && host.st_uid == getuid())
return 0;
set_sysnum(tracee, PR_getuid);
return 0;
}
Expand Down
Loading