yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] djmcnz:
[MOD] [JB4.1+][AOSP+OTA] Super PowerMenu | Reboot & Recovery | DIY Instructions Avail

INTRODUCTION

Hi everyone, so a while back I created the Enhanced Power Menu for ICS (right here) and now that Jelly Bean it out it's time to do it all over again.

This mod adds the reboot and reboot to recovery options to the standard power button menu in Android 4.1+ Jelly Bean.
​

FEATURES

Reboot from Power Menu

Reboot to recovery from Power Menu

[*]Long press Recovery on power menu to reboot to Bootloader! (4.1.1 only)

[*]OR: Long press Reboot on power menu to reboot to Recovery! (4.1.1 only)

SCREENSHOTS

First screenshot: Reboot & Recovery menu with (option) to Long Press Recovery for Bootloader in 4.1.1

Second screenshot: Reboot menu with Long Press Reboot for Recovery in 4.1.1

​

COMPATIBILITY

There are versions below for both Android 4.1 (the Google I/O dump) and Android 4.1.1 AOSP builds available below.

This will break any mods you've made to either framework-res.apk or android-policy.jar. You can check if these files are touched by other mod by inspecting the files that came with that mod.

If for any reason your ROM or mod are incompatible with the Enhanced Power Menu the likely result is a bootloop. If you're not familiar with adb in recovery then make sure you make a backup in recovery!
​

REQUESTS

None accepted sorry, there are too many mod variations out their to satisfy them all so I won't even try.​

DOWNLOAD & INSTRUCTIONS

For Android 4.1 (deprecated) see this post: http://xdaforums.com/showthread.php?p=28197626#post28197626

For Android 4.1.1 AOSP (includes hot sauce+bacon) see this post: http://xdaforums.com/showthread.php?p=28559395#post28559395

NEW: 4.1.1 OTA version for DEODEXED ROMS ONLY (with hot sauce) available here: http://xdaforums.com/showthread.php?p=28616532#post28616532

DIY?

Check it out here: http://xdaforums.com/showthread.php?p=28676065#post28676065​
[Samsung Galaxy Nexus] stereoprologic:
Would you consider adding volume wake to this pleeeeeease? :)
[Samsung Galaxy Nexus] djmcnz:
Jelly Bean 4.1 Release

Enhanced Power Menu

For Android 4.1 (DEPRECATED)

Instructions

Download this file: JBEnhancedPowerMenu.zip

Mirror 1: http://www.multiupload.nl/VG6UI4A3DW

Mirror 2: also attached to this post

Copy it to your SD card

Reboot to recovery

Wipe caches

Do a full backup

Flash the file you downloaded

Reboot

Enjoy

Hit 'Thanks' below

And if you're a chef, kanger or code monkey and you want to use this mod just drop me a line! :)

NOTE: There have been a LOT of downloads for this file today (11 July), remember it is for the Google I/O 4.1 ROM only - not the more recent 4.1.1 release. See link in the first post for the 4.1.1 release.
[Samsung Galaxy Nexus] Seadub2:
I think the links are broken. All three don't work for me.
[Samsung Galaxy Nexus] stereoprologic:
I'm terribly sorry. Got a little overexcited on the fact that there's someone who could look into my plea. :(
[Samsung Galaxy Nexus] djmcnz:
Checking now...
[Samsung Galaxy Nexus] djmcnz:
Edit: My host and Link 1 is back up.

Mirror 1 is working for me okay.

The attachment was not working for me so I've re-upped it (edit, it's not working). XDA is having issues with attachment today... it'll come back.
[Samsung Galaxy Nexus] Seadub2:
Ok Thank You I got it to download now.

Edit: Works good thanks.
[Samsung Galaxy Nexus] CMNein:
The attached zip failed for me (d3rp, just read you knew that already), primary DL flashed fine and works on bigxie's build (assuming that was the deodexed version you were referring to?).

