• jethro650jethro650 August 2011

    Ok so you find yourself running terminal emulator or some such app for a command line prompt on your phone all the time doing the same command over and over again. Here is a simple way to automate all of that to a simple two button push. GScript Mod is the answer. Now most of you knowledgable modders and devs probably already know what I'm getting at so this is for the rest of us lol. 

    First step is to get GScript Lite from the market and installed on your phone, this will be the base for everything. When you first open it you will see

    image

    There is two scripts preinstalled, try them out. To add your own press the menu key on your phone and choose Add script and you will then seeimage

    Here is where you enter the name of the script, actual command line command and superuser access. I have made an example to simply reboot your phone

    image

    After you have entered all fields then press Save and it will take you back to the main screen and there is your new script

    image

    Now if you want to reboot your phone just press the reboot phone button and there it goes. Now as far as I know any command that you can use in terminal emulator can be used here, only much easier because once you set it up the first time it's just a push of the button and it's done instead of opening terminal, getting su access and typing out the command, then exiting.

    Speaking about typing it out, when you install the app the first time it places a file on your sd card called gscript. After you set up a script long press it and select Save to SD and this will save an .sh file in that folder, What's that you say, well let me tell you, it's a text file with everything you filled in when you set up your script. You can do a couple things here. First send that file to a friend who also uses gscript and they can put it in that file, open gscript, add script, press load file on the right hand side and presto, instantly fields are filled in, just press save.Done. Second...hate typing on your phone, well get your self a good text editor(I said a good one, NOT windows note pad, it leaves tags on each end of what you type, even though you can't see them they are there) I use notepad++, it's free, google it. Type out all your commands in there same as you would in terminal emulator then save the file as .sh, move it to the gscript folder on your sd card, open the app, menu, add script, load file, save, presto. One hint, what you name the .sh file is what will be filled in in the name field. You can also do batch commands, I have one set up to remove system apps I don't want but get back each new CM7 nightly I install, here it is

    mount -o rw,remount /system
    rm -f /system/app/ADWLauncher.apk
    rm -f /system/app/DPSManager.apk
    rm -f /system/app/FileManager.apk
    rm -f /system/app/GenieWidget.apk
    rm -f /system/app/Protips.apk
    rm -f /system/app/PicoTts.apk
    rm -f /system/app/VoiceDialer.apk
    mount -o ro,remount /system

    To do this in terminal I would have to type out each command individually, set up in gscript, one push of a button and apps are gone.

    And as usual you can place shortcuts right on your homescreen to the full app or one individual script for easy access

    Now go have fun, please share your scripts here for the rest of us.

    Warning and Disclaimer do not hold me responsible for what you may do to your phone with this. Please do not send harmful .sh files to anyone...if you get sent an .sh file, do not blindly run it, read it first, remember, this is the same as terminal emulator, there are no safeties

    Thanks to the folks at PinkVenture for gscript and  @ngiordano for the help and guidance, if it wasn't for our little adventure today I wouldn't have figured this stuff out.-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Dowload thread for .sh files is here THESE WILL WORK WITH DEXT/CLIQ....OTHER PHONES MAY HAVE A SLIGHTLY DIFFERENT FILE SYSTEM    

     

  • ngiordanongiordano August 2011

    Please be sure when flashing recovery to wait till it prompts auto closing.

  • jethro650jethro650 August 2011

    Yes, when running any script, once it starts leave it till it's done, it will auto close when finished. Anything to do with rebooting you will know when it's done cause your phone will be rebooting lol, but the rest, do nothing till it gets back to the main screen, you can see a timer at teh bottom of the screen with a count down. If it's a list or log ot something along that line tap the screen to stop the timer so you can read what is on the screen. Not a good thing to stop a script in the middle of it, could possibly, irreversably damage your phone.

  • jethro650jethro650 August 2011

    Ok I will start with one that some people might want/need. This will grab the log right after a reboot as described in ngiordano's first post in the CM7 thread. Remember put the .sh file in the gscript folder on your sd card thd go into gscript lite and add new.....load file

    http://dl.dropbox.com/u/28590257/.sh%20files/Get%20log%20after%20reboot.sh

     

     

  • jaydubjaydub August 2011

    Here are a couple of scripts I use.

    The first one: nightly_cleanup.sh
    This script searches your /system/app/ folder and deletes any .apks found that are listed in a text file named
    apkstodelete.txt Then copys a bootanimation.zip from the root of your sdcard ( if it exists )  

    Just create a file named apkstodelete.txt with your favorite text editor. Type the names of the .apks you want to delete. One per line exactly as they are named in /system/app/ . then copy the .txt file to the root of your sdcard.

    SAMPLE apkstodelete.txt

    Browser.apk
    AndroidTerm.apk
    Email.apk
    FileManager.apk
    Mms.apk
    Music.apk
    Protips.apk
    GenieWidget.apk
    CarHomeGoogle.apk
    LatinImeTutorial.apk

  • jaydubjaydub August 2011

    The second one is: reframe.sh ( credit goes to propc )
    This is for themers. It safely replaces your framework-res.apk with one on the root of your sdcard, fixes the permissions and creates a backup of the original then reboots the phone.

    To use just place your modified framewor-res.apk on the root of your sdcard
    run the script and enjoy your new theme
    you backup is saved to /sdcard/framework-res.apk.orig

  • ngiordanongiordano August 2011

    There should be a list of useful scripts put together and posted in the download section and linked here.

  • jethro650jethro650 August 2011

    Lol working on it. Figured I'd see who added what for a couple days then try to organize things.I've got a few more and will post them soon....lot of trial and error on my part lol. Last one I did is to change bootanimations...pretty handy.
    If smeone has the terminal emulator or adb command line I can make a .sh file...or if anyone has an idea for one but doesn't know the code post it and I will try to help find/write the command.
    But remember, this was all new to my 2 days ago lol.

  • DJGHOSTS3V3NDJGHOSTS3V3N August 2011

    Here guys, I will only write the coding of the sh, I need someone to do the actual script.

    Flashing a boot.img:

    Put the boot.img in your sdcard (MAKE SURE IT IS NAMED boot.img!)


    Coding:

    su
    flash_image boot /sdcard/boot.img
    reboot





    Very hard right? lol.

  • jethro650jethro650 August 2011

    Thanks guys and op is updated with link to downloads......more to come soon...

  • jethro650jethro650 August 2011

    Added fix permissions, pretty cool you can actually see whats going on lol. 111 permissions checked on my phone lol

    @jaydub will add yours soon as I figure out how to link directly to your posts lol.

  • jethro650jethro650 August 2011

    Added a few new ones.

    Think I'm gonna call this one a wrap unless someone wants some else added. There are literally thousands if not millions out there, no possible way to get them all here lol and so many of them are customized that the script may be a little different each time.

    Like I said, I will entertain request and see what I can do if someone wants something in particular.

    Most of these scripts have come through searching the internet and thanks goes to all whos work I have borrowed. Very few are mine, and those that I did figure out are most likely not origianal lol.

    Before I'm done here's a little something for anyone who changes CPU frequencies on a regular basis. This is a template for one button oc'ing through gscript. Two things to keep in mind, one...uncheck set on boot in performance settings (i couldn't find this file to add it to script, I will if someone can point it out) and two....when you change oc setting with gscript, you go look in performance settings, they will show on main screen but when you press to bring up each drop down list, the drop down list will show the last setting you set from there. The script is working, I just don't know how to fix that part. And you can always change using the performance settings....WOW can I make things comlicated or what lmao

    my everyday set up

    echo 256000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    echo 528000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    echo smartass > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    my overclock max

    echo 748000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
    echo 748000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
    echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

    Notice when going up you set max freq first and when going down you set min freq first.

    There are just too many combos to post them all, I have given enough instructions every one should be able to make thier own custom file from this  :P:P

     

     

Hey are you new here?!

Welcome to the best Ad-Free Android Community around! Create your profile, and start posting now! New features are being added all the time!

Login with Facebook Sign In with OpenID Sign In with Google Sign In with Twitter

Sign In! Sign Up!

Categories

In this Discussion

Tagged