5,605,835 Members 47,771 Now Online
XDA Developers Android and Mobile Development Forum

[MODS](ODEXED) CDMA XT912 1% Battery & Drop Toggles (PORTING GUIDE INCLUDED)

Tip us?
 
alteredlikeness
Old
(Last edited by alteredlikeness; 26th December 2012 at 03:30 AM.)
#1  
alteredlikeness's Avatar
Recognized Contributor - OP
Thanks Meter 4543
Posts: 2,250
Join Date: Mar 2012
Location: reflecting on Indra's net

 
DONATE TO ME
Default [MODS](ODEXED) CDMA XT912 1% Battery & Drop Toggles (PORTING GUIDE INCLUDED)

Did this for a friend on the razr - but I'm on an Atrix 2, so it's not that much different... (original post can be found here)

Included are ODEXED versions (for your stock, rooted razr, if you so desire) of the 1% battery increments and horizontal scrollable quick panel toggles. This will also remove the carrier name from the pulldown menu (you're on your own for getting it back or removing it from the lockscreen if you want - this might help).



NOTE: CDMA ONLY - This was made from and installed on DROID RAZR System version 6.16.211.XT912.Verizon.en.US on ICS 4.0.4 - not sure about cross-system compatibility, but I wouldn't try it without a backup plan..
I am not responsible for your phone.


Download & Install:
(The following is the way I installed it using whirleye's BootMenu app - feel free to unzip and/or use your own method to install)
-Download RAZR_ICS_ODEXED_1perBatt_DropTogs.zip to your sdcard
-Boot into recovery with BootMenu
-Wipe dalvik & cache partition
-Install zip & Reboot

Credits & Thanks:
I ported these both over to ICS from GB for the A2... then moved them over to the RAZR (it involves a lot of edits, additions, deodexing and re-odexing)
-Major credit goes to nitroglycerine33 for the scrollable toggles
-Thanks also to cogeary for bringing nitro's work to the A2
-Thanks to he_stheone64 for the battery icons (except the unknown (?) batt image, that was me)
-Thanks to iwabashu for the use of the RAZR and the screenie
-----------------------------------------
Original post (but, very applicable to the RAZR variants): http://forum.xda-developers.com/show....php?t=1803516
PORTING THE 1% BATTERY INCREMENTS & DROPDOWN (QUICK PANEL) TOGGLES TO YOUR SYSTEM VERSION

This guide is based on moving these mods for ICS to other similar ICS-running devices. The process varies a bit going from GB to ICS. Or ICS to JB..
Quote:
You will need:
Your deodexed SystemUI.apk
Your deodexed services.jar
Copies of deodexed SystemUI.apk & services.jar with the mods
Apktool /Smali/Baksmali tools
Notepad++ or similar text editor
7-zip or similar archive manager
WinMerge or Meld or similar diff/compare tool (a very useful tool that allows you to compare two folders or files side-by-side, and points out the differences for you)
My “get started” thread may hold some tips for accomplishing the tasks below – check it out HERE

Quote:
IMPORTANT: This guide is to help you get these mods to your system, for your personal use. If you take the toggles from above and decide to use them in a ROM, be certain to credit nitroglycerine33 for his work.
Don't forget to install your framework for apktool by putting your framework-res.apk next to apktool, cd to that folder (or hold-shift right-click), and do a:
Code:
apktool if framework-res.apk
SystemUI.apk:
Quote:
-decompile your deodexed SystemUI.apk
-rename the one with the mods to something else like SystemUI2.apk, and decompile also

For the dropdown toggles:
-add quickpanel smali
Copy the “quickpanel” folder from the modded com\android\systemui\statusbar folder to the same location in your stock
 


-add quickpanel_quick_settings.xml to layout folder
Open the modded SystemUI.apk\res\layout folder and copy the quickpanel_quick_settings.xml to your stock layout folder
NOTE: Some older toggle mods may not have this xml, all of the code was included in the status_bar_expanded.xml (Big thanks to nitroglycerine33 for the new xml code that is so much easier to work with)

-edit status_bar_expanded.xml or status_bar_tracking.xml for new qp xml (see below for options - some don't have the _tracking.xml - it's all in expanded, I think)
Open the modded SystemUI.apk\res\layout\status_bar_expanded.xml and add this line:
Code:
<include layout="@layout/quickpanel_quick_settings" />
(this will put the toggles between the date and notifications)
 

OR
(this will put the toggles above the date, directly under the status bar)
 

OR
delete the "include layout" line entirely from status_bar_expanded and open status_bar_tracking.xml
(this will put the toggles at the very bottom, attached to the close bar)
 


-add 33 quickpanel images
Add or copy the 33 .png images associated with the quickpanel toggles from the modded SystemUI.apk\res\drawable-hdpi to your stock /drawable-hdpi folder
 


-add qp lines to ids.xml
Open the modded SystemUI.apk\res\values\ids.xml and copy all of the quickpanel ids to your stock ids.xml (there should be 41 lines at the bottom of the xml – selected in the screenshot below)
 


-add qp lines to strings.xml
Open the modded SystemUI.apk\res\values\strings.xml and copy all of the quickpanel strings to your stock strings.xml (there should be 15 lines at the bottom of the xml – selected in the screenshot below)
 


-add qp to public.xml
(NOTE: The resource ID’s in the public.xml need to be unique – meaning that no two alpha-numeric IDs can be the same. If you are lucky, you can just use the trick below and copy the resource IDs entirely from the modded xml. So, before you copy and paste, check a few of the modded resource ID’s against your stock. If you need to assign new ID’s, just stop here, compile your SystemUI.apk, then decompile it again and look for the new IDs created in the public.xml – you will then need to copy those resource IDs over to the quickpanel smali files - with a lot of cross-referenceing.)
Open the modded SystemUI.apk\res\values\public.xml and copy the quickpanel lines from the public type = “drawable” (33 lines), “string” (15 lines), and “id” (41 lines) to your stock public.xml (do not worry about the drawables for the battery images)
 


For the 1% Battery:
-add stat_sys battery xmls
Open the modded SystemUI.apk\res\drawable folder and copy stat_sys_battery.xml and stat_sys_battery_charge.xml to your stock drawable folder and overwrite the existing
 


-204 battery images
Add or copy the 204 .png images associated with the 1% battery increments from the modded SystemUI.apk\res\drawable-hdpi to your stock drawable-hdpi folder
 


-compile the SystemUI.apk (make sure that you saved your original signatures (META-INF folder), and do not compress the resources.arsc - meaning, take it out of the apk and re-add it to the apk in "store" mode with 7-zip)
-it is suggested to decompile the newly modded apk, and check that all of your new edits are still there

services.jar
Quote:
For 1% battery mod only (toggles are done):
-baksmali the classes.dex from your services.jar, and rename the folder to my_classout, or something
-baksmali the classes.dex from the modded services.jar, and rename the folder to mod_classout, or whatever

-edit BatteryService.smali
Open the modded com\android\server\BatteryService.smali and your stock BatteryService.smali with WinMerge or Meld and compare the two files.

 
(What..? You didn't think I'd do it all for you, did you?)
Update: See HERE


-reassemble (smali) into a new classes.dex and copy to and overwrite the existing one in your services.jar with an archive manager

***ATTACHED ARE THE DEODEXED STOCK & MODDED XT912 FILES FOR YOUR REFERENCE AND TO COMPARE***


If this is for an ODEXED system, you must then re-odex the SystemUI.apk and services.jar. See HERE for how to do that

These were originally ported using a similar process from GB to ICS for the Atrix 2 (except I ended up re-doing all of the resource ID's in the quickpanel smali). Since then, I have used the above method to move both mods over to the RAZR. --- UPDATE 9/13/12: I also used this method to move the 1% battery increments over to CM10/JB for the A2... watch the v3, v4, etc, notation in the BatteryService.smali... pay attention to detail.

Please post questions or PM with complaints.

Big thanks to nitroglycerine33, cogeary, and whoever else first did the smali/xml coding, and all the devs/modders who came before..


EDIT (2012.12.25): Attached a zip below to restore stock odexed xt912 ICS files and remove this mod. Wipe dalvik cache and flash in custom recovery.
Quote:
Originally Posted by doseone/themselves View Post
Code:
...with the kind of hunger wings once sprung from...
A2 Edison | N10 Manta

/-\ |_ T F |2 F |)
The Following 24 Users Say Thank You to alteredlikeness For This Useful Post: [ Click to Expand ]
 
lrlooly
Old
#2  
Member
Thanks Meter 2
Posts: 41
Join Date: Feb 2012
Any confirmation from anyone that all toggles work? I would love to do this to my phone. Im on. 215 willing to try it. But what happens if it doesnt work. How do i revert back to normal? Sbf?

Sent from my DROID RAZR using xda app-developers app
 
alteredlikeness
Old
#3  
alteredlikeness's Avatar
Recognized Contributor - OP
Thanks Meter 4543
Posts: 2,250
Join Date: Mar 2012
Location: reflecting on Indra's net

 
DONATE TO ME
Quote:
Originally Posted by lrlooly View Post
Any confirmation from anyone that all toggles work? I would love to do this to my phone. Im on. 215 willing to try it. But what happens if it doesnt work. How do i revert back to normal? Sbf?

Sent from my DROID RAZR using xda app-developers app
Not sure if it will work on .215..
But, you should always have a good backup just in case something goes wrong.. sbf should be a last resort.

Or you can create another zip package with your current working copies of the 4 files that will be replaced by this zip package. You can probably just use this zip package and drop your current apk/jar/odex files in there and put it on your sdcard also... And if it bootloops, go into recovery and flash the zip to restore your original files..
This might help - there's a small section at the end about making zip packages: http://forum.xda-developers.com/show....php?t=1753659

Sent from my phone's mind
Quote:
Originally Posted by doseone/themselves View Post
Code:
...with the kind of hunger wings once sprung from...
A2 Edison | N10 Manta

/-\ |_ T F |2 F |)
The Following User Says Thank You to alteredlikeness For This Useful Post: [ Click to Expand ]
 
HSD-Pilot
Old
#4  
HSD-Pilot's Avatar
Recognized Contributor
Thanks Meter 1893
Posts: 3,202
Join Date: Jan 2012
Location: NRW
Just an warning for GSM Users > Crackflasher as i'm, i had to try it

Stuck on Bootanimation, so nandroid back
The Following 2 Users Say Thank You to HSD-Pilot For This Useful Post: [ Click to Expand ]
 
alteredlikeness
Old
#5  
alteredlikeness's Avatar
Recognized Contributor - OP
Thanks Meter 4543
Posts: 2,250
Join Date: Mar 2012
Location: reflecting on Indra's net

 
DONATE TO ME
Quote:
Originally Posted by HSD-Pilot View Post
Just an warning for GSM Users > Crackflasher as i'm, i had to try it

Stuck on Bootanimation, so nandroid back
Yea.. cdma only - as it's the SystemUI.apk and services.jar getting changed.
I updated the OP. Sorry bout that.

Sent from my phone's mind
Quote:
Originally Posted by doseone/themselves View Post
Code:
...with the kind of hunger wings once sprung from...
A2 Edison | N10 Manta

/-\ |_ T F |2 F |)
The Following User Says Thank You to alteredlikeness For This Useful Post: [ Click to Expand ]
 
