For the fun of it and because studying gets old I decided to do a DOS batch file that would Root and Unroot my phone using the commands that are posted on the forums.
I have a problem with this command group:
adb shell # Prompt is $
chmod 0755 rageagainstthecage-arm5.bin
./rageagainstthecage-arm5.bin #(then WAIT!!)
That group of commands works just fine when I root manually. For my script I have to change it to this:
adb shell "chmod 0755 /data/local/tmp/rageagainstthecage-arm5.bin"
adb shell "cd /data/local/tmp/;./rageagainstthecage-arm5.bin"
The rage program runs, but it does not work. I know this because the mount command:
adb shell "mount -o remount,rw -t ext3 /dev/block/mmcblk1p21 /system"
receives an "Operation not permitted" output and all subsequent commands fail because the system is not RW.
It looks like rage runs, because I get the print out lines from it as when doing it manually. It runs pretty quickly compared to when I execute it manually.
I am thinking that I do not really get into "/data/local/tmp" literally. I think I am just running Rage from the root directory which causes it to fail because it is designed to run within "/data/local/tmp".
I thought it was working until I decided to manually remove the four files
to unroot using Root Explorer. It looks like that if you just remove the su, superuser and busybox files as instructed for unroot and leave the rage in "/data/local/tmp", it has already run once and we have not undone what it did the first time it was run. So to get root back all you really need to do is put the three files back into the phone and reboot without running rage.