A whole new (Hello) World

It’s been going on in my mind for a while, and I finally dove into Android development. As always when I put my hands on a new language / system, I had a basic need; this time I wanted to develop a simple init system that would resist my various ROMs flashing, i.e. a program that would not be located in the /system partition of the Android OS, but instead would be a package, an apk, that would read init scripts from the sdcard.

After two weeks of reading and learning Android basics, I came out with a very basic piece of code I called RcRun, which will read the content of a rc.d directory located on the primary sdcard (using Environment.getExternalStorageDirectory().toString() from java’s Android modules) and will execute them when the BOOT_COMPLETED broadcast message is received. It will run as UID 0 using the su command (I’m using chainfire’s SuperSU). Of course this means RcRun needs your ROM to be rooted.

There’s still a lot of work before I commit this to the official Android Market, aka Google Play, and possibly F-Droid, but RcRun is already usable for its primary goal. I run dropbear from there, plus various operations such as mounting the external’s DCIM directory on the primary sdcard DCIM.

You can fetch the apk from here and read the source code here; please be indulgent as this is my first piece of Android code ever.