DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 35

Thread: Hidden Shutdown Options - How do they work?

  1. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #1

    Hidden Shutdown Options - How do they work?

    -Hidden Shutdown Options using keys (credit to Pete):
    To Remove These Options Delete /system/bin/shutdown

    *Shutdown: hold power & half pressed camera button
    *Reboot: hold power & volume down button
    *Reboot Recovery: hold power & volume up button


    I was intrigued when the way to disable this new feature was to erase /system/bin/shutdown, so I looked at the contents of that script:

    Code:
    #!/system/bin/sh
    
    stop;
    stop dhcpcd;
    
    sleep 1;
    
    for i in `cat /proc/mounts | cut -f 2 -d " "`;
    do
       busybox mount -o remount,ro $i 2>&1 > /dev/null;
    done
    
    sync;
    
    if [ "$1" = "-r" ];
    then
       toolbox reboot;
    fi
    
    if [ "$1" = "-rr" ];
    then
       toolbox reboot recovery;
    else 
       reboot -p;
    fi
    Looks pretty straightforward to me. That must not be what actually checks the keys, though. I looked at a diff between the V01 and V02 update files - and that shutdown script is the only change!

    Does this mean that the hidden recovery options were there all along and the shutdown script was just missing? Did you have to do something else to enable this feature, Pete?

    I'm tempted to go one step further and map those keys to OTHER things by editing this script. It'll be a little (a lot) kludgy to have a shutdown script that does other stuff that isn't shutting down, but remapping hardware keys to custom linux scripts can't be a bad thing...
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  2.  
     
     
     
  3. Junior Droid
    jgaikwad's Avatar
    Member #
    71564
    Join Date
    May 2010
    Posts
    14
    Phone
    Motorola Droid
    #2
    I was trying to figure out how to just disable the camera button shutdown, but keep the reboot options. Tried adding this to the beginning of the script but not having any luck.

    Code:
    if [[ "$1" != "-r" && "$1" != "-rr" ]];
    then
    exit 0;
    fi
  4. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #3
    Quote Originally Posted by jgaikwad View Post
    I was trying to figure out how to just disable the camera button shutdown, but keep the reboot options. Tried adding this to the beginning of the script but not having any luck.

    Code:
    if [[ "$1" != "-r" && "$1" != "-rr" ]];
    then
    exit 0;
    fi
    Try single brackets instead of double?
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  5. Junior Droid
    jgaikwad's Avatar
    Member #
    71564
    Join Date
    May 2010
    Posts
    14
    Phone
    Motorola Droid
    #4
    nope no go, on both versions none of the shutdown combos work after i've added the if statement.
  6. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #5
    Quote Originally Posted by jgaikwad View Post
    nope no go, on both versions none of the shutdown combos work after i've added the if statement.
    Are you editing the file on the phone, or pushing it from a computer? I've been having some problems with files made on the phone for some reason. I think the semicolon key is wrong, perhaps?

    Anyway, I pasted almost your exact change into the script, and changed all the actual commands to "echo" so I could test it without rebooting all the time. Running it from the commandline directly seems to work fine, only does something when you give it -r and -rr, does nothing when you give it no command.
    Attached Files
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  7. Junior Droid
    jgaikwad's Avatar
    Member #
    71564
    Join Date
    May 2010
    Posts
    14
    Phone
    Motorola Droid
    #6
    got it, instead of creating the file on my pc and pushing it to the phone, i just edited the current shutdown script and it worked.

    only thing is now, instead of shutdown with the camera button, it now just locks up the phone and i have to do a battery pull. the reboot ones work fine. Should i be exiting the script a different way than "exit 0;" ?
  8. Junior Droid
    jgaikwad's Avatar
    Member #
    71564
    Join Date
    May 2010
    Posts
    14
    Phone
    Motorola Droid
    #7
    Quote Originally Posted by Se7enLC View Post
    Quote Originally Posted by jgaikwad View Post
    nope no go, on both versions none of the shutdown combos work after i've added the if statement.
    Are you editing the file on the phone, or pushing it from a computer? I've been having some problems with files made on the phone for some reason. I think the semicolon key is wrong, perhaps?

    Anyway, I pasted almost your exact change into the script, and changed all the actual commands to "echo" so I could test it without rebooting all the time. Running it from the commandline directly seems to work fine, only does something when you give it -r and -rr, does nothing when you give it no command.
    hah, just saw this
  9. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #8
    Here's the real (working) version. I just tested it out - the volume buttons still do stuff, camera button doesn't.

    Make sure you chmod 0755 the file once you copy it in.
    Attached Files
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  10. Junior Droid
    jgaikwad's Avatar
    Member #
    71564
    Join Date
    May 2010
    Posts
    14
    Phone
    Motorola Droid
    #9
    Quote Originally Posted by Se7enLC View Post
    Here's the real (working) version. I just tested it out - the volume buttons still do stuff, camera button doesn't.

    Make sure you chmod 0755 the file once you copy it in.
    you sure this is the same one you tested? camera button still shuts down on me
  11. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #10
    Quote Originally Posted by jgaikwad View Post
    Quote Originally Posted by Se7enLC View Post
    Here's the real (working) version. I just tested it out - the volume buttons still do stuff, camera button doesn't.

    Make sure you chmod 0755 the file once you copy it in.
    you sure this is the same one you tested? camera button still shuts down on me
    Positive. But I'm running a non-standard shell for /system/bin/sh, so that could be it. I'll look into it a little closer later, perhaps.
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
Page 1 of 4 123 ... LastLast

Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. hidden phone options none of us know anything about.
    By gixxerboy in forum Android General Discussions
    Replies: 5
    Last Post: 05-21-2010, 07:20 AM
  2. Bugless Beast 7.5 Random Shutdown
    By Aviamund in forum Android Hacks and Help
    Replies: 1
    Last Post: 02-15-2010, 06:25 PM
  3. Hidden
    By AJRAS in forum Android Hacks and Help
    Replies: 2
    Last Post: 02-14-2010, 08:19 PM
  4. Shutdown unnecessary apps
    By theproman23 in forum Motorola Droid
    Replies: 0
    Last Post: 02-14-2010, 05:27 PM
  5. 2 Problems need help, Camera and Shutdown
    By snowman in forum Android General Discussions
    Replies: 4
    Last Post: 01-11-2010, 07:46 PM

Search tags for this page

android command line shutdown
,
android halt command
,
android power off command
,

android reboot command

,

android shutdown command

,
android shutdown options
,

android shutdown script

,
droid x2 how to change shutdown
,
shutdown android command
,

shutdown command android

Click on a term to search our site for related topics.
Find us on Google+