Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

[MOD][DEV] Power Menu Soft-Reboot Option

$
0
0
WHAT IS THIS ?
soft reboot is different from normal reboot... it take very very less time to reboot, very useful if any app or mod require reboot... :D
while checking my smali skills got this :cool:.... so when you need to reboot just long press on power-off, bing.. it will take 25% of normal reboot time :)

STEPS:
#1:decompile android.policy.jar, goto com\android\internal\policy\impl\ ,open the file which is responsible for power-off...normally in all AOSP its GlobalActions$2.smali.... in other device it may be GlobalActions$3, $4....


HOW TO FIND THE CORRECT FILE ?
open the the file search for onPress()V , in that method it it have shutdown()V... then its Power-off method ;)

#2:search for onLongPress()Z then in that method add the below code immidietly after onLongPress()Z,
Code:

.registers 4

const-string v1, "ctl.restart"

const-string v2, "surfaceflinger"

invoke-static {v1, v2}, Landroid/os/SystemProperties;->set(Ljava/lang/String;Ljava/lang/String;)V
       
const-string v2, "zygote"

invoke-static {v1, v2}, Landroid/os/SystemProperties;->set(Ljava/lang/String;Ljava/lang/String;)V

#3:save, compile... flash or push the new file...

NOTE : you can use the same method for adding long press options for reboot and recovery methods...

Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>