[MOD] [JB4.1+][AOSP+OTA] Super PowerMenu | Reboot & Recovery | DIY Instructions Avail

Search This thread

Anthrax

Senior Member
Oct 22, 2012
1,639
785
Mumbai
if you get any work around just let me know.... :)

@OP:

if you can help us it will be great....
here's a log cat attached......
 

Attachments

  • log.txt
    36 KB · Views: 2

bluenile

Senior Member
Sep 24, 2009
117
2
@djmcnz any idea how we can switch to this "Power Menu" instead of the Shutdown Confirmation Alert dialog box that we get on some tablets like PiPo M9? Thanks for your time.
 

bluenile

Senior Member
Sep 24, 2009
117
2
That's what this tut is about.... Follow the tutorial to get the power menu....

Sent from my MT27i using xda app-developers app

Thanks for your reply. I compiled the framework-res.apk and android.policy.jar as per the instructions in the tut, still get the old shutdown confirmation box. I will try again. May be I'm missing something?
 

Anthrax

Senior Member
Oct 22, 2012
1,639
785
Mumbai
Thanks for your reply. I compiled the framework-res.apk and android.policy.jar as per the instructions in the tut, still get the old shutdown confirmation box. I will try again. May be I'm missing something?
provide a logcat.... and also as said by OP this method works confirm on Nexus only....
 

bluenile

Senior Member
Sep 24, 2009
117
2
provide a logcat.... and also as said by OP this method works confirm on Nexus only....

Logcat attached. Thanks for your time.

** Also attached the screenshot of the Shutdown Confirmation Alert dialog box I still get.
 

Attachments

  • logcat.txt
    151.2 KB · Views: 8
  • Screenshot_2013-05-11-00-49-09.jpg
    Screenshot_2013-05-11-00-49-09.jpg
    12.2 KB · Views: 120
Last edited:

djmcnz

Retired Recognized Developer
Oct 13, 2009
5,747
1,689
Auckland, NZ
OnePlus 8
Google Pixel 8
Yes, the problem will be that the OEM who made your device didn't use the standard Google/Android methods for shutdown/reboot. This is quite common and it's not "bad" at all, just different.

The principles in this guide will still apply but the various methods used and messages displayed are probably named differently and, more problematically, located in different places in the smali code. It would be impractical I think for anyone to try and work through that process without the specific device in hand.

Removing the confirmation should be easy, you just need to find that message, skip it and provide a "yes" message to the system automatically. If you can do some basic smali navigation then tracing this is probably quite easy.

Adding in functions (reboot/recovery etc) will require you a) finding the correct location and b) finding suitable code to insert. There may already be useful code in there you can "copy and paste" and change a few values (my guide has an example of this applicable to the Nexus).

Adding long-press will be a pain if it's not already there somewhere by default. If it is then again, it's copy and paste making sure you change some values.

All said and done though, if you can't "read" smali (or convert it to java and read that) then it will be a cumbersome process of trial and error I'm afraid.

Note: a custom rom dev that's building from source could add these features in a matter of minutes, if you have access to a custom rom for your device it may pay to ask the dev if they can add it in.
 

bluenile

Senior Member
Sep 24, 2009
117
2
Yes, the problem will be that the OEM who made your device didn't use the standard Google/Android methods for shutdown/reboot. This is quite common and it's not "bad" at all, just different.

The principles in this guide will still apply but the various methods used and messages displayed are probably named differently and, more problematically, located in different places in the smali code. It would be impractical I think for anyone to try and work through that process without the specific device in hand.

Removing the confirmation should be easy, you just need to find that message, skip it and provide a "yes" message to the system automatically. If you can do some basic smali navigation then tracing this is probably quite easy.

Adding in functions (reboot/recovery etc) will require you a) finding the correct location and b) finding suitable code to insert. There may already be useful code in there you can "copy and paste" and change a few values (my guide has an example of this applicable to the Nexus).

Adding long-press will be a pain if it's not already there somewhere by default. If it is then again, it's copy and paste making sure you change some values.

All said and done though, if you can't "read" smali (or convert it to java and read that) then it will be a cumbersome process of trial and error I'm afraid.

Note: a custom rom dev that's building from source could add these features in a matter of minutes, if you have access to a custom rom for your device it may pay to ask the dev if they can add it in.
Thanks for your reply. I'm totally a n00b here.

But you are correct, upon long pressing the power/lock button the tablet calls the shutdown procedure in services.jar (ShutdownThread.smali). Is there any way I can call the createdialog function in android.policy.jar from within the shutdown function already invoked?
 

djmcnz

Retired Recognized Developer
Oct 13, 2009
5,747
1,689
Auckland, NZ
OnePlus 8
Google Pixel 8
Thanks for your reply. I'm totally a n00b here.

But you are correct, upon long pressing the power/lock button the tablet calls the shutdown procedure in services.jar (ShutdownThread.smali). Is there any way I can call the createdialog function in android.policy.jar from within the shutdown function already invoked?

In theory yes, in practice it would be difficult unless you had some sample code.

Thinking about it more, if it's anything like my tablet (ASUS) then you may find the stock shutdown code all still in there. You could get lucky with this and if so some small changes would probably allow it to be invoked. Look for the existence of the files and strings in my guide, they'll be a good indicator.

Sorry for the tardy replies...
 

bluenile

Senior Member
Sep 24, 2009
117
2
In theory yes, in practice it would be difficult unless you had some sample code.

Thinking about it more, if it's anything like my tablet (ASUS) then you may find the stock shutdown code all still in there. You could get lucky with this and if so some small changes would probably allow it to be invoked. Look for the existence of the files and strings in my guide, they'll be a good indicator.