Thanks.
[Samsung Galaxy Nexus] sunscape:
Now if someone would give us the quiet hours feature that would be all I need
[Samsung Galaxy Nexus] Painkiller006:
=/ im now stuck in the boot animation. Running it on Bigxie ROM
[Samsung Galaxy Nexus] djmcnz:
Actually it'll work on any stock ROM, deodexed or otherwise, I should change that text.
[Samsung Galaxy Nexus] djmcnz:
You'll have to restore from backup I'm afraid (try a battery pull and cache wipe first though). What changes were in your system partition? GSM I assume?
[Samsung Galaxy Nexus] on2315:
Please add screen capture button, thank you.
[Samsung Galaxy Nexus] triStateMindgate:
Seriously ?

Not only did he quote himself to a feature request on the last page, but it's also in the OP.

With that said, I'm sure we will be seeing more MOD's and JB ROM's coming within the next few weeks, with JB officially launching and source being dropped..
[Samsung Galaxy Nexus] UZR10278:
Thanks man. Works perfectly for me. Again, thanks man.;)
[Samsung Galaxy Nexus] Painkiller006:
I didn't make a backup lol but i reflashed the rom and it booted up fine. Now im making the backup and will try again once it's complete. Haven't made any changes to the system partition and yup i have the GSM version

Update: Same thing, keeps flashing the bootanimation =/
[Samsung Galaxy Nexus] djmcnz:
Do give it a bit of time, it will take longer to boot but not more than 60 seconds. What exact ROM are you using?
[Samsung Galaxy Nexus] walkamake:
djmcnz, thanks!

But can you write manual how to do it with full description of android.policy.jar editing? I'm porting some elements from framework-res.apk of modaco rom, and fully port android.policy.jar. It works, but I can't understand, how it works.
[Samsung Galaxy Nexus] dislplin01:
Sweet will flash when I get home the no reboot option is annoying
[Samsung Galaxy Nexus] prowede:
You have a GSM Galaxy Nexus Yes

You were on 4.0.x or 4.1 stock and rooted? Yes

You got the 4.1.1 update on your phone OTA? No, I installed the "update.zip" manually

You apply my mod, it say successful in recovery? Yes

You boot and have the normal power menu and it works like the normal power menu (e.g. long press on Power Off brings up safe mode prompt)?Yes

I just renamed it to "/android.policy.ode" and rebooted.

It is looped in the boot animation.
[Samsung Galaxy Nexus] djmcnz:
Thanks. Okay, can you flash the mod *again* when it won't boot? Let's see if that works.

If it doesn't work, use the revert file I provided above.

Edit: okay, the reason I asked you to rename the odex file was to see if Android was actually using it. And it is. Since that's where my changes are made it explains why it's not working. I don't provide an odex file with my mod, instead I provide a classes.dex file inside android.policy.jar. Android should prefer the dex file when both are present.

Since you renamed that file and Android couldn't boot that means it's not able to use the classes.dex file, I'm not sure why but that's why I asked you to reflash the mod to see if it forces my file back and allows you to boot.

I have another idea also now about something I might be able to change but let's see what your results are first.
[Samsung Galaxy Nexus] prowede:
1. Renamed to ".ode"

2. Rebooted and looped in boot animation

3. Powered off and then went to CWM recovery

4. Installed the *Mod* again, installed successfully

5. Rebooted again, still looped in boot animation
[Samsung Galaxy Nexus] bigeyes0x0:
@prowede: The same **** happens for me, and the ROM basically refuse to load android.policy.jar with classes.dex inside.

@djmcnz: The correct way to do this is to baksmali the odex, add any modification, create the dex file, put it into the jar then put the jar on the phone. Now you need dexopt-wrapper to create the odex file from the jar. Then you can copy the odex file back to /system/framework and set the correct permission/owner/group. That what's you need to mod odex file.
[Samsung Galaxy Nexus] kinggheedora:
You're welcome. I'm glad I was able to do my part.:cyclops:
[Samsung Galaxy Nexus] djmcnz:
You are extraordinarily patient. Feel free to walk away from this any time of course, I'll eventually get it working.

However, if you want to proceed I have one more idea since you have adb up and running.

Unzip the contents of my mod, you'll want two files: android.policy.jar and framework-res.apk, put those in your working directory on your pc.

When in recovery type this on the pc:

adb devices [COLOR="Red"](just to check)[/COLOR]
adb mount /system
adb shell mv /system/framework/android.policy.jar /system/framework/android.policy.bak
adb shell mv /system/framework/framework-res.apk /system/framework/framework-res.bak
adb push android.policy.jar /system/framework/
adb push framework-res.apk /system/framework/
adb reboot

If you want to you can check that the files are there the command is adb shell ls -l /system/framework/

If it doesn't work then rename all three of your files back to their original names and reboot. use the 'mv' (move) command for this e.g.

adb shell mv /system/framework/framework-res.bak /system/framework/framework-res.apk

Can you point me to the update.zip you used and I'll download that also to have a look.
[Samsung Galaxy Nexus] djmcnz:
I do know that it doesn't need to be odexed again, the phone should manage that (and this mod works for most people). Having said that, since I don't have the OTA version, if you have dexopt-wrapper on your phone and you want to do this for me that would be great.

We've got willing testers... lol.
[Samsung Galaxy Nexus] bigeyes0x0:
A little late for that as I'm on bugless beast now. It's better than stock OTA IMO.
[Samsung Galaxy Nexus] djmcnz:
No problem. I'll be trying a few myself this weekend, but this is bugging me a bit.
[Samsung Galaxy Nexus] prowede:
maybe I try it on tmr, as it is almost 2am in here.

Here is the update.zip i used: http://android.clients.google.com/p....signed-yakju-JRO03C-from-IMM76I.f946a412.zip

Source is from here: http://xdaforums.com/showthread.php?t=1419170

Thank you for your help.
[Samsung Galaxy Nexus] prowede:
In what situation I should do this and what is the purpose/principle?

is it same as re-flash the mod?
[Samsung Galaxy Nexus] djmcnz:
Yeah, this is really just a "manual flash" a a bit of a proof point. Was my last idea before accepting I need to install the OTA myself...
[Samsung Galaxy Nexus] prowede:
I just tried.

The same result :(
[Samsung Galaxy Nexus] bigeyes0x0:
I believe the problem is because android.policy.jar is in BOOTCLASSPATH env var. This is why the phone can't odex it during boot up unlike normal apk.
[Samsung Galaxy Nexus] djmcnz:
Okay, project for today. Thanks for patience and help, I'll post back my results.
[Samsung Galaxy Nexus] semsemx:
Thank you . i get what i need..

i need one more for my 4.1.1Stock ROM

where i can get toggle bar notification mod ?

edit: Nothing change here :(

Stock 4.1.1 Yakju OTA

CWM+Rooted

Kernel : Franco Kernel

another mod : Battery Percentage
[Samsung Galaxy Nexus] prowede:
no mod is needed

you can use widget like <Widgetsoid>
[Samsung Galaxy Nexus] djmcnz:
So I've been testing this for the last hour, I've got an odex file but it just bootloops... missing dependencies in the odex file... not sure what's going on.

I'm going to try and odex my whole framework at the same time to see if that works, if not I'm out of ideas and will have to move on. At least we know it works on the deodexed OTA ROM. I suppose if people are desperate they can use that one.
[Samsung Galaxy Nexus] djmcnz:
It doesn't work for the odexed ROM at the moment sorry... I'm trying to fix it without much success (see above).
[Samsung Galaxy Nexus] djmcnz:
So that failed miserably too... I'm afraid I'm at a loss for options now and will need to move on... :(

I'll update the relevant posts to make it clear it's not available for odexed ROM's.

Sorry about that folks!
[Samsung Galaxy Nexus] Murrzeak:
Yeah, that's sad :(
[Samsung Galaxy Nexus] djmcnz:
Just install a deodexed ROM...
[Samsung Galaxy Nexus] bigeyes0x0:
@djmcnz: How did you fail? Did you pull the entire framework dir to decompile and recompile?
[Samsung Galaxy Nexus] djmcnz:
No, I just did the command on android.policy.jar, said success and generated odex (smaller than stock) which didn't boot... :(
[Samsung Galaxy Nexus] prowede:
Sad to hear this

hope there is some solution for odex rom
[Samsung Galaxy Nexus] bigeyes0x0:
I will make a volume wake one for odex rom sometime today when I'm free. That also needs a modded android.policy.odex. Last time I did it. I needed to pull entire framework directory to make it work (to be precise I guess they only need those in BOOTCLASSPATH env). Then I'll post it here for you guys to test. If it's good I'll post the process in detail.
[Samsung Galaxy Nexus] dave71670:
I know no requests but, could you make this mod without softkeys for captivate? PM me please if this possible.
[Samsung Galaxy Nexus] bigeyes0x0:
OK, sorry I'm late. I used bigxie's odex stock JB 4.1.1 ROM to create the volume wake mod. Someone know how to use adb can use it (and restore in case my mod screw up) as I didn't make a CWM zip. Remember to set the odex file permission to 644 and clean dalvik-cache before booting with this new odex file.

If I fail then sorry, as I'm BB can't test whether it works for real. If someone confirm it a success I will post the entire process how I did this mod here to share.
[Samsung Galaxy Nexus] mackendw:
TAJB 4.1.1 install fail

Hi:

I too was looking/hoping for a working enhanced power menu that would work on the TAJB jelly bean release. I hangs on boot up during the animation. Had to re-install. :(

W. MacKenzie
[Samsung Galaxy Nexus] djmcnz:
Whats TAJB?
[Samsung Galaxy Nexus] mackendw:
What's TAJB?

Team Android Jelly Bean 4.1.1. port to Samsung Galaxy S phone
[Samsung Galaxy Nexus] djmcnz:
Oh, I see. That's why this is posted in the Galaxy Nexus section... :)

Ask the TAJB to have a look at my guide, it will take them less than 15 mins to implement if they know what they're doing.
[Samsung Galaxy Nexus] fdfdrere:
I skimmed through the thread. It looks like it's still not safe to try it on OTA build?
[Samsung Galaxy Nexus] djmcnz:
Only on a deodexed OTA build... so not one actually received "over the air" no.
[Samsung Galaxy Nexus] fdfdrere:
Thanks for reply! Is the JRO03C deodexed from this thread working?

http://xdaforums.com/showthread.php?p=29304265

Thanks again.
[Samsung Galaxy Nexus] djmcnz:
Yep, that's the one I tested it on.

Make sure you make a recovery backup anyway! This replaces core files.
[Samsung Galaxy Nexus] Milamber33:
Crazy thought, did you try wiping cache and davlik cache after flashing this on odexed build? I note you never actually specified to do that anywhere...
[Samsung Galaxy Nexus] djmcnz:
No, I'm afraid not, doesn't work... and the instructions do say to wipe caches...
[Samsung Galaxy Nexus] fdfdrere:
Lack of a confirmation dialog

I think it'd be perfect if there is a confirmation dialog prior to reboot. These is one before the stock power off, saying "the phone will shot down, cancel or yes?".

A prudent user should always take power off / reboot seriously. :)

Thanks for the great work!
[Samsung Galaxy Nexus] djmcnz:
:)

You are correct, it's critical to treat these functions seriously and I can assure you I do with the mod. The reboot functions don't just "restart" the phone, they call the proper shutdown thread to make sure the phone closes all open files and writes all memory. On this basis it is safe.

Then I have to ask the question:

Do I wan't the simplest solution (no prompt) or the question prompt. For me I don't want the prompt because a) I know it is safe and b) I already selected 'reboot' and know that I want to reboot. If I make a mistake then that's okay, it will only take a few seconds to recover (reboot).

Of course this would interrupt any long process (like a file copy) but that's a trade-off...

TL;DR - No prompt sorry but it is a safe reboot.
[Samsung Galaxy Nexus] fdfdrere:
I totally agree with you. Actually I find it more convenient without confirmation dialog myself. But it's just that I'm such a perfection freak that I can't stand for items in the same menu to behave differently. You see, now power off has confirmation, while reboot doesn't. They are not consistent, yet they are in the same menu hierarchy. I cannot sleep thinking of this. :) Maybe we can put reboot and recovery into a sub-menu, saying those items in this sub-menu don't confirm, while those in the root menu do. It's kind of obsessive compulsory disorder, but I believe I have my point.
[Samsung Galaxy Nexus] djmcnz:
That is a perfectly valid point and a reasonable design consideration. I actually agree with you.

