Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package binaries into native libs directory to make busybox work on non-rooted phones, too #34

Open
rubenpgrady opened this issue Aug 17, 2024 · 0 comments

Comments

@rubenpgrady
Copy link

Hello there, Sunil!

Since Android 10 and the introduction of the W^X policy, it's not permitted to run binaries from an application's home directory in /data/user/0 (i.e. /data/data). That's why root is necessary for this app to install the busybox binaries to /system/xbin to make them available system-wide. Unfortunately, oftentimes it's not an option to users to root their phone due to various reasons. However, as far as I understand, there is an alternative solution for non-rooted phones:

While exec() no longer works on files within the application home directory, it continues to be supported for files within the read-only /data/app directory. In particular, it should be possible to package the binaries into your application's native libs directory and enable android:extractNativeLibs=true, and then call exec() on the /data/app artifacts.

Source: https://issuetracker.google.com/issues/128554619

Would it be possible for you to package the busybox and ssl_helper binaries into the app as a native library? I think there are a few rules regarding naming the file beginning lib and ending in .so, but that's it. After installing the APK, due to extractNativeLibs=true, the file will be available under something like /data/app/<package name>/lib/arm/libbusybox.so to the whole system. No root required! Users can then symlink to that file or write shell scripts which include it.

Please let me know what you think. I'd appreciate it if you'd consider adding this feature.

Cheers
Ruben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant