Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 991 Bytes

File metadata and controls

39 lines (28 loc) · 991 Bytes

jrunas

A run-as implementation without the app-debuggable capability check — run a command in any installed app's uid / SELinux / data-directory context on a rooted device. (Equivalent in purpose to JEB's ranod.)

Building

Requires the Android NDK and CMake.

export NDK=/path/to/android-ndk
for ABI in arm64-v8a armeabi-v7a x86_64 x86; do
  cmake -S . -B build/$ABI \
    -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake \
    -DANDROID_ABI=$ABI -DANDROID_PLATFORM=android-24
  cmake --build build/$ABI -j
done

Binaries land at build/<abi>/jrunas.

Usage

jrunas is launched as root on a rooted device:

adb push build/arm64-v8a/jrunas /data/local/tmp/jrunas
adb shell su -c '/data/local/tmp/jrunas <package-name> [--user <id>] [<command> [<args>]]'

Host tests

The packages.list parser has host unit tests:

c++ -std=c++17 -I. tests/test_packages_list.cpp packages_list.cpp -o /tmp/jrunas_test_pl
/tmp/jrunas_test_pl