I'm travelling at the moment but might look at creating an "OCD" version when I'm back specifically to address this constructive feedback... :)
[Samsung Galaxy Nexus] fdfdrere:
Wonderful! You're the man!
[Samsung Galaxy Nexus] shokwaav:
I want this really badly, but the DIY instructions are too hard for a newb like me. Would you mind helping me?
[Samsung Galaxy Nexus] djmcnz:
Which ROM?

Has nobody done this for the S3 yet (from your signature)?
[Samsung Galaxy Nexus] shokwaav:
Well, it's available on CM10, but that's still really buggy. I'm running a stock jelly bean ROM, and the only thing I miss is an extended power menu.
[Samsung Galaxy Nexus] Mr Black'd:
Does anybody know if the mod of this thread is compatible to this one???
[Samsung Galaxy Nexus] 350d:
You are a star!
[Samsung Galaxy Nexus] RayYung:
Works great on ARHD 6.0.1

Thanks,
[Samsung Galaxy Nexus] djmcnz:
Yeah... well we'll see because I haven't gotten to it yet! It's on my list but my list is a bit too long, it's a "if I have the time" sort of thing sorry...
[Samsung Galaxy Nexus] fdfdrere:
Just come to check if you happen to get around to building the OCD version of the power menu. :)
[Samsung Galaxy Nexus] NMarco:
hi, this mod works on stock test rom of Galaxy S3?
[Samsung Galaxy Nexus] djmcnz:
My bad... I changed roms, couldn't test then forgot about it! :(

I could help you follow the instructions and make the change? It's not too difficult if you already have (or are motivated to use) tools like apktool.
[Samsung Galaxy Nexus] djmcnz:
Definitely not, no sorry it will bootloop.

However the instructions I've provided will work as a perfectly adequate guide for somebody to do it for the SGS3.
[Samsung Galaxy Nexus] Ryu234:
What does OTA and AOSP mean? Will both work on AOKP?
[Samsung Galaxy Nexus] djmcnz:
OTA = Over The Air

AOSP = Android Open Source Project

