1. Are you ready for the Galaxy S20? Here is everything we know so far!

power options on lock screen.

Discussion in 'Android Lounge' started by p1r4te, Dec 23, 2011.

  1. p1r4te

    p1r4te Newbie
    Thread Starter

    hi all.
    i have been looking on google on & off for a solution on the internet for the past year to disable the "power options" on the lock screen.

    As of 20/12/11 (my birthday) my faithful cm7 rooted moto milestone was stolen from my vehicle.

    Basically i need to find a way to disable the power options on all my android devices from the lock screen, so the only way to turn it off is by unlocking it and then turning it off.

    I can glue in the battery, since i have acetone to remove the glue if i need to remove the batt in the future (only once did i need to remove my batt on my ph, and that was the time i put the sim in).

    My skill level is in my opinion average, and basically i can get around most things with a good guide. the only thing i havnt been able to achive is to set up a personal wow server on my ubuntu server rack (wich is beside the point anyways).

    Please help. If you know of an app or a way to do this, please explain it!
    I really need a solution on this, because if another one of my phones gets stolen, i want to be able to find it (or blow it up so that it causes serious harm to the thief ;p).

    Im pretty sure that the ph was turned off or the batt removed because the ph didnt respond when i sent commands to it, or when i tried to ring it...

    thank you for your helpful and constructive reply.

    1. Download the Forums for Android™ app!


  2. p1r4te

    p1r4te Newbie
    Thread Starter

    any help?
  3. karandpr

    karandpr Android Expert

    Of course there is a way .But it's more of my error on my part .

    Extract framework-res.apk from /sytem/framework folder
    decompile it with apk manager
    navigate to /res/drawable-hdpi
    delete ic_lock_power_off.png
    got /res/values/strings folder
    delete power off string
    open the /res/values/public
    <public type="string" name="power_off" id="0x0104041a" />
    <public type="drawable" name="ic_lock_power_off" id="0x01080530" />

    Compile the framework-res.apk

    extract android.policy.jar from /system/framework and decompile it with baksmali
    and find
    .method private createDialog()Landroid/app/AlertDialog
    change the value from const/4 v9, 0x4 to const/4 v9, 0x3
    recompile using smali .

    copy and replace the files using root explorer or similar app or update.zip(preferred) and reboot
    Rinse repeat for each android device

    the power off option will be removed and the only way to do that will be using an app
    to force a shutdown,using terminal or remove battery

    There is 70 p.c Chance that the above method will fail and your phone will boot loop so keep a backup handy :D.
    Granite1 likes this.
  4. p1r4te

    p1r4te Newbie
    Thread Starter

    thanks karandpr!!
    oh, btw, will this remove the power options completely or only during the lock screen?

    it really amases me that something as logical as to remove the power off option during the lock screen needs to be difficult to achieve...
    im sure that google should implement this, just in case of theft.
    or an app would be nice as well.
  5. jerofld

    jerofld Fixing stuff is not easy

    Granite1 likes this.
  6. p1r4te

    p1r4te Newbie
    Thread Starter

    thanks jerofld!!

    im triing to find an e-mail to get in contact with the dev so that i can be %200 sure.
    i need to be sure that it will work with ics, tablets and all android devices.

    if it works, im going to buy it an all of my devices.

    thanks again jerofld, thats a great little app.

    maby in the future ill make a list of necessary apps that every device should have.

Share This Page