MOD][GUIDE] Stand Alone Battery Bar With Options

syaeful

Senior Member
Jul 31, 2013
130
87
0
Purbalingga
Original Guide is made by Didact74 here :

[MOD][GUIDE] Stand Alone Battery Bar w/Options and color picker


All credit to him and Kryten2k35 for some smali method



This guide allows you to add the battery bar to your ROM with out any Add-On APKs

Ok, let's go to guide!!!

We will be working with two files:
SystemUI.apk
SecSettings.apk

Note : Blue=add

PART I, Secsettings.apk


navigate to res/xml/display_settings.xml
Code:
[COLOR="Blue"]<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
		<ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
		<ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
		<ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
		<CheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
	</PreferenceCategory>[/COLOR]
	<PreferenceCategory android:title="@string/more_settings" android:key="more_settings" />[/HIDE]
Navigate to res/values/arrays
Code:
[COLOR="Blue"]<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>[/COLOR]
</resources>
Navigate to res/values/strings
Code:
[COLOR="Blue"]<string name="battery_bar_setting">Battery Bar Setting</string>
	<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>[/COLOR]
</resources>
Navigate to com/android/setting/DisplaySettings.smali
Code:
.field private mAnimationView:Landroid/widget/ImageView;

.field private mAutoLockmode:Landroid/preference/CheckBoxPreference;

[COLOR="Blue"].field mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;
	
.field mBatteryBarList:Landroid/preference/ListPreference;

.field mBatteryBarStyle:Landroid/preference/ListPreference;

.field mBatteryBarThickness:Landroid/preference/ListPreference;[/COLOR]
go to : .method private updateState()V
Code:
const-string v4, "button_key_light"

    const/16 v5, 0x5dc

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	[COLOR="Blue"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_style"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_thickness"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V[/COLOR]

    .line 883
    iget-boolean v0, p0, Lcom/android/settings/DisplaySettings;->mSupportFolderType:Z

    if-eqz v0, :cond_0

    .line 884
    invoke-direct {p0}, Lcom/android/settings/DisplaySettings;->updateAccelerometerRotationSecondCheckbox()V

    .line 885
    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mAutoLockmode:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v4, "sub_lcd_auto_lock"
go to : .method public onCreate(Landroid/os/Bundle;)V
Code:
const-string v10, "font_size"

    invoke-virtual {p0, v10}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/ListPreference;

    iput-object v10, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;

    .line 428
    iget-object v10, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;

    invoke-virtual {v10, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
	
	[COLOR="Blue"]const-string v11, "battery_bar"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v11, "battery_bar_style"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v11, "battery_bar_thickness"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
    
    .line 430
    const-string v10, "display_battery_level"
still same method :
Code:
.line 553
    const-string v10, "key_multi_window"

    invoke-virtual {p0, v10}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/CheckBoxPreference;

    iput-object v10, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
	
	[COLOR="Blue"]const-string v11, "battery_bar_animate"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/CheckBoxPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;[/COLOR]

    .line 554
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v10

    const-string v11, "com.sec.feature.multiwindow.phone"
go to : .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
Code:
.line 1071
    const-string v1, "DisplaySettings"

    const-string v2, "could not persist Touch key light setting"

    invoke-static {v1, v2, v0}, Landroid/util/secutil/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto/16 :goto_4

    .line 1073
    :cond_a
	[COLOR="Blue"]const-string v2, "battery_bar_style"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_barstyle

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar_style"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_barstyle
    const-string v2, "battery_bar"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_style

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_style
    const-string v2, "battery_bar_thickness"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_tickness

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar_thickness"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_tickness[/COLOR]
    const-string v2, "quick_launch"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2
go to : .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
BEFORE :
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [COLOR="DarkOrange"]:cond_0[/COLOR]

    .line 990
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 991
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_16

    :goto_a
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [COLOR="Yellow"]:goto_1[/COLOR]

    :cond_16
    move v1, v2

    goto :goto_a
.end method
AFTER :
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [COLOR="Blue"]:cond_batteryAnimate[/COLOR]  <-- (change from ":cond_0" to new cond below = :cond_batteryAnimate)

    .line 990
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 991
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_16

    :goto_a
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [COLOR="Yellow"]:goto_1[/COLOR]

    :cond_16
    move v1, v2

    goto :goto_a
	
	[COLOR="Blue"]:cond_batteryAnimate
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0,[/COLOR] [COLOR="DarkOrange"]:cond_0[/COLOR]   <-- (this cond is from old cond i'm marked orange)

    [COLOR="Blue"].line 1022
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 1023
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_animate"

    if-eqz v0, :cond_battAnim

    :goto_anM
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16[/COLOR] [COLOR="Yellow"]:goto_1[/COLOR]     <--- (this cond is from cond above i'm marked yellow)

   [COLOR="Blue"] :cond_battAnim
    move v1, v2

    goto :goto_anM[/COLOR]
.end method
go to : .method public onResume()V
BEFORE :
Code:
.line 821
    :cond_1
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [COLOR="Yellow"]:cond_2[/COLOR]

    .line 822
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_6

    :goto_2
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 823
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    .line 825
    :cond_2
    return-void

    :cond_3
    move v0, v2
AFTER :
Code:
.line 821
    :cond_1
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [COLOR="Blue"]:cond_newAnim[/COLOR]

    .line 822
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_6

    :goto_2
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 823
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
	
	[COLOR="Blue"]:cond_newAnim
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    if-eqz v0,[/COLOR][COLOR="Yellow"] :cond_2[/COLOR]
	
    [COLOR="Blue"].line 3001
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_animate"

    const/4 v1, 0x0

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-eqz v3, :cond_noShow

    const/4 v1, 0x1

    goto :goto_yesShow

    :cond_noShow
    const/4 v1, 0x0

    :goto_yesShow
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]

    .line 825
    :cond_2
    return-void

    :cond_3
    move v0, v2


PART II, SystemUI.apk

Navigate to res/layout/tw_status_bar.xml
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
	[COLOR="Blue"]<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="1" />[/COLOR]
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to res/values/attrs
Code:
[COLOR="Blue"]<attr name="viewLocation" format="integer" />[/COLOR]
</resources>
Navigate to smali/com/android/systemui/statusbar/policy/Prefs.smali
add this :
Code:
.method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
    .locals 2
    .parameter "context"

    .prologue
    .line 32
    const-string v0, "status_bar"

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    return-object v0
.end method

[COLOR="Blue"].method public static getLastBatteryLevel(Landroid/content/Context;)I
    .locals 3

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "last_battery_level"

    const/16 v2, 0x32

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    return v0
.end method

.method public static getLastFastChargeState(Landroid/content/Context;)Z
    .locals 3

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "last_fcharge_state"

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method

.method public static setLastBatteryLevel(Landroid/content/Context;I)V
    .locals 2

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "last_battery_level"

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    return-void
.end method

.method public static setLastFastChargeState(Landroid/content/Context;Z)V
    .locals 2

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "last_fcharge_state"

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    return-void
.end method[/COLOR]
Find the attached zip file and place all files in smali/com/android/systemui/statusbar/policy
 

Attachments

f120ltn

Member
Jan 23, 2015
33
2
0
for compare.
I attach :
DisplaySettingsBefore.smali <-- Before edit
DisplaySettingsAfter <-- After edit
i rom 4.1.2 LG not the same SS
--------------------------------------------------------------------------
|Mon 20/04/2015 -- 17:00:33.48|
--------------------------------------------------------------------------
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) Client VM (build 25.40-b25, mixed mode)
I: Checking whether sources has changed...
I: Smaling...
[4698,13] Label "goto_4" is not defined.
[4744,13] Label "goto_4" is not defined.
[4750,4] mismatched tree node: I_STATEMENT_FORMAT35c_METHOD expecting I_CATCHES
[4752,4] mismatched tree node: I_STATEMENT_FORMAT11x expecting <UP>
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: D:\GL F120L\VH\APK-Multi-Tool HDKP\other\..\projects\LGSettings3_2_kp41.apk\smali\com\android\settings\DisplaySettings.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
 

syaeful

Senior Member
Jul 31, 2013
130
87
0
Purbalingga
i rom 4.1.2 LG not the same SS
--------------------------------------------------------------------------
|Mon 20/04/2015 -- 17:00:33.48|
--------------------------------------------------------------------------
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) Client VM (build 25.40-b25, mixed mode)
I: Checking whether sources has changed...
I: Smaling...
[4698,13] Label "goto_4" is not defined.
[4744,13] Label "goto_4" is not defined.
[4750,4] mismatched tree node: I_STATEMENT_FORMAT35c_METHOD expecting I_CATCHES
[4752,4] mismatched tree node: I_STATEMENT_FORMAT11x expecting <UP>
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: D:\GL F120L\VH\APK-Multi-Tool HDKP\other\..\projects\LGSettings3_2_kp41.apk\smali\com\android\settings\DisplaySettings.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
ok sir, You can't just copy and paste from guide, you must do compare, because every rom has different condition,
For more easy, follow my guide :
PART I, Secsettings.apk
Download attachment file and merged to your decompiled Settings.apk
navigate to res/xml/display_settings.xml
Code:
[COLOR="Blue"]<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_values" />
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_style_values" />
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_thickness_values" />
        <com.android.settings.syaeful.SystemSettingCheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
    </PreferenceCategory>[/COLOR]
</PreferenceScreen>
Navigate to res/values/arrays.xml
Code:
[COLOR="Blue"]<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>[/COLOR]
</resources>
Navigate to res/values/strings.xml
Code:
[COLOR="Blue"]<string name="battery_bar_setting">Battery Bar Setting</string>
	<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>[/COLOR]
</resources>
finish for part setting.. recompile, sign, push to your system.. check in Display menu. it should not fc.

Note : if you follow this guide for part settings.. skip edit samli DisplaySettings.smali!!!!
 

Attachments

  • Like
Reactions: f120ltn

f120ltn

Member
Jan 23, 2015
33
2
0
ok sir, You can't just copy and paste from guide, you must do compare, because every rom has different condition,
For more easy, follow my guide :
PART I, Secsettings.apk
Download attachment file and merged to your decompiled Settings.apk
navigate to res/xml/display_settings.xml
Code:
[COLOR="Blue"]<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_values" />
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_style_values" />
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_thickness_values" />
        <com.android.settings.syaeful.SystemSettingCheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
    </PreferenceCategory>[/COLOR]
</PreferenceScreen>
Navigate to res/values/arrays.xml
Code:
[COLOR="Blue"]<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>[/COLOR]
</resources>
Navigate to res/values/strings.xml
Code:
[COLOR="Blue"]<string name="battery_bar_setting">Battery Bar Setting</string>
	<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>[/COLOR]
</resources>
finish for part setting.. recompile, sign, push to your system.. check in Display menu. it should not fc.

Note : if you follow this guide for part settings.. skip edit samli DisplaySettings.smali!!!!
Thankyou
i work "ok" on file .xml. not edit DisplaySettings.smali
 

Attachments

Last edited:

f120ltn

Member
Jan 23, 2015
33
2
0
ok sir, You can't just copy and paste from guide, you must do compare, because every rom has different condition,
For more easy, follow my guide :
PART I, Secsettings.apk
Download attachment file and merged to your decompiled Settings.apk
navigate to res/xml/display_settings.xml
Code:
[COLOR="Blue"]<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_values" />
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_style_values" />
        <com.android.settings.syaeful.SystemSettingListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/battery_bar_thickness_values" />
        <com.android.settings.syaeful.SystemSettingCheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
    </PreferenceCategory>[/COLOR]
</PreferenceScreen>
Navigate to res/values/arrays.xml
Code:
[COLOR="Blue"]<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>[/COLOR]
</resources>
Navigate to res/values/strings.xml
Code:
[COLOR="Blue"]<string name="battery_bar_setting">Battery Bar Setting</string>
	<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>[/COLOR]
</resources>
finish for part setting.. recompile, sign, push to your system.. check in Display menu. it should not fc.

Note : if you follow this guide for part settings.. skip edit samli DisplaySettings.smali!!!!
Yes. Should work. Regards. ;)
style Bar color not work.
 

syaeful

Senior Member
Jul 31, 2013
130
87
0
Purbalingga
Thankyou.
i adder "colorpicker" in rom.
ok it for later.
Please correct me pictures attached. the red circle. after exit and then re-enter the same
it should not affected from DisplaySettings.smali sir... maybe from SystemSettingCheckBoxPreference.smali and SystemSettingListPreference.smali. i will check again. but for show/hide battery bar is normal or not?

Sorry for late response
 
  • Like
Reactions: f120ltn

f120ltn

Member
Jan 23, 2015
33
2
0
it should not affected from DisplaySettings.smali sir... maybe from SystemSettingCheckBoxPreference.smali and SystemSettingListPreference.smali. i will check again. but for show/hide battery bar is normal or not?

Sorry for late response
ok, so the correct answer.
Please help me mod in DisplaySettings.smali sir...
 

syaeful

Senior Member
Jul 31, 2013
130
87
0
Purbalingga
ok, so the correct answer.
Please help me mod in DisplaySettings.smali sir...
try with smali in the attachment that I have modified.
and just use smali SystemSettingCheckBoxPreference.smali for battery bar animate
so you must fill this in res/xml/display_settings.xml
Code:
<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
        <ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
		<ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
		<ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
        <com.android.settings.syaeful.SystemSettingCheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
    </PreferenceCategory>
 

