[MOD] Remove "Your phone will shut down" prompt

Search This thread

gcrutchr

Senior Member
Jun 11, 2009
1,573
739
73
Bangkok
Okay, here is how to remove the annoying "confirm shutdown message".
I did this with KH4, but should work with most roms.

ALWAYS MAKE A BACKUP BEFORE MODIFYING YOUR ROM...JUST IN CASE THINGS GO TERRIBLY WRONG.

1 - Decompile framework.jar
2 - Open /com/android/internal/app/ShutdownThread.smali
3 - In .method public static shutdown(Landroid/content/Context;Z)V
look for the following:

.line 159
const-string v2, "ShutdownThread"

const-string v2, "Notifying thread to start radio shutdown"

invoke-static {v4, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/StringI

.line 161

if-eqz p1, :cond_2


4 - at about .line 161, comment out: if-eqz p1, :cond_2 as follows

# if-eqz p1, :cond_2 (make sure # is at beginning of line)

5 - then add the following after the above commented line:

goto :cond_2

the 2 lines should look like this:

# if-eqz p1, :cond_2
goto :cond_2

6 - recompile framework.jar

7 - use adb to push it to your sdcard

8 - then do the following:
adb shell
cd /sdcard/
stop
cp framework.jar /system/framework/
reboot

That's it - no more shutdown prompt!
 

gcrutchr

Senior Member
Jun 11, 2009
1,573
739
73
Bangkok
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.

Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU
 

jonny68

Senior Member
Mar 27, 2010
5,747
601
Dublin
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.

Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU


I've been using that app now for a long time and have never once had any problems
 

mostyle

Senior Member
Nov 13, 2006
491
236
Langley, SC
I prefer use the power menu for this and i will be pleased to skip the confirmation step :D

I agree 100%. This works exactly as I wanted.

I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.

Thank you for sharing this.
 

tech927

Senior Member
Dec 5, 2012
180
12
s7

Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?
 

vdhero

Senior Member
Jun 11, 2017
436
240
27
Rach Gia
Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?

I think probably not. This thread was written in 2011 and android Gingerbread is the latest android version then. Gingerbread is still known for the easiest android version to mod. Now, android nougat and oreo are taking place but they're damn hard to make any modification BUT you can try to decompile with apktool and see if it works
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Okay, here is how to remove the annoying "confirm shutdown message".
    I did this with KH4, but should work with most roms.

    ALWAYS MAKE A BACKUP BEFORE MODIFYING YOUR ROM...JUST IN CASE THINGS GO TERRIBLY WRONG.

    1 - Decompile framework.jar
    2 - Open /com/android/internal/app/ShutdownThread.smali
    3 - In .method public static shutdown(Landroid/content/Context;Z)V
    look for the following:

    .line 159
    const-string v2, "ShutdownThread"

    const-string v2, "Notifying thread to start radio shutdown"

    invoke-static {v4, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/StringI

    .line 161

    if-eqz p1, :cond_2


    4 - at about .line 161, comment out: if-eqz p1, :cond_2 as follows

    # if-eqz p1, :cond_2 (make sure # is at beginning of line)

    5 - then add the following after the above commented line:

    goto :cond_2

    the 2 lines should look like this:

    # if-eqz p1, :cond_2
    goto :cond_2

    6 - recompile framework.jar

    7 - use adb to push it to your sdcard

    8 - then do the following:
    adb shell
    cd /sdcard/
    stop
    cp framework.jar /system/framework/
    reboot

    That's it - no more shutdown prompt!
    1
    Good find but alternatively why not just download http://www.appbrain.com/app/quick-boot-(reboot)/com.siriusapplications.quickboot
    i cant remember the last time i DIDN'T use this app to shut down or reboot my phone.;)

    I prefer use the power menu for this and i will be pleased to skip the confirmation step :D