Sorry for the tardy replies...

Hi - Thanks for your reply, I appreciate your help. I was able to solve the issue by changing the order of menus invoked in phonewindowmanager2.smali. (credit: kahvitahra for the tip)
 
Last edited:

Zombeezy

Senior Member
Jul 11, 2012
57
18
Nexus 5

Loved your Super PowerMenu that was an integral part of the 4.2.1 MiNCO v6 (Minooch + Franco) Toro ROM for the Galaxy Nexus. I now have a Nexus 5 and am missing your power menu functionality to reboot to recovery, etc.

Since I am using ART instead of Dalvik, is there any chance you might do a Super PowerMenu for Nexus 5 Kit Kat that is not part of Xposed Framework using Dalvik?

Thank you!
 

LiquidXed

Senior Member
Jul 10, 2010
424
44
Maybe look into the xposed module, it has the reboot menu for the GNex

Sent from my Galaxy Nexus using Tapatalk
 

djmcnz

Retired Recognized Developer
Oct 13, 2009
5,747
1,689
Auckland, NZ
OnePlus 8
Google Pixel 8
Maybe look into the xposed module, it has the reboot menu for the GNex

Z' wants to use the ART compiler so no Xposed... :(

Loved your Super PowerMenu that was an integral part of the 4.2.1 MiNCO v6 (Minooch + Franco) Toro ROM for the Galaxy Nexus. I now have a Nexus 5 and am missing your power menu functionality to reboot to recovery, etc.

Since I am using ART instead of Dalvik, is there any chance you might do a Super PowerMenu for Nexus 5 Kit Kat that is not part of Xposed Framework using Dalvik?

Thank you!

Sorry for the delay, we had a holiday weekend here and I've been working on my car.

To be honest, since I didn't notice a difference between ART and Dalvik on my N5 I'm using Xposed and GravityBox which is just awesome. I probably won't be making changes to the stock KK ROM this time around but if somebody wants to decompile the code and do the testing I'm happy to assist with any changes... our you could set yourself a challenge and follow the DIY - I'm almost sure the power menu code won't have changed much.
 
  • Like
Reactions: Zombeezy

Zombeezy

Senior Member
Jul 11, 2012
57
18
Z' wants to use the ART compiler so no Xposed... :(



Sorry for the delay, we had a holiday weekend here and I've been working on my car.

To be honest, since I didn't notice a difference between ART and Dalvik on my N5 I'm using Xposed and GravityBox which is just awesome. I probably won't be making changes to the stock KK ROM this time around but if somebody wants to decompile the code and do the testing I'm happy to assist with any changes... our you could set yourself a challenge and follow the DIY - I'm almost sure the power menu code won't have changed much.
No problem, appreciate you getting back to me on this.

Not adventurous or smart enough enough to tackle it as a DIY, lol, but you bring up a good point - notable performance difference so far between ART and Dalvik to me also was minimal, mostly while doing scrolling long web pages, it seemed to do it more smoothly.

Good suggestion - I'll head back to Dalvik, Xposed and GravityBox. Definitely awesome, you're right. Thank you!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 146
    [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
    EPMFull.png
    EMPRR.png

    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

    40
    Jelly Bean 4.1.1 Release

    Enhanced Power Menu
    For Android 4.1.1 (AOSP ONLY)


    This version has been tested on the 4.1.1 AOSP (Android Open Source Project) build of Android. This IS NOT compatible with the OTA (Over the Air) build!! For OTA click here.

    NOW WITH HOT SAUCE + OMG BACON!!
    HOT SAUCE: Available now below is a version with long-press Recovery to reboot to the bootloader!
    NEW BACON: Reboot with Recovery on long-press so no visible Recovery menu option! (screenshot in first post)

    Instructions
    1. Download one of these files:
    2. Copy it to your SD card
    3. Reboot to recovery
    4. Wipe caches
    5. Do a full backup
    6. Flash the file you downloaded
    7. Reboot
    8. Enjoy
    9. 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! :)
    34
    4.1.1 ***OTA*** Release

    Enhanced Power Menu
    For Android 4.1.1 (OTA & DEODEXED ONLY)


    This version has been tested on the 4.1.1 OTA (Over the Air) build of Android. This IS NOT compatible with AOSP (Android Open Source Project) builds!! For AOSP click here.

    A LITTLE BIT OF SAUCE
    Below is a version with long-press Recovery to reboot to the bootloader
    Additional versions (along the lines of the AOSP options) will follow based on demand

    Instructions
    1. Download this:
    2. Copy it to your SD card
    3. Reboot to recovery
    4. Wipe caches
    5. Do a full backup
    6. Flash the file you downloaded
    7. Reboot
    8. Enjoy
    9. 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! :)
    9
    Jelly Bean 4.1 Release

    Enhanced Power Menu
    For Android 4.1 (DEPRECATED)


    Instructions
    1. Download this file: JBEnhancedPowerMenu.zip
    2. Copy it to your SD card
    3. Reboot to recovery
    4. Wipe caches
    5. Do a full backup
    6. Flash the file you downloaded
    7. Reboot
    8. Enjoy
    9. 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.
    9
    [GUIDE] - Modding the Power Menu

    For those interested, here's a stab... it's not ideally formatted and it's only general so you will still need to know what you're doing. But if you follow this carefully you will achieve the right result.

    I'll create a separate post for this soon and provide the link here so please no discussions in this thread.

    Modding the Power Menu (Google Docs)

    Enjoy!