Attachments

  • Like
Reactions: f120ltn

f120ltn

Member
Jan 23, 2015
33
2
0
try with smali in the attachment that I have modified.
and just use smali SystemSettingCheckBoxPreference.smali for battery bar animate
so you must fill this in res/xml/display_settings.xml
Code:
<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
        <ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
		<ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
		<ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
        <com.android.settings.syaeful.SystemSettingCheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
    </PreferenceCategory>
ok sir...
i try with smali in the attachment.
I hope it will run
thank you
PL: i sorry. i try but not run
(V11? My in rom V8)
 
Last edited:
  • Like
Reactions: syaeful

Rekjezt™

Senior Member
Sep 15, 2013
97
52
48
purwokerto
kitul

Original Guide is made by Didact74 here :

[MOD][GUIDE] Stand Alone Battery Bar w/Options and color picker


All credit to him and Kryten2k35 for some smali method



This guide allows you to add the battery bar to your ROM with out any Add-On APKs

Ok, let's go to guide!!!

We will be working with two files:
SystemUI.apk
SecSettings.apk

Note : Blue=add

PART I, Secsettings.apk


navigate to res/xml/display_settings.xml
Code:
[COLOR="Blue"]<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
		<ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
		<ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
		<ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
		<CheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
	</PreferenceCategory>[/COLOR]
	<PreferenceCategory android:title="@string/more_settings" android:key="more_settings" />[/HIDE]
Navigate to res/values/arrays
Code:
[COLOR="Blue"]<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>[/COLOR]
</resources>
Navigate to res/values/strings
Code:
[COLOR="Blue"]<string name="battery_bar_setting">Battery Bar Setting</string>
	<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>[/COLOR]
</resources>
Navigate to com/android/setting/DisplaySettings.smali
Code:
.field private mAnimationView:Landroid/widget/ImageView;

.field private mAutoLockmode:Landroid/preference/CheckBoxPreference;

[COLOR="Blue"].field mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;
	
.field mBatteryBarList:Landroid/preference/ListPreference;

.field mBatteryBarStyle:Landroid/preference/ListPreference;