And AOKP has this built in so no need (and it's not compatible).
[Samsung Galaxy Nexus] DexyG:
Sorry for the noob question but I'm not sure which one to use: Android 4.1.1 (AOSP ONLY) or Android 4.1.1 (OTA & DEODEXED ONLY). I'm running bigxie's deodexed rom which is based on OTA, so I'm guessing the latter - but can someone please confirm? Thanks.
[Samsung Galaxy Nexus] djmcnz:
You should use this one: Android 4.1.1 (OTA & DEODEXED ONLY)
[Samsung Galaxy Nexus] DexyG:
Thought so. Just done it, working fine. Thanks!
[Samsung Galaxy Nexus] tobitronics:
Tried the AOSP version and I get an eternal bootloop. Running stock 4.1.1 yakju image with franco kernel. Should I try the OTA version or is this mod not compatible?
[Samsung Galaxy Nexus] smallvan:
Thanks for mod. Runs well with my GNex with ARHD 6.0.1. It is wonderful n useful.
[Samsung Galaxy Nexus] siealex:
I've flashed my Nexus with yakju-jro03c-factory-3174c1e5.tgz. What mod is compatible with this ROM? I tried to install the AOSP mod -> BOOTLOOP.
[Samsung Galaxy Nexus] Milamber33:
*sigh*

As the instructions point out, the AOSP one is only for custom ROMs built from the Android source. If you have a stock factory image, or even a ROM based on the stock factory image (like Bigxie's or ARHD), you need to use the OTA version. Also, your ROM needs to be deodexed, so if you haven't done that yet, you should do that first (or install one that is already deodexed). It's all clearly stated in the first post.
[Samsung Galaxy Nexus] djmcnz:
^^^ that.
[Samsung Galaxy Nexus] fdfdrere:
Don't apologize dude. We owe you. I don't think I'm capable of handling it myself. Thanks anyway!
[Samsung Galaxy Nexus] aldar5:
I'm running stock 4.1.1 JRO30O unlocked, rooted, etc. When I install JBEnhancedPowerMenu411.zip, it says it installs, but when I reboot, the power menu has not changed. Any ideas?
[Samsung Galaxy Nexus] Milamber33:
Did you wipe Davlik?
[Samsung Galaxy Nexus] djmcnz:
Isn't that a Verizon ROM? If so I'm not sure this mod will work but I'm equally surprised it didn't bootloop!

If absolutely nothing happened you'd need to check the recovery log I'm afraid (after trying previous suggestion). But if you're going to try again please make sure you have a backup.
[Samsung Galaxy Nexus] EVERED78:
https://developers.google.com/android/nexus/images

is this compatible with 4.1.1 from here
[Samsung Galaxy Nexus] djmcnz:
No, you need a deodexed stock rom, you can grab one from the dev section if you like.
[Samsung Galaxy Nexus] EVERED78:
Thanks
[Samsung Galaxy Nexus] EddyOS:
Will this need to be made again with 4.1.2? Getting my new GNex tomorrow and already got a ROM made but wanna add this to my build before flashing so wanna know if I'm gonna have to try DIY or if I can just use the 4.1.1 APM
[Samsung Galaxy Nexus] prowede:
I have used it on my 4.1.2 and it works without affecting others so far.
[Samsung Galaxy Nexus] DeMixx:
Hi,

I use this Power Menu on my Samsung Galaxy Nexus, works fine. Is there any similar for the Asus Nexus 7?

thx

D.
[Samsung Galaxy Nexus] djmcnz:
I'm not sure, you'd need to check in the N7 forum. Either way the DIY instructions in the first post would be generally applicable to the N7 also.
[Samsung Galaxy Nexus] jcampos:
Working with no apparent side effects in AHRD 7.0 (JellyBean 4.1.2)
[Samsung Galaxy Nexus] Maxolomeus:
so you chose the version for deodexed?
[Samsung Galaxy Nexus] jcampos:
Yes
[Samsung Galaxy Nexus] mjemec:
4.2 version?
[Samsung Galaxy Nexus] djmcnz:
That's what the DIY instructions are for... I'm sure someone will do it soon enough but I use a custom ROM now so it will need to be someone other than me.

I'll help out if somebody gets stuck though. It's a good project and a nice way to learn a little more about how Android works.
[Samsung Galaxy Nexus] devgayan:
Hey .... is this compatible with miui ?
[Samsung Galaxy Nexus] djmcnz:
No, I'm afraid not...
[Samsung Galaxy Nexus] ameir0000:
Updated for 4.2.1 please :)
[Samsung Galaxy Nexus] djmcnz:
Not from me sorry... see the DIY... :)
[Samsung Galaxy Nexus] eliaspizarro:
unfortunately, when I need to mod GlobalActions$10.smali and GlobalActions$11.smali you say "(Key changes highlighted)" but what are the original changes, ???, plz add the original GlobalActions$2.smali.

maybe these:

const/4 v1, 0x0

const-string p0, "now"

invoke-static {v0, p0, v1}, Lcom/android/server/pm/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V

const/4 v1, 0x0

const-string p0, "recovery"

invoke-static {v0, p0, v1}, Lcom/android/server/pm/ShutdownThread;->reboot(Landroid/content/Context;Ljava/lang/String;Z)V
[Samsung Galaxy Nexus] djmcnz:
The original GlobalActions$2.smali will be the one from your ROM, not the source I have... but if you want the smali from my files you can just download one of the .zips in the first post and extract from there.

Did I understand correctly?
[Samsung Galaxy Nexus] eliaspizarro:
yes, it's just for compare.

srry again, why, in the line 29 of the file GlobalActions$2.smali you have ".line 206", when in the same line 29 of the files GlobalActions$10.smali and GlobalActions$11.smali you have ".line 198"?
[Samsung Galaxy Nexus] albsat:
Re: [MOD][JB4.1+][AOSP+OTA] Super Power Menu | Reboot & Recovery | DIY Instructions A

I hope this mod will be updated for the latest Google image image ota.
[Samsung Galaxy Nexus] bulgareli:
Me too...
[Samsung Galaxy Nexus] djmcnz:
Hi guys. To manage expectations, I won't personally be updating this (I use a custom ROM now) but will help a (knowledgeable) person to do so if requested. By knowledgeable, I really do mean somebody that is already familiar with the JRE, apktool and smali...
[Samsung Galaxy Nexus] staud:
deleted