This is an experiment of doing something low level in Android world use Scala language.
We can only use setprop to change Android system properties at some restriction, for example: you cann't change ro.debuggable
propertie (actually all properties who's name starts with ro), setpropex use ptrace to write init process's memory directly to bypass all restrictions (of course need root privilege and at the risk of crash the system). This idea is come from the original setpropex.
- All code is pure scala, make the coding process more enjoyable than c/c++.
- Intellj for coding assistant & scalatest for TDD.
- Needn't install ndk.
- CPU architecture independent. The same program can run on different CPU architecture eg:
arm,arm64,x86_64,mips
. In contrast to c/c++ counterpart, which need rebuild with toolchains of the exactly target CPU architecture.
- the size of result program is very huge(5M+, mostly Scala lib), this may reduced by proguard or add Scala lib to
BOOTCLASSPATH
(seems workable, haven't try yet) - the startup time is comparable slow, especially at the first time the program been run, which need to do AOT compilation.
git clone https://github.com/wuhx/setpropex
cd setpropex
sbt dalvik
adb push setpropex /data/local/tmp
adb shell
su
cd /data/local/tmp/
./setpropex ro.debuggable 1