.field mBatteryBarThickness:Landroid/preference/ListPreference;[/COLOR]
go to : .method private updateState()V
Code:
const-string v4, "button_key_light"

    const/16 v5, 0x5dc

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	[COLOR="Blue"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_style"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_thickness"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V[/COLOR]

    .line 883
    iget-boolean v0, p0, Lcom/android/settings/DisplaySettings;->mSupportFolderType:Z

    if-eqz v0, :cond_0

    .line 884
    invoke-direct {p0}, Lcom/android/settings/DisplaySettings;->updateAccelerometerRotationSecondCheckbox()V

    .line 885
    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mAutoLockmode:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v4, "sub_lcd_auto_lock"
go to : .method public onCreate(Landroid/os/Bundle;)V
Code:
const-string v10, "font_size"

    invoke-virtual {p0, v10}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/ListPreference;

    iput-object v10, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;

    .line 428
    iget-object v10, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;

    invoke-virtual {v10, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
	
	[COLOR="Blue"]const-string v11, "battery_bar"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v11, "battery_bar_style"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v11, "battery_bar_thickness"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
    
    .line 430
    const-string v10, "display_battery_level"
still same method :
Code:
.line 553
    const-string v10, "key_multi_window"

    invoke-virtual {p0, v10}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/CheckBoxPreference;

    iput-object v10, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
	
	[COLOR="Blue"]const-string v11, "battery_bar_animate"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/CheckBoxPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;[/COLOR]

    .line 554
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v10

    const-string v11, "com.sec.feature.multiwindow.phone"
go to : .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
Code:
.line 1071
    const-string v1, "DisplaySettings"

    const-string v2, "could not persist Touch key light setting"

    invoke-static {v1, v2, v0}, Landroid/util/secutil/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto/16 :goto_4

    .line 1073
    :cond_a
	[COLOR="Blue"]const-string v2, "battery_bar_style"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_barstyle

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar_style"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_barstyle
    const-string v2, "battery_bar"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_style

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_style
    const-string v2, "battery_bar_thickness"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_tickness

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar_thickness"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_tickness[/COLOR]
    const-string v2, "quick_launch"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2
go to : .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
BEFORE :
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [COLOR="DarkOrange"]:cond_0[/COLOR]

    .line 990
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 991
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_16

    :goto_a
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [COLOR="Yellow"]:goto_1[/COLOR]

    :cond_16
    move v1, v2

    goto :goto_a
.end method
AFTER :
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [COLOR="Blue"]:cond_batteryAnimate[/COLOR]  <-- (change from ":cond_0" to new cond below = :cond_batteryAnimate)

    .line 990
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 991
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_16

    :goto_a
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [COLOR="Yellow"]:goto_1[/COLOR]

    :cond_16
    move v1, v2

    goto :goto_a
	
	[COLOR="Blue"]:cond_batteryAnimate
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0,[/COLOR] [COLOR="DarkOrange"]:cond_0[/COLOR]   <-- (this cond is from old cond i'm marked orange)

    [COLOR="Blue"].line 1022
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 1023
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_animate"

    if-eqz v0, :cond_battAnim

    :goto_anM
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16[/COLOR] [COLOR="Yellow"]:goto_1[/COLOR]     <--- (this cond is from cond above i'm marked yellow)

   [COLOR="Blue"] :cond_battAnim
    move v1, v2

    goto :goto_anM[/COLOR]
.end method
go to : .method public onResume()V
BEFORE :
Code:
.line 821
    :cond_1
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [COLOR="Yellow"]:cond_2[/COLOR]

    .line 822
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_6

    :goto_2
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 823
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    .line 825
    :cond_2
    return-void

    :cond_3
    move v0, v2
AFTER :
Code:
.line 821
    :cond_1
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [COLOR="Blue"]:cond_newAnim[/COLOR]

    .line 822
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_6

    :goto_2
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 823
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
	
	[COLOR="Blue"]:cond_newAnim
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    if-eqz v0,[/COLOR][COLOR="Yellow"] :cond_2[/COLOR]
	
    [COLOR="Blue"].line 3001
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_animate"

    const/4 v1, 0x0

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-eqz v3, :cond_noShow

    const/4 v1, 0x1

    goto :goto_yesShow

    :cond_noShow
    const/4 v1, 0x0

    :goto_yesShow
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]

    .line 825
    :cond_2
    return-void

    :cond_3
    move v0, v2


PART II, SystemUI.apk

Navigate to res/layout/tw_status_bar.xml
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
	[COLOR="Blue"]<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="1" />[/COLOR]
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to res/values/attrs
Code:
[COLOR="Blue"]<attr name="viewLocation" format="integer" />[/COLOR]
</resources>
Navigate to smali/com/android/systemui/statusbar/policy/Prefs.smali
add this :
Code:
.method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
    .locals 2
    .parameter "context"

    .prologue
    .line 32
    const-string v0, "status_bar"

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    return-object v0
.end method

[COLOR="Blue"].method public static getLastBatteryLevel(Landroid/content/Context;)I
    .locals 3

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "last_battery_level"

    const/16 v2, 0x32

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    return v0
.end method

.method public static getLastFastChargeState(Landroid/content/Context;)Z
    .locals 3

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "last_fcharge_state"

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method

.method public static setLastBatteryLevel(Landroid/content/Context;I)V
    .locals 2

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "last_battery_level"

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    return-void
.end method

.method public static setLastFastChargeState(Landroid/content/Context;Z)V
    .locals 2

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "last_fcharge_state"

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    return-void
.end method[/COLOR]
Find the attached zip file and place all files in smali/com/android/systemui/statusbar/policy


Nice and keep kitul epriwer
 

f120ltn

Member
Jan 23, 2015
33
2
0
Original Guide is made by Didact74 here :

[MOD][GUIDE] Stand Alone Battery Bar w/Options and color picker


All credit to him and Kryten2k35 for some smali method



This guide allows you to add the battery bar to your ROM with out any Add-On APKs

Ok, let's go to guide!!!

We will be working with two files:
SystemUI.apk
SecSettings.apk

Note : Blue=add

PART I, Secsettings.apk


navigate to res/xml/display_settings.xml
Code:
[COLOR="Blue"]<PreferenceCategory android:title="@string/battery_bar_setting" android:key="battery_icon_category">
		<ListPreference android:entries="@array/battery_bar_entries" android:title="@string/battery_bar" android:key="battery_bar" android:entryValues="@array/battery_bar_values" />
		<ListPreference android:entries="@array/battery_bar_style_entries" android:title="@string/battery_bar_style_title" android:key="battery_bar_style" android:entryValues="@array/battery_bar_style_values" />
		<ListPreference android:entries="@array/battery_bar_thickness_entries" android:title="@string/battery_bar_thickness_title" android:key="battery_bar_thickness" android:entryValues="@array/battery_bar_thickness_values" />
		<CheckBoxPreference android:title="@string/battery_bar_animate_title" android:key="battery_bar_animate" android:summary="@string/battery_bar_animate_summary" />
	</PreferenceCategory>[/COLOR]
	<PreferenceCategory android:title="@string/more_settings" android:key="more_settings" />[/HIDE]
Navigate to res/values/arrays
Code:
[COLOR="Blue"]<string-array name="battery_bar_entries">
        <item>Hide</item>
        <item>Show</item>
        </string-array>
    <string-array name="battery_bar_values">
        <item>0</item>
        <item>1</item>
        </string-array>
    <string-array name="battery_bar_style_entries">
        <item>Regular</item>
        <item>Center-mirrored</item>
    </string-array>
    <string-array name="battery_bar_style_values">
        <item>0</item>
        <item>1</item>
    </string-array>
    <string-array name="battery_bar_thickness_entries">
        <item>1 dp</item>
        <item>2 dp</item>
        <item>3 dp</item>
        <item>4 dp</item>
    </string-array>
    <string-array name="battery_bar_thickness_values">
        <item>1</item>
        <item>2</item>
        <item>3</item>
        <item>4</item>
    </string-array>[/COLOR]
</resources>
Navigate to res/values/strings
Code:
[COLOR="Blue"]<string name="battery_bar_setting">Battery Bar Setting</string>
	<string name="battery_bar">Enable battery bar</string>
    <string name="battery_bar_color">Choose battery bar color</string>
    <string name="battery_bar_style_title">Battery bar style</string>
    <string name="battery_bar_thickness_title">Battery Bar Thickness</string>
    <string name="battery_bar_animate_title">Battery Bar Animation</string>
    <string name="battery_bar_animate_summary">Animate bar when charging</string>
    <string name="battery_bar_summary">%s</string>
    <string name="battery_bar_color_summary">Bar color</string>
    <string name="battery_bar_style_title_summary">%s</string>
    <string name="battery_bar_thickness_title_summary">%s</string>[/COLOR]
</resources>
Navigate to com/android/setting/DisplaySettings.smali
Code:
.field private mAnimationView:Landroid/widget/ImageView;

.field private mAutoLockmode:Landroid/preference/CheckBoxPreference;

[COLOR="Blue"].field mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;
	
.field mBatteryBarList:Landroid/preference/ListPreference;

.field mBatteryBarStyle:Landroid/preference/ListPreference;

.field mBatteryBarThickness:Landroid/preference/ListPreference;[/COLOR]
go to : .method private updateState()V
Code:
const-string v4, "button_key_light"

    const/16 v5, 0x5dc

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
	
	[COLOR="Blue"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_style"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_thickness"

    const/16 v5, 0x0

    invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V[/COLOR]

    .line 883
    iget-boolean v0, p0, Lcom/android/settings/DisplaySettings;->mSupportFolderType:Z

    if-eqz v0, :cond_0

    .line 884
    invoke-direct {p0}, Lcom/android/settings/DisplaySettings;->updateAccelerometerRotationSecondCheckbox()V

    .line 885
    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mAutoLockmode:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v4, "sub_lcd_auto_lock"
go to : .method public onCreate(Landroid/os/Bundle;)V
Code:
const-string v10, "font_size"

    invoke-virtual {p0, v10}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/ListPreference;

    iput-object v10, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;

    .line 428
    iget-object v10, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;

    invoke-virtual {v10, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
	
	[COLOR="Blue"]const-string v11, "battery_bar"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v11, "battery_bar_style"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

    const-string v11, "battery_bar_thickness"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/ListPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
    
    .line 430
    const-string v10, "display_battery_level"
still same method :
Code:
.line 553
    const-string v10, "key_multi_window"

    invoke-virtual {p0, v10}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v10

    check-cast v10, Landroid/preference/CheckBoxPreference;

    iput-object v10, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;
	
	[COLOR="Blue"]const-string v11, "battery_bar_animate"

    invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

    move-result-object v11

    check-cast v11, Landroid/preference/CheckBoxPreference;

    iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;[/COLOR]

    .line 554
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v10

    const-string v11, "com.sec.feature.multiwindow.phone"
go to : .method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/Object;)Z
Code:
.line 1071
    const-string v1, "DisplaySettings"

    const-string v2, "could not persist Touch key light setting"

    invoke-static {v1, v2, v0}, Landroid/util/secutil/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto/16 :goto_4

    .line 1073
    :cond_a
	[COLOR="Blue"]const-string v2, "battery_bar_style"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_barstyle

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar_style"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarStyle:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_barstyle
    const-string v2, "battery_bar"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_style

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarList:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_style
    const-string v2, "battery_bar_thickness"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_tickness

    .line 986
    check-cast p2, Ljava/lang/String;

    invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    const-string v2, "battery_bar_thickness"

    invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    .line 989
    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarThickness:Landroid/preference/ListPreference;

    invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V

    goto/16 :goto_4

    .line 993
    :cond_tickness[/COLOR]
    const-string v2, "quick_launch"

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2
go to : .method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z
BEFORE :
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [COLOR="DarkOrange"]:cond_0[/COLOR]

    .line 990
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 991
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_16

    :goto_a
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [COLOR="Yellow"]:goto_1[/COLOR]

    :cond_16
    move v1, v2

    goto :goto_a
.end method
AFTER :
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, [COLOR="Blue"]:cond_batteryAnimate[/COLOR]  <-- (change from ":cond_0" to new cond below = :cond_batteryAnimate)

    .line 990
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 991
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    if-eqz v0, :cond_16

    :goto_a
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16 [COLOR="Yellow"]:goto_1[/COLOR]

    :cond_16
    move v1, v2

    goto :goto_a
	
	[COLOR="Blue"]:cond_batteryAnimate
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p2, v0}, Ljava/lang/Object;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0,[/COLOR] [COLOR="DarkOrange"]:cond_0[/COLOR]   <-- (this cond is from old cond i'm marked orange)

    [COLOR="Blue"].line 1022
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {v0}, Landroid/preference/CheckBoxPreference;->isChecked()Z

    move-result v0

    .line 1023
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_animate"

    if-eqz v0, :cond_battAnim

    :goto_anM
    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

    goto/16[/COLOR] [COLOR="Yellow"]:goto_1[/COLOR]     <--- (this cond is from cond above i'm marked yellow)

   [COLOR="Blue"] :cond_battAnim
    move v1, v2

    goto :goto_anM[/COLOR]
.end method
go to : .method public onResume()V
BEFORE :
Code:
.line 821
    :cond_1
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [COLOR="Yellow"]:cond_2[/COLOR]

    .line 822
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_6

    :goto_2
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 823
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    .line 825
    :cond_2
    return-void

    :cond_3
    move v0, v2
AFTER :
Code:
.line 821
    :cond_1
    sget-boolean v0, Lcom/android/settings/DisplaySettings;->UseMultiWindow:Z

    if-eqz v0, [COLOR="Blue"]:cond_newAnim[/COLOR]

    .line 822
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowPref:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "multi_window_enabled"

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-ne v3, v1, :cond_6

    :goto_2
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

    .line 823
    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "multi_window_enabled"

    invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mMultiWindowModeObserver:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
	
	[COLOR="Blue"]:cond_newAnim
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    if-eqz v0,[/COLOR][COLOR="Yellow"] :cond_2[/COLOR]
	
    [COLOR="Blue"].line 3001
    iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mBatteryBarAnimate:Landroid/preference/CheckBoxPreference;

    invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v3

    const-string v4, "battery_bar_animate"

    const/4 v1, 0x0

    invoke-static {v3, v4, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v3

    if-eqz v3, :cond_noShow

    const/4 v1, 0x1

    goto :goto_yesShow

    :cond_noShow
    const/4 v1, 0x0

    :goto_yesShow
    invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]

    .line 825
    :cond_2
    return-void

    :cond_3
    move v0, v2


PART II, SystemUI.apk

Navigate to res/layout/tw_status_bar.xml
Code:
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
        <ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
            <com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
        </ImageSwitcher>
        <com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
            <TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
        </com.android.systemui.statusbar.phone.TickerView>
    </LinearLayout>
	[COLOR="Blue"]<com.android.systemui.statusbar.policy.BatteryBarController android:visibility="gone" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_alignParentTop="true" systemui:viewLocation="1" />[/COLOR]
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to res/values/attrs
Code:
[COLOR="Blue"]<attr name="viewLocation" format="integer" />[/COLOR]
</resources>
Navigate to smali/com/android/systemui/statusbar/policy/Prefs.smali
add this :
Code:
.method public static read(Landroid/content/Context;)Landroid/content/SharedPreferences;
    .locals 2
    .parameter "context"

    .prologue
    .line 32
    const-string v0, "status_bar"

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v0

    return-object v0
.end method

[COLOR="Blue"].method public static getLastBatteryLevel(Landroid/content/Context;)I
    .locals 3

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "last_battery_level"

    const/16 v2, 0x32

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I

    move-result v0

    return v0
.end method

.method public static getLastFastChargeState(Landroid/content/Context;)Z
    .locals 3

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->read(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    const-string v1, "last_fcharge_state"

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v0

    return v0
.end method

.method public static setLastBatteryLevel(Landroid/content/Context;I)V
    .locals 2

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "last_battery_level"

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putInt(Ljava/lang/String;I)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    return-void
.end method

.method public static setLastFastChargeState(Landroid/content/Context;Z)V
    .locals 2

    invoke-static {p0}, Lcom/android/systemui/statusbar/policy/Prefs;->edit(Landroid/content/Context;)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "last_fcharge_state"

    invoke-interface {v0, v1, p1}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->commit()Z

    return-void
.end method[/COLOR]
Find the attached zip file and place all files in smali/com/android/systemui/statusbar/policy

PL: you're send for me file DisplaySettings.smali in mod rom your