[Ported MOD][HOW-TO] Imaged Battery for 4.4.2 KitKat I9505/I9500 Odex/Deodexed

Search This thread

iepurasu_poznas

Senior Member
Mar 7, 2012
241
44
Paris
This guide is not for a noob in editing.
Tried yourself, first you need to understand relation between public values in smali and xml.

I'm not creator of this mod, i have only ported over s4 from note 3 forum!
This mod was created by @parkhyb here
Big thanks to him
Also thanks to @OlliG for The Battery Icon Creator

Modified SystemUI for I9505XXUFNC9 is at post #2 (Flashable)

View attachment 2742163 Screenshot_2.jpg




This guide requires following things:
• APKtool
• Notepad++
• deodexed SystemUI.apk
• drawables.zip (attachment)
• smali.zip (attachment)


1. Decompile SystemUI.apk using APKtool


2. Choose a icon pack and extract two folders in drawables_xxxx_xxx.zip


3. Move and overwrite two folders(drawable, drawable-xxhdpi) to SystemUI\res\


4. Open SystemUI\res\layout\status_bar.xml in Notepad++

Find @id/battery

Code:
 <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
        <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
        <TextView android:textSize="@dimen/status_bar_battery_text_size" android:textColor="#ffffffff" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" android:layout_marginStart="@dimen/status_bar_battery_text_marginStart" />
       [COLOR="Red"] <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" />[/COLOR]
    </LinearLayout>
  ...

change like this

Code:
 <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
        <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
        <TextView android:textSize="@dimen/status_bar_battery_text_size" android:textColor="#ffffffff" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" android:layout_marginStart="@dimen/status_bar_battery_text_marginStart" />
        [COLOR="Blue"]<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="1.0dip" android:layout_marginStart="2.0dip" />[/COLOR]
    </LinearLayout>
  ...

Now recompile SystemUI to create public ids for the new resurces

Decompil the new SystemUI.apk and navigate to:

res/values and open public.xml with notepad++

Now extract BatteryController.smali in smali.zip and open with notepad++

We must match the IDs from BatteryController.smali wit IDs from public.xml

Find in BatteryController.smali

Code:
    .line 46
    const v1, [COLOR="Red"]0x7f02028b[/COLOR]

and replace id with one from public.xml :

Code:
<public type="drawable" name="tw_stat_sys_battery" id="[COLOR="Blue"]0x7f02028b[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 47
    const v1, [COLOR="Red"]0x7f0202f4[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_charge" id="[COLOR="Blue"]0x7f0202f4[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 67
    const v1, [COLOR="Red"]0x7f02036f[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_red" id="[COLOR="Blue"]0x7f02036f[/COLOR]" />



Find in BatteryController.smali

Code:
    .line 149
    const v9, [COLOR="Red"]0x7f02026b[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_6_level_signal_0" id="[COLOR="Blue"]0x7f02026b[/COLOR]" />





Find in BatteryController.smali

Code:
    .line 160
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;

    const v16, [COLOR="Red"]0x7f0a008d[/COLOR]

    const/16 v17, 0x1

and replace id with one from public.xml :

Code:
    <public type="string" name="accessibility_battery_level" id="[COLOR="Blue"]0x7f0a008d[/COLOR]" />





Find in BatteryController.smali

Code:
    .line 103
    const v9, [COLOR="Red"]0x7f020370[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 117
    :cond_5
    const v9, [COLOR="Red"]0x7f020370[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 126
    :cond_8
    const v9, [COLOR="Red"]0x7f020370[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 166
    .local v14, v:Landroid/widget/TextView;
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;

    const v16, [COLOR="Red"]0x7f0a0027[/COLOR]

    const/16 v17, 0x1

and replace id with one from public.xml :

Code:
    <public type="string" name="status_bar_settings_battery_meter_format" id="[COLOR="Blue"]0x7f0a0027[/COLOR]" />


Now save BatteryController.smali and move and overwrite BatteryController.smali to SystemUI\smali\com\android\systemui\statusbar\policy\


Open SystemUI\smali\com\android\systemui\statusbar\policy\BatteryController$BatteryStateChangeCallback.smali in Notepad++

Code:
# virtual methods
[COLOR="Red"].method public abstract onBatteryLevelChanged(IZ)V[/COLOR]
.end method

change like this

Code:
# virtual methods
[COLOR="Blue"].method public abstract onBatteryLevelChanged(IZI)V[/COLOR]
.end method



Open SystemUI\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali in Notepad++

Find Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController

Code:
 iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

    .line 727
    new-instance v25, Lcom/android/systemui/statusbar/policy/SmartBondingController;

    move-object/from16 v0, p0
  ...

add like this

Code:
    iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

[COLOR="Blue"]    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

    move-object/from16 v26, v0

    move-object/from16 v0, p0

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

    move-object/from16 v25, v0

    const v27, 0x7f070077

    move-object/from16 v0, v25

    move/from16 v1, v27

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

    move-result-object v25

    check-cast v25, Landroid/widget/ImageView;

    move-object/from16 v0, v26

    move-object/from16 v1, v25

    invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/policy/BatteryController;->addIconView(Landroid/widget/ImageView;)V[/COLOR]

    .line 727
    new-instance v25, Lcom/android/systemui/statusbar/policy/SmartBondingController;

    move-object/from16 v0, p0
  ...

0x7f070078 is a public id value of :

Code:
    <public type="id" name="battery" id="0x7f070078" />


Find iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText

Code:
 iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;

    .line 731
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
  ...

add like this

Code:
    iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;

   [COLOR="Blue"] move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

    move-object/from16 v25, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;

    move-object/from16 v26, v0

    invoke-virtual/range {v25 .. v26}, Lcom/android/systemui/statusbar/policy/BatteryController;->addLabelView(Landroid/widget/TextView;)V[/COLOR]

    .line 731
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
  ...

Editing's all done.
Recompile and put in your S4.

Now we have the battery of JB 4.3

This means you can change battery images,
and make all of 1% batteries as you want!

Sorry my bad english, i am not good in speaking english!


Blue_percentaje.png
View attachment Drawables_blue_percentaje.zip


Cayn_percentaje.png
View attachment Drawables_cayn_percentaje.zip


Green_percentaje.png
View attachment Drawables_green_percentaje.zip


Green_without_percentaje.png
View attachment Drawables_green_without_percentaje.zip


White_percentaje.png
View attachment Drawables_white_percentaje.zip
 

Attachments

  • smali.zip
    2.8 KB · Views: 699
Last edited:

Droidcore

Senior Member
Feb 19, 2013
1,285
491
Yogyakarta - Indonesia
This guide is not for a noob in editing.
Tried yourself, first you need to understand relation between public values in smali and xml.

I'm not creator of this mod, i have only ported over s4 from note 3 forum!
This mod was created by @parkhyb here
Big thanks to him

Modified SystemUI for I9505XXUFNC9 is at post #2 (Flashable)

View attachment 2738280
View attachment 2738281

This guide requires following things:
• APKtool
• Notepad++
• deodexed SystemUI.apk
• drawables.zip (attachment)
• smali.zip (attachment)


1. Decompile SystemUI.apk using APKtool


2. Extract two folders in drawables.zip


3. Move and overwrite two folders(drawable, drawable-xxhdpi) to SystemUI\res\


4. Open SystemUI\res\layout\status_bar.xml in Notepad++

Find @id/battery

Code:
 <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
        <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
        <TextView android:textSize="@dimen/status_bar_battery_text_size" android:textColor="#ffffffff" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" android:layout_marginStart="@dimen/status_bar_battery_text_marginStart" />
       [COLOR="Red"] <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" />[/COLOR]
    </LinearLayout>
  ...

change like this

Code:
 <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
        <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
        <TextView android:textSize="@dimen/status_bar_battery_text_size" android:textColor="#ffffffff" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" android:layout_marginStart="@dimen/status_bar_battery_text_marginStart" />
        [COLOR="Blue"]<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="1.0dip" android:layout_marginStart="2.0dip" />[/COLOR]
    </LinearLayout>
  ...

Now recompile SystemUI to create public ids for the new resurces

Decompil the new SystemUI.apk and navigate to:

res/values and open public.xml with notepad++

Now extract BatteryController.smali in smali.zip and open with notepad++

We must match the IDs from BatteryController.smali wit IDs from public.xml

Find in BatteryController.smali

Code:
    .line 46
    const v1, [COLOR="Red"]0x7f02028b[/COLOR]

and replace id with one from public.xml :

Code:
<public type="drawable" name="tw_stat_sys_battery" id="[COLOR="Blue"]0x7f02028b[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 47
    const v1, [COLOR="Red"]0x7f0202f4[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_charge" id="[COLOR="Blue"]0x7f0202f4[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 67
    const v1, [COLOR="Red"]0x7f02036f[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_red" id="[COLOR="Blue"]0x7f02036f[/COLOR]" />



Find in BatteryController.smali

Code:
    .line 149
    const v9, [COLOR="Red"]0x7f02026b[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_6_level_signal_0" id="[COLOR="Blue"]0x7f02026b[/COLOR]" />





Find in BatteryController.smali

Code:
    .line 160
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;

    const v16, [COLOR="Red"]0x7f0a008d[/COLOR]

    const/16 v17, 0x1

and replace id with one from public.xml :

Code:
    <public type="string" name="accessibility_battery_level" id="[COLOR="Blue"]0x7f0a008d[/COLOR]" />





Find in BatteryController.smali

Code:
    .line 103
    const v9, [COLOR="Red"]0x7f020370[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 117
    :cond_5
    const v9, [COLOR="Red"]0x7f020370[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 126
    :cond_8
    const v9, [COLOR="Red"]0x7f020370[/COLOR]

and replace id with one from public.xml :

Code:
    <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




Find in BatteryController.smali

Code:
    .line 166
    .local v14, v:Landroid/widget/TextView;
    move-object/from16 v0, p0

    iget-object v15, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;

    const v16, [COLOR="Red"]0x7f0a0027[/COLOR]

    const/16 v17, 0x1

and replace id with one from public.xml :

Code:
    <public type="string" name="status_bar_settings_battery_meter_format" id="[COLOR="Blue"]0x7f0a0027[/COLOR]" />


Now save BatteryController.smali and move and overwrite BatteryController.smali to SystemUI\smali\com\android\systemui\statusbar\policy\


Open SystemUI\smali\com\android\systemui\statusbar\policy\BatteryController$BatteryStateChangeCallback.smali in Notepad++

Code:
# virtual methods
[COLOR="Red"].method public abstract onBatteryLevelChanged(IZ)V[/COLOR]
.end method

change like this

Code:
# virtual methods
[COLOR="Blue"].method public abstract onBatteryLevelChanged(IZI)V[/COLOR]
.end method



Open SystemUI\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali in Notepad++

Find Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController

Code:
 iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

    .line 727
    new-instance v25, Lcom/android/systemui/statusbar/policy/SmartBondingController;

    move-object/from16 v0, p0
  ...

add like this

Code:
    iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

[COLOR="Blue"]    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

    move-object/from16 v26, v0

    move-object/from16 v0, p0

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

    move-object/from16 v25, v0

    const v27, 0x7f070077

    move-object/from16 v0, v25

    move/from16 v1, v27

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

    move-result-object v25

    check-cast v25, Landroid/widget/ImageView;

    move-object/from16 v0, v26

    move-object/from16 v1, v25

    invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/policy/BatteryController;->addIconView(Landroid/widget/ImageView;)V[/COLOR]

    .line 727
    new-instance v25, Lcom/android/systemui/statusbar/policy/SmartBondingController;

    move-object/from16 v0, p0
  ...

0x7f070078 is a public id value of :

Code:
    <public type="id" name="battery" id="0x7f070078" />


Find iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText

Code:
 iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;

    .line 731
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
  ...

add like this

Code:
    iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;

   [COLOR="Blue"] move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;

    move-object/from16 v25, v0

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;

    move-object/from16 v26, v0

    invoke-virtual/range {v25 .. v26}, Lcom/android/systemui/statusbar/policy/BatteryController;->addLabelView(Landroid/widget/TextView;)V[/COLOR]

    .line 731
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
  ...

Editing's all done.
Recompile and put in your Note.

Now we have the battery of JB 4.3

This means you can change battery images,
and make all of 1% batteries as you want!

Sorry my bad english, i am not good in speaking english!

Can you make NC1 I9500 too? :)
 

iepurasu_poznas

Senior Member
Mar 7, 2012
241
44
Paris
I will try but I'm cannot promise nothing. Upload your tw framework.apk.

Also can you provide me all this files unmodified to!?

Trimis de pe al meu GT-I9505 folosind Tapatalk
 
  • Like
Reactions: Droidcore

iepurasu_poznas

Senior Member
Mar 7, 2012
241
44
Paris
No problem. However i cannot mod until tonight the files because i am to work now.

Trimis de pe al meu GT-I9505 folosind Tapatalk
 

Droidcore

Senior Member
Feb 19, 2013
1,285
491
Yogyakarta - Indonesia
Last edited:

iepurasu_poznas

Senior Member
Mar 7, 2012
241
44
Paris
Your base rom it's always xxufnc9!? I use exactly same systemui.apk and all works great.

Trimis de pe al meu GT-I9505 folosind Tapatalk
 

iepurasu_poznas

Senior Member
Mar 7, 2012
241
44
Paris
Should work. Download and flash again and after flash wipe cache and dalvik cache.

Trimis de pe al meu GT-I9505 folosind Tapatalk
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    This guide is not for a noob in editing.
    Tried yourself, first you need to understand relation between public values in smali and xml.

    I'm not creator of this mod, i have only ported over s4 from note 3 forum!
    This mod was created by @parkhyb here
    Big thanks to him
    Also thanks to @OlliG for The Battery Icon Creator

    Modified SystemUI for I9505XXUFNC9 is at post #2 (Flashable)

    View attachment 2742163 Screenshot_2.jpg




    This guide requires following things:
    • APKtool
    • Notepad++
    • deodexed SystemUI.apk
    • drawables.zip (attachment)
    • smali.zip (attachment)


    1. Decompile SystemUI.apk using APKtool


    2. Choose a icon pack and extract two folders in drawables_xxxx_xxx.zip


    3. Move and overwrite two folders(drawable, drawable-xxhdpi) to SystemUI\res\


    4. Open SystemUI\res\layout\status_bar.xml in Notepad++

    Find @id/battery

    Code:
     <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
            <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
            <TextView android:textSize="@dimen/status_bar_battery_text_size" android:textColor="#ffffffff" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" android:layout_marginStart="@dimen/status_bar_battery_text_marginStart" />
           [COLOR="Red"] <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" />[/COLOR]
        </LinearLayout>
      ...

    change like this

    Code:
     <LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:layout_width="wrap_content" android:layout_height="fill_parent" android:paddingStart="2.0dip">
            <include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/signal_cluster_view" />
            <TextView android:textSize="@dimen/status_bar_battery_text_size" android:textColor="#ffffffff" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" android:layout_marginStart="@dimen/status_bar_battery_text_marginStart" />
            [COLOR="Blue"]<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="1.0dip" android:layout_marginStart="2.0dip" />[/COLOR]
        </LinearLayout>
      ...

    Now recompile SystemUI to create public ids for the new resurces

    Decompil the new SystemUI.apk and navigate to:

    res/values and open public.xml with notepad++

    Now extract BatteryController.smali in smali.zip and open with notepad++

    We must match the IDs from BatteryController.smali wit IDs from public.xml

    Find in BatteryController.smali

    Code:
        .line 46
        const v1, [COLOR="Red"]0x7f02028b[/COLOR]

    and replace id with one from public.xml :

    Code:
    <public type="drawable" name="tw_stat_sys_battery" id="[COLOR="Blue"]0x7f02028b[/COLOR]" />




    Find in BatteryController.smali

    Code:
        .line 47
        const v1, [COLOR="Red"]0x7f0202f4[/COLOR]

    and replace id with one from public.xml :

    Code:
        <public type="drawable" name="tw_stat_sys_battery_charge" id="[COLOR="Blue"]0x7f0202f4[/COLOR]" />




    Find in BatteryController.smali

    Code:
        .line 67
        const v1, [COLOR="Red"]0x7f02036f[/COLOR]

    and replace id with one from public.xml :

    Code:
        <public type="drawable" name="tw_stat_sys_battery_red" id="[COLOR="Blue"]0x7f02036f[/COLOR]" />



    Find in BatteryController.smali

    Code:
        .line 149
        const v9, [COLOR="Red"]0x7f02026b[/COLOR]

    and replace id with one from public.xml :

    Code:
        <public type="drawable" name="tw_stat_sys_6_level_signal_0" id="[COLOR="Blue"]0x7f02026b[/COLOR]" />





    Find in BatteryController.smali

    Code:
        .line 160
        move-object/from16 v0, p0
    
        iget-object v15, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
    
        const v16, [COLOR="Red"]0x7f0a008d[/COLOR]
    
        const/16 v17, 0x1

    and replace id with one from public.xml :

    Code:
        <public type="string" name="accessibility_battery_level" id="[COLOR="Blue"]0x7f0a008d[/COLOR]" />





    Find in BatteryController.smali

    Code:
        .line 103
        const v9, [COLOR="Red"]0x7f020370[/COLOR]

    and replace id with one from public.xml :

    Code:
        <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




    Find in BatteryController.smali

    Code:
        .line 117
        :cond_5
        const v9, [COLOR="Red"]0x7f020370[/COLOR]

    and replace id with one from public.xml :

    Code:
        <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




    Find in BatteryController.smali

    Code:
        .line 126
        :cond_8
        const v9, [COLOR="Red"]0x7f020370[/COLOR]

    and replace id with one from public.xml :

    Code:
        <public type="drawable" name="tw_stat_sys_battery_usb_not_charge" id="[COLOR="Blue"]0x7f020370[/COLOR]" />




    Find in BatteryController.smali

    Code:
        .line 166
        .local v14, v:Landroid/widget/TextView;
        move-object/from16 v0, p0
    
        iget-object v15, v0, Lcom/android/systemui/statusbar/policy/BatteryController;->mContext:Landroid/content/Context;
    
        const v16, [COLOR="Red"]0x7f0a0027[/COLOR]
    
        const/16 v17, 0x1

    and replace id with one from public.xml :

    Code:
        <public type="string" name="status_bar_settings_battery_meter_format" id="[COLOR="Blue"]0x7f0a0027[/COLOR]" />


    Now save BatteryController.smali and move and overwrite BatteryController.smali to SystemUI\smali\com\android\systemui\statusbar\policy\


    Open SystemUI\smali\com\android\systemui\statusbar\policy\BatteryController$BatteryStateChangeCallback.smali in Notepad++

    Code:
    # virtual methods
    [COLOR="Red"].method public abstract onBatteryLevelChanged(IZ)V[/COLOR]
    .end method

    change like this

    Code:
    # virtual methods
    [COLOR="Blue"].method public abstract onBatteryLevelChanged(IZI)V[/COLOR]
    .end method



    Open SystemUI\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali in Notepad++

    Find Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController

    Code:
     iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
    
        .line 727
        new-instance v25, Lcom/android/systemui/statusbar/policy/SmartBondingController;
    
        move-object/from16 v0, p0
      ...

    add like this

    Code:
        iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
    
    [COLOR="Blue"]    move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
    
        move-object/from16 v26, v0
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        move-object/from16 v25, v0
    
        const v27, 0x7f070077
    
        move-object/from16 v0, v25
    
        move/from16 v1, v27
    
        invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
    
        move-result-object v25
    
        check-cast v25, Landroid/widget/ImageView;
    
        move-object/from16 v0, v26
    
        move-object/from16 v1, v25
    
        invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/policy/BatteryController;->addIconView(Landroid/widget/ImageView;)V[/COLOR]
    
        .line 727
        new-instance v25, Lcom/android/systemui/statusbar/policy/SmartBondingController;
    
        move-object/from16 v0, p0
      ...

    0x7f070078 is a public id value of :

    Code:
        <public type="id" name="battery" id="0x7f070078" />


    Find iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText

    Code:
     iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;
    
        .line 731
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
      ...

    add like this

    Code:
        iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;
    
       [COLOR="Blue"] move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
    
        move-object/from16 v25, v0
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;
    
        move-object/from16 v26, v0
    
        invoke-virtual/range {v25 .. v26}, Lcom/android/systemui/statusbar/policy/BatteryController;->addLabelView(Landroid/widget/TextView;)V[/COLOR]
    
        .line 731
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
      ...

    Editing's all done.
    Recompile and put in your S4.

    Now we have the battery of JB 4.3

    This means you can change battery images,
    and make all of 1% batteries as you want!

    Sorry my bad english, i am not good in speaking english!


    Blue_percentaje.png
    View attachment Drawables_blue_percentaje.zip


    Cayn_percentaje.png
    View attachment Drawables_cayn_percentaje.zip


    Green_percentaje.png
    View attachment Drawables_green_percentaje.zip


    Green_without_percentaje.png
    View attachment Drawables_green_without_percentaje.zip


    White_percentaje.png
    View attachment Drawables_white_percentaje.zip
    7
    All flashable zip should work on both roms odex/deodexed

    Modded SystemUI.apk for S4 GT-I9505 Snapdragon version

    I9505XXUFNC9_Battery_Installer.zip

    I9505XXUFNC5_Battery_Installer.zip

    I9505VJUFNC2_Battery_Installer.zip




    Modded SystemUI.apk for S4 GT-I9500 Exynos version

    I9500XXUFNC1_Battery_Installer.zip
    2
    thanks for sharing, quiet a big tutorial for noobs like me.
    2
    Thanks alot for your help and concern.... By the way where're u from???

    Sent from my GT-I9500 using Tapatalk 4 - Hassan K. Malik

    Im just a normal British slob trying to help where i can but its a lot of edits with ghareeb in your SystemUI its not that easy to add this mod :)

    Sent from my GT-I9500 using Tapatalk 2
    1
    Iknow where you are from: You are from "SpicyNoodleLand" :p

    Only in my dreams m8 :) i did have a look around this morning and found this thread http://xdaforums.com/showthread.php?t=2730108

    May help to undo the changes made in PhoneStatusBar.smali and remove and replace lines added for OG battery mod

    Sent from my GT-I9500 using Tapatalk 2