[GUIDE]OGBattery Mod for KK

Search This thread

meawww

Senior Member
Dec 2, 2013
521
629
Rome
same error in the same smali

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) Client VM (build 24.51-b03, mixed mode, sharing)
..\projects\SystemUI.apk\smali\com\android\systemui\BatteryMeterView$1.smali[24,4] Error for input '.parameter': Invalid directive
..\projects\SystemUI.apk\smali\com\android\systemui\BatteryMeterView$1.smali[39,4] Error for input '.parameter': Invalid directive
..\projects\SystemUI.apk\smali\com\android\systemui\BatteryMeterView$1.smali[39,15] mismatched input '"msg"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/systemui/BatteryMeterView$1.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:338)
at brut.androlib.Androlib.buildSources(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)

What version of android is that? 4.4 dont use parameter anymore :eek:
 

meawww

Senior Member
Dec 2, 2013
521
629
Rome
The error you posted is either you trying to do something or you changed the complete smali because its not from nd5 base, 4.4 android use .param and on your error it shows .parameter its old android version and cant be a 4.4
 
  • Like
Reactions: Hnktc

deuce_biggins

Senior Member
Mar 14, 2014
1,006
2,192
Detroit
The error you posted is either you trying to do something or you changed the complete smali because its not from nd5 base, 4.4 android use .param and on your error it shows .parameter its old android version and cant be a 4.4

Any ideas on this one? See attachment
 

Attachments

  • ScreenShot029.jpg
    ScreenShot029.jpg
    54.5 KB · Views: 268

danivancouver

Senior Member
Nov 10, 2010
611
617
Sorry

Enviado desde mi SM-N9005 mediante Tapatalk
 

Attachments

  • uploadfromtaptalk1399225395175.jpg
    uploadfromtaptalk1399225395175.jpg
    104.9 KB · Views: 393
Last edited:

Sk.D

Senior Member
Nov 16, 2012
1,073
1,245
City Of Dreams!!
So u made it working now?

yeah .. but I had to utiliar the other smali mod. Sorry

Enviado desde mi SM-N9005 mediante Tapatalk

FYI, I didn't get any errors recompiling when I use 32bit java and apktool 2.0. I was using 64bit before which did not work. Thanks for all your help

Sent from my SM-N900V using Tapatalk


Can i get some help here also ;)
C:\Users\Skd\Desktop\ogmod\Tools>apktool b "systemui"
I: Using Apktool 2.0.0-Beta9 on systemui
I: Checking whether sources has changed...
I: Smaling...
SystemUI\smali\com\ghareeb\BatteryMod\BatteryController$1.smali[27,4] Error for input '.parameter': Invalid directive
SystemUI\smali\com\ghareeb\BatteryMod\BatteryController$1.smali[43,4] Error for input '.parameter': Invalid directive
SystemUI\smali\com\ghareeb\BatteryMod\BatteryController$1.smali[43,15] mismatched input '"v"' expecting END_METHOD_DIRECTIVE
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/ghareeb/BatteryMod/BatteryController$1.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:72)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:56)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:41)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:338)
at brut.androlib.Androlib.buildSources(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:236)
at brut.apktool.Main.main(Main.java:88)

Code:
 

meawww

Senior Member
Dec 2, 2013
521
629
Rome
Are you using the smali i have on attachement? seems like ur using the old ogbattery smali
 

Sk.D

Senior Member
Nov 16, 2012
1,073
1,245
City Of Dreams!!
Are you using the smali i have on attachement? seems like ur using the old ogbattery smali

Hey brother , I own a moto g xt1033. I will check the one in attachment and report.

So after replacing with your files , I get this error.

