Setup
- Download the lastest alpine-minirootfs for armv7 from alpinelinux
- Once you have root access use adb to push these files to
/data/
(e.g.adb push setup.sh /data/
):alpine-minirootfs-3.22.1-armv7.tar.gz
setup.sh
busybox-armv7l
- Navigate to
/data
and then runsh setup.sh
which should setup the chroot (mounting the/dev
etc) - This will then drop you into a
localhost
shell, to get out
Start Up Scripts
- To start up a binary we need to insert a script somewhere in the start up procedure, I noted that the binary
debuggerd
is started and didn't think we needed this so instead replaced the binary with a shell script that would start my own programs. - Android mounts its
/system/bin
as read only so it is necessary to temporarily remount this to make the changes:mount -o remount,rw /system
chmod o+w /system/bin
- Backup debuggerd binary and then replace it with the shell script
chmod o-w /system/bin
mount -o remount,ro /system