Default [GUIDE]How to OG BatteryMod

Things you will need

1. Apktool 2.0
2. NotePad ++
3. Xposed Installed on Your Mobile

STEPS :
1. Decompile your SystemUI.apk

2. Open the file (\SystemUI\smali\com\android\systemui\statusbar\ph one\PhoneStatusBar.smali)

3. Find the Line(around at 36)
Code:
.field mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
Replace with
Code:
.field mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
Then find (around at 8511)
Code:
new-instance v0, Lcom/android/systemui/statusbar/policy/BatteryController;
Replace with
Code:
new-instance v0, Lcom/ghareeb/BatteryMod/BatteryController;
Then find
Code:
invoke-direct {v0, v2}, Lcom/android/systemui/statusbar/policy/BatteryController;-><init>(Landroid/content/Context;)V
Replace with
Code:
invoke-direct {v0, v2}, Lcom/ghareeb/BatteryMod/BatteryController;-><init>(Landroid/content/Context;)V
Then find
Code:
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
Replace with
Code:
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
4. Now add these lines below above line
Code:
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;

iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

const v4, 0x7f07002d   #  public id of battery

invoke-virtual {v0, v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

move-result-object v0

check-cast v0, Landroid/widget/ImageView;

invoke-virtual {v3, v0}, Lcom/ghareeb/BatteryMod/BatteryController;->addIconView(Landroid/widget/ImageView;)V
5.Find around line 9033
Code:
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
replace with
Code:
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
and around line 9553

Code:
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
replace with
Code:
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
Note : the concept here is to replace all
Code:
Lcom/android/systemui/statusbar/policy/BatteryController
with
Code:
Lcom/ghareeb/BatteryMod/BatteryController
6. extract and copy the attached smali.zip to /smali/com/

7.Open res/layout/msim_status_bar.xml or status_bar.xml
find
Code:
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="10.5dip" android:layout_height="16.0dip" android:layout_marginBottom="0.33000004dip" android:layout_marginStart="4.0dip" />
replace with
Code:
<ImageView android:id="@id/battery" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" />
NOTE: android:layout_height="wrap_content" renders big battery icon you can instead use android:layout_height="18.dip"

8. compile the SystemUI

9. Now download OG BatteryMod and put it in (system\app) folder.

ORIGINAL GUIDE ADAPTED FOR MOTO G

BUGS :
0% text always in Quick Setting Battery Icon

Temporary Fix :
Disable the Text by : editing quick_settings_title_battery.xml
Code:
<TextView android:gravity="top|center" android:layout_gravity="top|center" android:id="@id/text" android:layout_width="fill_parent" android:layout_height="wrap_content" style="@style/TextAppearance.QuickSettings.TileView" />
to

Code:
<TextView android:gravity="top|center" android:layout_gravity="top|center" android:id="@id/text" android:layout_width="0.0dip" android:layout_height="0.0dip" style="@style/TextAppearance.QuickSettings.TileView" />
Attached Files
File Type: zip smali.zip - [Click for QR Code] (8.3 KB, 47 views)


 
सारे जहाँ से अच्छा हिन्दोस्तान हमारा

Proud to be an Indian

MY DEVICE
XPERIA MINI ST15i - UNLOCKED CM11
XPERIA U - ROOTED LOCKED
DELL XCD 35
MOTO G