aapt: warning: string 'compat_mode_help_body' has no default translation in C:\AndroidMultitool\Decompiled_apk\SystemUI\res; found: ms
aapt: warning: string 'compat_mode_help_header' has no default translation in C:\AndroidMultitool\Decompiled_apk\SystemUI\res; found: ms
aapt: warning: string 'jelly_bean_dream_name' has no default translation in C:\AndroidMultitool\Decompiled_apk\SystemUI\res; found: ms
aapt: warning: string 'quick_settings_wifi_display_label' has no default translation in C:\AndroidMultitool\Decompiled_apk\SystemUI\res; found: ms
aapt: warning: string 'quick_settings_wifi_display_no_connection_label' has no default translation in C:\AndroidMultitool\Decompiled_apk\SystemUI\res; found: ms
aapt: warning: string 'status_bar_help_text' has no default translation in C:\AndroidMultitool\Decompiled_apk\SystemUI\res; found: ms
aapt: warning: string 'status_bar_help_title' has no default translation in C:\AndroidMultitool\Decompiled_apk\SystemUI\res; found: ms
A duplicate file name exists, or the file
cannot be found.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    This is a guide how to add OG Battery Mod for kitkat 4.4 based on ND3 files,
    Working with Galaxy S5 too tested by @SandeepEmekar

    1: Decompile SystemUI.apk
    2: Open the file (\SystemUI\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali)

    3: Search the line (Around line 102 stock ND3)
    Code:
    .field mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
    Replace with
    Code:
    .field mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
    4: Search the line (Around line 10689 stock ND3)
    Code:
    invoke-direct/range {v25 .. v26}, Lcom/android/systemui/statusbar/policy/BatteryController;-><init>(Landroid/content/Context;)V
    Replace with
    Code:
    invoke-direct/range {v25 .. v26}, Lcom/ghareeb/BatteryMod/BatteryController;-><init>(Landroid/content/Context;)V
    5: Search the line (Around line 10681 stock ND3)
    Code:
    .line 723
        new-instance v25, Lcom/android/systemui/statusbar/policy/BatteryController;
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
    
        move-object/from16 v26, v0
    
        invoke-direct/range {v25 .. v26}, Lcom/android/systemui/statusbar/policy/BatteryController;-><init>(Landroid/content/Context;)V
    
        move-object/from16 v0, v25
    
        move-object/from16 v1, p0
    
        iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/android/systemui/statusbar/policy/BatteryController;
    Replace with
    Code:
        .line 723
        new-instance v25, Lcom/ghareeb/BatteryMod/BatteryController;
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
    
        move-object/from16 v26, v0
    
        invoke-direct/range {v25 .. v26}, Lcom/ghareeb/BatteryMod/BatteryController;-><init>(Landroid/content/Context;)V
    
        move-object/from16 v0, v25
    
        move-object/from16 v1, p0
    
        iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;

    FOR S5 USERS!!! Follow this red line to the end of other red line
    ______________________________________

    Find the line
    Code:
    .line 827
        new-instance v29, Lcom/android/systemui/statusbar/policy/BatteryController;
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
    
        move-object/from16 v30, v0
    
        invoke-direct/range {v29 .. v30}, Lcom/ghareeb/BatteryMod/BatteryController;-><init>(Landroid/content/Context;)V
    
        move-object/from16 v0, v29
    
        move-object/from16 v1, p0
    
        iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;

    Replace with
    Code:
    .line 827
        new-instance v29, Lcom/ghareeb/BatteryMod/BatteryController;
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
    
        move-object/from16 v30, v0
    
        invoke-direct/range {v29 .. v30}, Lcom/ghareeb/BatteryMod/BatteryController;-><init>(Landroid/content/Context;)V
    
        move-object/from16 v0, v29
    
        move-object/from16 v1, p0
    
        iput-object v0, v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;

    ______________________________________

    6: Now right under the last line you just changed paste this whole code.
    Code:
    .line 724
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
    
        move-object/from16 v27, v0
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
    
        move-object/from16 v26, v0
    
        const v28, 0x7f070078
    
        move-object/from16 v0, v26
    
        move/from16 v1, v28
    
        invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
    
        move-result-object v26
    
        check-cast v26, Landroid/widget/ImageView;
    
        move-object/from16 v0, v27
    
        move-object/from16 v1, v26
    
        invoke-virtual {v0, v1}, Lcom/ghareeb/BatteryMod/BatteryController;->addIconView(Landroid/widget/ImageView;)V
    
        .line 725
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryController:Lcom/ghareeb/BatteryMod/BatteryController;
    
        move-object/from16 v26, v0
    
        move-object/from16 v0, p0
    
        iget-object v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mBatteryText:Landroid/widget/TextView;
    
        move-object/from16 v27, v0
    
        invoke-virtual/range {v26 .. v27}, Lcom/ghareeb/BatteryMod/BatteryController;->addLabelView(Landroid/widget/TextView;)V

    FOR S5 USERS!!! Follow this red line to the end of other red line
    ______________________________________

    From the codes above Change the .line 724 to .line 828 and .line 725 to .line 829

    ______________________________________

    7: In the code we just added above you will see the line const v28, 0x7f070078 now check the public.xml under the folder (\SystemUI\res\values\public.xml) and look for the line <public type="id" name="battery" id=" check if you have same number, In my case i have <public type="id" name="battery" id="0x7f070078" />. If you have different number then copy it from public.xml to the number in the smali.

    8:Save the smali then go to the folder (\SystemUI\smali\com) download this file Attachment and extract to that folder.

    9:Now open the file (\SystemUI\res\layout\status_bar.xml) look for the line
    Code:
    <com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="12.0dip" android:layout_height="18.0dip" android:layout_marginBottom="0.33000004dip" android:layout_marginStart="5.0dip" />
    Replace with
    Code:
    <ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingStart="3.0dip" />

    10: Compile the SystemUI.apk using apk tool and sign it.

    11: Now download this file OG BatteryMod and put it inside your phone (system\app) folder.

    12:Now push the SystemUI.apk you just compiled inside (system\priv-app).

    (Optional)
    Add the BatteryMod in phone settings.
    1: Decompile SecSettings.apk
    2: Open the file (\SecSettings\res\xml\display_headers.xml)
    Under the line
    Code:
    <header android:icon="@drawable/ic_settings_led" android:id="@id/led_indicator_settings" android:title="@string/led_indicator_settings" android:fragment="com.android.settings.LedIndicatorSettings" />

    Add this codes
    Code:
    <header android:icon="@drawable/ic_settings_battery" android:title="@string/battery_mod" android:summary="@string/battery_mod_desc">
            <intent android:targetPackage="com.ghareeb.battery" android:action="android.intent.action.MAIN" android:targetClass="com.ghareeb.battery.Settings" />
    </header>

    3: Now go open the file (\SecSettings\res\values\string.xml) and add the line
    Code:
    <string name="battery_mod">OGBattery Mod</string>
    <string name="battery_mod_desc">Change battery icon and charging animation.</string>

    4: Compile , Sign and push to your (system\priv-app).

    5: :victory: Enjoy!!!


    Credit to the owner of the OGBatteryMod @OsamaGhareeb Thank him here http://xdaforums.com/showthread.php?p=38905053


    Edit: Step 5 was wrong so i fixed it sorry :laugh:

    PS: Working on S5 :D
    1
    I can confirm that it doesn't work with Samsung Galaxy S5. :(

    I have attached the original SystemUI.apk in case someone wants to look into it.

    This guide is useful than for S5 : http://xdaforums.com/showthread.php?t=2628560
    1
    Thank you for this guide kababayan @meawww :)

    Sent from my SM-N9005 using XDA Premium 4 mobile app
    1
    The error you posted is either you trying to do something or you changed the complete smali because its not from nd5 base, 4.4 android use .param and on your error it shows .parameter its old android version and cant be a 4.4
    1
    I'm running a Verizon Galaxy Note 3 kitkat 4.4.2

    Hmmm i never encounter that problem can u zip the systemui ill try to do it and see if i get same error