I´m not an Android developer. I´m using my RIoTBoard mainly with a Debian Linux distribution.
but because I am rooting all of my Android devices, I thought why not root the RIoTBoard as well. Just for fun.
It´s still an Android development board however and someone might need it.
And boy was that a journey. But I made it and here is how I did it.
(This was tested with the Downloadable Image you get here at Element14 and also with the image compiled with development configuration with build-type "eng")
What you need before you can start:
I´m assuming since you´re using the RIoTBoard as a development platform, that you have the Android SDK installed and adb is configured.
If not. Well you don´t need to download the whole SDK. When using Windows you can use the "15 seconds adb installer" from a thread at XDA Developers. (Google it)
It also has the needed drivers integrated. Just choose yes when asked to install it. Also I suggest to install adb and fastboot globally when asked.
Also don´t forget to activate USB debugging inside the Android Developer Options. (Look here at part 2 and 3 on how to do that. How to Install Netflix Streaming on the RIoTBoard)
Next thing needed is the zip file attached to this blog post.
Inside the zip file are the scripts, the su binary and a SuperSu.apk. I tried using SuperUser but i only got it working with this version of SuperSu.
Also i integrated a terminal app to test root in the end.
Extract all the files into a folder.
Also you´ll need a connection to the UART serial port with putty or similar.
Now let´s start this.
Open a cmd window inside the folder you extracted the files to and execute the following commands.
adb push su /data/local/tmp adb push SuperSu.apk /data/local/tmp adb push 99SuperSUDaemon /data/local/tmp adb push install-recovery.sh /data/local/tmp adb install terminal.apk
Installing the terminal app is optional. But with that you can test if root is working.
Next switch to your UART connection terminal and execute the following commands.
(You have to be root to execute the commands. So look if you are connected as root@riot_6solo)
mount -w -o remount /dev/block/mmcblk0p5 /system mkdir /system/etc/init.d mkdir /system/bin/.ext cp /data/local/tmp/su /system/bin/.ext/.su cp /data/local/tmp/su /system/xbin/daemonsu cp /data/local/tmp/su /system/xbin/su cp /data/local/tmp/SuperSu.apk /system/app/SuperSu.apk cp /data/local/tmp/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon cp /data/local/tmp/install-recovery.sh /system/etc/install-recovery.sh echo 1 > /system/etc/.installed_su_daemon chmod 0777 /system/bin/.ext chmod 06755 /system/bin/.ext/.su chmod 06755 /system/xbin/su chmod 0755 /system/xbin/daemonsu chmod 0755 /system/etc/install-recovery.sh chmod 0755 /system/etc/init.d/99SuperSUDaemon chmod 0644 /system/app/SuperSu.apk chmod 0644 /system/etc/.installed_su_daemon
What does all this stuff do?
Well it remounts the system partition so you can write to it.
After that it creates two folders and copies all the files needed into the right folders.
The su binary will be copied 3 times. One as execution file, one to run as a daemon, and one as some sort of backup inside the bin folder if the app won´t search for it in the xbin folder.
The two script files are only needed to execute the SuperSu daemon from the su binary.
And in the end the permissions are set, so the scripts and files are accessible in Android.
Now you need to restart the board. You can just type the "reboot" command to do this.
When Android starts again, open the terminal emulator from the apps.
Then just type the command "su" and press enter.
You should get a SuperSu question to grant the terminal app access to root.
Tap on Grant and there you go.
You are root inside Android.
Top Comments