Help With basic scripting

Discussion in 'Android Hacks and Help' started by Abadus, Nov 5, 2011.

  1. Abadus
    Offline

    Abadus New Member

    Joined:
    Apr 2, 2010
    Messages:
    221
    Likes Received:
    2
    Trophy Points:
    0
    Ok I am a noob but just need a small push in the right direction.

    I am deodexing my phone with xUltimate. Everything is fine but I have to do all commands through ADB or Terminal on my phone. I would like to automate this process.

    Best solution would be a bat file from windows that would push the folders to my phone and then move files delete .odex files and then debloat my phone the way I want. My first question is can you gain SU access with a windows bat file? When I try the SU app asks for permission but when I give it the script just hangs and does not progress. I think if I can get the script to progress I can get it to do what I want.


    adb shell devices
    adb shell su
    adb shell push filles bla bla bla

    It hangs on the su line after I allow access on my phone.


    Alternative because I am pretty sure I read you cannot do su from a script.bat. I would like to just have my phone run the script instead of running it from windows. I write a script like this.

    #!/bin/ksh


    # Always need to be super user
    su


    # Need to mount system read write
    mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system


    #Rename These files
    mv /system/app/blur_myspace.apk /system/app/blur_myspace.apk2


    # Need to put system back to read only
    mount -o ro,remount -t ext3 /dev/block/mmcblk1p21 /system


    When I run it I get a pop up saying I gained super user access but beyond that the script does nothing. I tried just a simple one to reboot my phone just to check it and that does not work either.

    I am really stuck here. It would not be a big deal but I have deodexed my phone and debloated it a few times this week and I debloat different things each time. This way I would automate it and always do the exact same things. I have been trying for a while but nothing I seem to do works. Any help would be greatly appreciated.