HSD-Pilot
Old
#6  
HSD-Pilot's Avatar
Recognized Contributor
Thanks Meter 1893
Posts: 3,202
Join Date: Jan 2012
Location: NRW
No problem, I expected nothing else
I just tried it anyway.

Sent from my CustomiZed XT910
 
lrlooly
Old
#7  
Member
Thanks Meter 2
Posts: 41
Join Date: Feb 2012
Wont install on. 215. Not sure if there is something i did wrong however.

Sent from my DROID RAZR using xda app-developers app
 
chris3582
Old
#8  
chris3582's Avatar
Senior Member
Thanks Meter 32
Posts: 122
Join Date: Apr 2010
Location: wallingford
Did not work for me either, stock ics, rooted. I would love to get this on my phone.

Sent from my DROID RAZR using xda premium
 
alteredlikeness
Old
#9  
alteredlikeness's Avatar
Recognized Contributor - OP
Thanks Meter 4543
Posts: 2,250
Join Date: Mar 2012
Location: reflecting on Indra's net

 
DONATE TO ME
Quote:
Originally Posted by alteredlikeness View Post
NOTE: CDMA ONLY - This was made from and installed on DROID RAZR System version 6.16.211.XT912.Verizon.en.US on ICS 4.0.4 - not sure about cross-system compatibility, but I wouldn't try it without a backup plan..
I am not responsible for your phone.

