Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,799 Members 48,242 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] Add OGBatteryMod to your ROM

Tip us?
 
talkingmonkeys
Old
#1  
talkingmonkeys's Avatar
Recognized Contributor - OP
Thanks Meter 1291
Posts: 1,168
Join Date: May 2013

 
DONATE TO ME
Default [Guide] Add OGBatteryMod to your ROM

I found this guide here and this is what I did differently from it to make this work for us. You can use the linked file to click an app to change the icon or you can add it into settings in your rom. For those that don't know what this does this probably isn't the thread for you. Just wait until you see it popping up in the roms you use. This should work universally for ND8 builds.

http://forum.xda-developers.com/show....php?t=2730108

Now instead of following all of his steps and not finding what you're searching for I will simplify this some to make it quicker. You will want to search for this and replace it throughout the smali file in your decompiled systemui.apk (\SystemUI\smali\com\android\systemui\statusbar\ph one\PhoneStatusBar.smali)

Find all instances of
Code:
Select Code
Lcom/android/systemui/statusbar/policy/BatteryController;
and replace with

Code:
Select Code
Lcom/ghareeb/BatteryMod/BatteryController;
Then open (\SystemUI\res\layout\status_bar.xml) and find [This may already be changed if you used tdunham's 1% battery mod]
Code:
Select Code
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="12.0dip" android:layout_height="18.0dip" android:layout_marginBottom="0.33000004dip" android:layout_marginStart="5.0dip" />
and replace it with
Code:
Select Code
<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="0.0dip" android:layout_marginStart="2.0dip" />
Now most importantly you need to add these smali files to your systemui so they're in (systemui/smali/com/ghareeb/BatteryMod)

http://forum.xda-developers.com/atta...1&d=1398368939

Then add the OGBatterymod.apk of your choice to system/app. I didn't provide one in this guide sorry but maybe I will upload one eventually. You can easily look for one to add, all the old ones should work.


To add it to secsettings under display

Decompile secsettings.apk and open (\SecSettings\res\xml\display_settings.xml)

Find
Code:
Select Code
<PreferenceScreen android:title="@string/notification_panel_title" android:key="notification_panel_edit" android:fragment="com.android.settings.NotificationPanelMenu" />
Add this under that line
Code:
Select Code
<PreferenceScreen android:title="@string/battery_mod" android:summary="@string/battery_mod_desc">
        <intent android:targetPackage="com.ghareeb.battery" android:action="android.intent.action.MAIN" android:targetClass="com.ghareeb.battery.Settings" />
    </PreferenceScreen>
Now open (\SecSettings\res\values\string.xml) and add this
Code:
Select Code
<string name="battery_mod">OGBattery Mod</string>
<string name="battery_mod_desc">Change battery icon and charging animation.</string>
For those who don't want to add this to settings for some reason you can find one with the icon so you can just open the app here: http://forum.xda-developers.com/show....php?t=2758088

Thanks to @OsamaGhareeb and @meawww also @axel06 for his that I linked with the icon instead of having to have it in settings if anyone would like to do it this way.
The Following 6 Users Say Thank You to talkingmonkeys For This Useful Post: [ Click to Expand ]
 
Chad The Pathfinder
Old
#2  
Chad The Pathfinder's Avatar
Senior Member
Thanks Meter 1977
Posts: 2,139
Join Date: Mar 2012
Location: Central Kentucky
Dude you are awesome! I can't wait to get on this. Have to wait till the weekend though.
I'm a padawan with no master.
The Following User Says Thank You to Chad The Pathfinder For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes