Awake screen using volume rocker

suchevent

Senior Member
Mar 16, 2011
898
1,640
133
i researched this method because i noticed that i'm constantly using the power button (for screen on and off) and didn't want to wear it down prematurely. cm7/miui has this functionality built in but sense roms do not. for those of you wanting this capability on sense roms, i thought i'd share this.

before you begin, ensure that you have java installed on your pc (i'm sure most of you do). fyi, i used my windows xp pc, wordpad, and 7zip for this. i'm currently using the vu 2.39 rom.

1. Download baksmali and smali (both baksmali-1.2.8 & smali-1.2.8 jars and scripts, total 4 files) to the desktop from here (on the left, you will see the 4 links under "downloads")
2. Copy and transfer android.policy.jar (system\framework folder) from your phone to the desktop. it's also a good idea to backup the file just in case something goes wrong and you need to revert back.
3. Unzip android.policy.jar and extract classes.dex file to the desktop.
4. From the command line, navigate to the desktop and type "java -jar baksmali-1.2.8.jar classes.dex". It will create a directory named "out".
7. Open KeyguardViewMediator.smali (found in out/com/android/internal/policy/impl/) with wordpad.
8. Scroll down and find ".method private isWakeKeyWhenKeyguardShowing(I)Z".
9. Delete cases 0x18 and 0x19 in the switch statement towards the bottom of the method. Save.
10. From the command line, type "java -jar smali-1.2.8.jar -o classes.dex out". You now have a new classes.dex that has your modification.
11. Open android.policy.jar file on your desktop with 7zip and insert the new classes.dex file.
12. Copy the new file to your phone (system\framework folder, ensure that you set proper permissions) and reboot.

please note that i am not responsible if you mess anything up (although, the steps are pretty brick-proof). hack away at your own risk.

ps if you want to turn the screen off without using the power button, download "screen off and lock" from the market. awesome free app. shut down the screen by long pressing the search button.
 
Last edited:

KAwAtA

Senior Member
Jan 15, 2010
993
104
0
Thanks SO much. I've been wanting something like this FOREVER. Don't like having to use widgetlocker! Appreciate the guide, I did this on my HTC Sensation and worked great. Thank you!
 

itsbeertimenow

Senior Member
Jul 20, 2011
993
258
0
Hell
i researched this method because i noticed that i'm constantly using the power button (for screen on and off) and didn't want to wear it down prematurely. i think the cm7 rom has this functionality built in but i primarily use sense roms. for those of you on the same boat, i thought i'd share this.

before you begin, ensure that you have java installed on your pc (i'm sure most of you do). fyi, i used my windows xp pc, wordpad, and 7zip for this. also, i didn't connect the phone to the pc. i transferred the files manually (via microsd card). i'm currently using the vu 2.39 rom.

1. Download baksmali and smali (both baksmali-1.2.8 & smali-1.2.8 jars and scripts, total 4 files) to the desktop from here (on the left, you will see the 4 links under "downloads")
2. Copy and transfer android.policy.jar (system\framework folder) from your phone to the desktop. it's also a good idea to backup the file just in case something goes wrong and you need to revert back.
3. Unzip android.policy.jar and extract classes.dex file to the desktop.
4. From the command line, navigate to the desktop and type "java -jar baksmali-1.2.8.jar classes.dex". It will create a directory named "out".
7. Open KeyguardViewMediator.smali (found in out/com/android/internal/policy/impl/) with wordpad.
8. Scroll down and find ".method private isWakeKeyWhenKeyguardShowing(I)Z".
9. Delete cases 0x18 and 0x19 in the switch statement towards the bottom of the method. Save.
10. From the command line, type "java -jar smali-1.2.8.jar -o classes.dex out". You now have a new classes.dex that has your modification.
11. Open android.policy.jar file on your desktop with 7zip and insert the new classes.dex file.
12. Copy the new file to your phone (system\framework folder, ensure that you set proper permissions) and reboot.

please note that i am not responsible if you mess anything up (although, the steps are pretty brick-proof). hack away at your own risk.

ps if you want to turn the screen off without using the power button, download "screen off and lock" from the market. awesome free app. shut down the screen by long pressing the search button.
So I assume the downside isbyou lose one direction of volume change during screen off or is the missing volume link changed to the power button?
 

nestorkg

Member
Oct 9, 2011
32
1
0
You can do the same with programs No lock, or Ripple lock.
With no lock, volume key gets you directly to launcher, and with ripple lock you have extra step to unlock screen.
I use Ripple lock and Screen off and lock on wildfire s.

Sent from my HTC Wildfire S A510e using XDA App
 
  • Like
Reactions: uruh

suchevent

Senior Member
Mar 16, 2011
898
1,640
133
@nestorkg
this is a way to do it without installing and running an extra app. i guess it's more geared towards those who like to keep running apps to a minimum.

@beertime
yes, you do lose the ability to change volume while the screen is off (i.e. there is no keymap switching involved).
 

KAwAtA

Senior Member
Jan 15, 2010
993
104
0
there is an app in market that goes by name no lock which does just d same
yeah no ****! another member before you posted the exact same thing and it was explained as well, go a page back

You can do the same with programs No lock, or Ripple lock.
With no lock, volume key gets you directly to launcher, and with ripple lock you have extra step to unlock screen.
I use Ripple lock and Screen off and lock on wildfire s.

Sent from my HTC Wildfire S A510e using XDA App