Quote:
Originally Posted by lrlooly View Post
Wont install on. 215. Not sure if there is something i did wrong however.

Sent from my DROID RAZR using xda app-developers app

Quote:
Originally Posted by chris3582 View Post
Did not work for me either, stock ics, rooted. I would love to get this on my phone.

Sent from my DROID RAZR using xda premium
If it's not the system version listed, it doesn't work for you.

chris3582 - what version are you? How are you trying to install?

And you guys all have recovery on boot working before trying these things, right?

Sent from my phone's mind
Quote:
Originally Posted by doseone/themselves View Post
Code:
...with the kind of hunger wings once sprung from...
A2 Edison | N10 Manta

/-\ |_ T F |2 F |)
The Following User Says Thank You to alteredlikeness For This Useful Post: [ Click to Expand ]
 
countryfolk07
Old
#10  
countryfolk07's Avatar
Senior Member
Thanks Meter 283
Posts: 1,166
Join Date: May 2010
Location: Mansfield

 
DONATE TO ME
Quote:
Originally Posted by chris3582 View Post
Did not work for me either, stock ics, rooted. I would love to get this on my phone.

Sent from my DROID RAZR using xda premium
The updater script uses busybox. If you don't have busybox in sbin directory it most likely will not install.

From my ICED down MAXX!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes