• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Advanced Power Menu: Quick Guide+Mod+Resources

modhatter6811

Android Enthusiast
Advanced Power Menu: Quick Guide

Screen Shots:
jfCGDrS.png

Disclaimer:
I am not responsible if you brick your device. This will not make people like you, or get you out of a ticket for triple parking your Bat Mobile. Make a backup before attempting this! One wrong move and it's bootloop city. Don't say I didn't warn you! This guide applies to the Deodexed Stock ROM Only!
Tools Needed
Apk Tool (You need the first 2 download files and to extract their contents to the same folder)
Downloads - android-apktool - A tool for reverse engineering Android apk files - Google Project Hosting

7-Zip

Java & JRE (7+ is recommend, JRE/JDK 6 might work)
JDK 7 and JRE 7 Installation Guide

You must have Java in your environment path!
How do I set or change the PATH system variable?

Smali & Baksmali (I use Easy Apktool for this)
Downloads - easy-apk-dissassembler - A simple user interfarce for Windows to modify entirely your APK with ressources - Google Project Hosting

Advanced_Power_Menu.zip
Dev-Host - Advanced_Power_Menu.zip - The Ultimate Free File Hosting / File Sharing Service

Very few brain cells...


Prerequisite: Using root explorer or ADB, copy and move these two files from system/framework, to a location on your desktop.

framework-res.apk & android.policy.jar


Working with the framework-res.apk


1. Copy the framework-res.apk into the folder containing Apktool 1.5.2, then shift+right click the inside of the folder and select "open command window here".

2. First we need to load our framework into apktool. To do this, we type the following into the command window without the quotes,
"apktool if framework-res.apk ", then hit enter.

3. Next we need to decompile our framework. We do this by typing the command, "apktool d framework-res.apk", again without the quotes. Hit enter.

4. You should now have a new folder named framework-res inside of the apktool 1.5.2 folder. Open this folder, then using 7-zip or winrar, extract the contents of the Advanced_Power_Menu.zip to the desktop. Open the newly extracted folder, and copy the entire res folder (res is inside framework-res.apk folder), to the framework-res folder. Confirm all overwrites and file mergers!

5. Now its time to rebuild our apk, type the following into the command window, as always, without the quotes! "apktool b framework-res" Enter.

6. Almost done! To finish it off we need to sign it with the original signature. This prevents you from boot looping. Navigate to /apktool1.5.2/framework-res/build, then using 7-zip, open your original unmodified framework-res.apk and copy the META-INF folder and the AndroidManifest.xml to the build folder. Allow the overwrite. For the love of all things sacred, DO NOT USE ANY AUTO SIGNER FOR FRAMEWORK FILES!!!

7. Now we run the command "apktool b framework-res" one last time. You will find the finished product in framework-res/dist. Push this file back to system/framework in your phone using root explorer or adb and set permissions to rw-r--r--. Now reboot. If you don't get thrown into an immediate bootloop, then congratulations, you did everything correctly!


Working with the android.policy.jar


1. Copy the android.policy.jar file to the Easy Apktool folder.

2. Using 7-zip, right click your android.policy.jar and open it. Extract the classes.dex file to the Easy Apktool folder.

3. Double click the bat file inside Easy Apktool folder to launch the program. Select option 2 (disassemble classes.dex) Enter, and enter once more. You will now have a new folder named out_.

4. Open the android.policy.jar folder found in the Advanced_Power_Menu.zip file you extracted earlier. Copy all the files found here to Easy Apktool/out_/com/android/internal/policy/impl

5. Select option 3 (rebuild classes.dex) Hit enter. You should now have a file named new.dex inside the Easy Apktool folder. Rename this to classes.dex

6. Again, using 7-zip, open the original unmodified android.policy.jar and drag and drop the newly built/renamed classes.dex into it. Confirm the overwrite. Push this to system/framework and set permissions to rw-r--r--, and reboot. If everything went well, you should have a functioning Advanced Power Menu! Done!


I made this short guide to help get others into the world of ROM development. This guide, and the resources contained within it, are free for all to use. Anyone and everyone has my express permission to use any files provided by me, towards building their own custom ROM. Happy modding!
A very special thanks to brittnearl for providing the Stock Deodexed ROM, and to cooldudezach and phenomx4 for all their hard work on recoveries, without which, none of this would be possible! ~ModHatter6811~

Please notify me of any needed corrections or suggestions. Additional link: http://androidforums.com/awe-all-t...rooted-stock-deodexed-odexed-b05-updated.html
 
Reserved: I may extend this in the near future, to go in depth with details about editing smali, the %1 battery mod, and possibly some other goodies. If you have any ideas, mods, or guides in mind, please let me know, and I will do my best to provide it.
 
good guide bro,although im not using it for the apm (i cheated...i used yours lol)i am using it for status bar and a few other things.
 
Back
Top Bottom