[MOD] Battery Bar for All ROMs - Updated 31/3/12

Search This thread

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35

MOD Version

App Version Here - http://xdaforums.com/showthread.php?t=1568318

Howdy All,

Few people have been asking me how i got the Miui Battery Bar into my ROM on the x10! short answer is i didn't i wrote my own battery bar! and here is how you can use it!

Features
Hide / Show
Selectable Colors
Static Color
Auto-Magicaly Color (Low Med Reg Charge)
Auto Detection of screen Width ( Bar works in Portrait and Landscape Mode )
Selectable Height
Charge Animation options.

Screen Shots
device-2011-12-01-213858.png


Change Log
Code:
[B]Options App[/B]
v2.0
added height options.

v3.0
added new color dialogs.

v4.0
fixed default color of med level to be non-transparent.
Code:
[B]Battery Bar[/B]
v2
added height options and fixed default colors.


How To!

Ok so there are 2 files attached

First is a Zip with the files needed to add to the SystemUI.apk (THIS IS NOT FLASHABLE)

Second is an the Settings app for the Battery Bar.

Step 1
decompile your SystemUI.apk

i use Apk Manager

Step 2
Navigate to smali\com\android\systemui\statusbar\ Folder
Place the 3 Smali Files from the zip here
BatteryBar.smali
BatteryBar$1.smali
BatteryBar$SettingsObserver.smali

Step 3
You need to Navigate to the res\layouts\ Folder
open your statusbar.xml

Step 4
Underneath the line with

Code:
com.android.systemui.statusbar.DateView

add this
*** CHANGED ON v3 ***
Code:
<com.android.systemui.statusbar.BatteryBar android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="wrap_content" [B][COLOR="Red"]android:layout_height="wrap_content"[/COLOR][/B] />


it should be right at the bottom above the

Code:

i have added my statusbar.xml for reference if yours is in a different order no big deal just put it last and above this line
Code:
</com.android.systemui.statusbar.StatusBarView>


Step 5
Recompile the apk however you normaly would (there are so many ways i wont cover this here)
then push it to your phone and reboot.

If you don't know how or are having issues this is how I do it!

Notes:
a. i have a file on my desctop that i edit this is a copy of the file pulled from my phone.

Steps:
1. after all mods are done open up apk manager
2. type 22 hit enter and pick the file you were editing ( SystemUI.apk )
3. type 11 hit enter and the app will recompile.
- 4. Open a copy of the SystemUI.apk ( see note a ) in winnra or 7zip ect put that window on one side of your screen ( windows 7 snap too (windows key + -> or <- ) is awesome for this )
5. Navigate to the projects folder of APK Manager and then navigate to the app you edited (SystemUI.apk)
6. Navigate to the /build/apk folder ( snap this to the other side of your screen ) ( Note that the build/apk folder has the same structure as the apk file open in winnra / 7zip )
7. for THIS MOD only! you will need these files simply drag the 2 files listed below into the same folder location in the open apk in winnra / 7zip
- /res/layouts/status_bar.xml
- /classes.dex

8. Push the apk that you draged the files into to your phone with adb like this

adb push [where ever your apk is]/SystemUI.apk system/app/SystemUI.apk
adb shell chmod 0644 system/app/SystemUI.apk

9. whilst you have adb up reboot :)
adb reboot
+ 4. Open a copy of the SystemUI.apk ( see note a ) in winnra or 7zip ect put that window on one side of your screen ( windows 7 snap too (windows key + -> or

- 10. Proceed to next step
-
Step 6
Once your status bar is back and running (you will have no battery bar yet)
Simply install "BatteryBarSettings.apk" then open the app and pick your settings!

Thats it ( I think )!

all i ask is you don't modify the about section of the app if you choose to use it! and give credits where credits due. feel free to change my dodgy icon and if anyone has a better one ;) i will also put the sources for the settings app up on my git when i get git back up ( and when i tidy up and add comments ) and running in the next few days so that those of you running on source versions can cook it in from scratch. ( i don't think i need to explain how to do that if you are compiling sources i think you'll know what to do )
Vissit My Git to have a Look


with some help i can probably port this to older android versions (<2.3) as needed but i dont have access to a rom to test it on currently. so if you can help me there let me know :D

Hope you found this helpfull! Let me know if this is not clear enough!

Q&A
Q: I am getting a FC on this or that, can you help me!
A: NO. We can't help you. Because what you just said means nothing to us.
We want to help you SO much, but in order to do that you need to report the bug properly.
We took care of that too, see here:
http://xdaforums.com/showthread.php?t=1292625

Q:OMG YOU STOLE MY WORK! YOU A!@#$!% etc etc etc
A: I kindly ask you that if you have an issue with anything above to PM me so i can sort it out politely. There is no need to flame in the thread.

Pvy


Credits
Color Picker
http://xdaforums.com/showthread.php?p=10739805#post10739805
Thanks to Devmil

 
Last edited:

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
[APP] or [MOD] Battery Bar for All ROMs - Updated 16/1/12

Hiding the battery Icons on your beloved ROM's
tested on 2.3.* ROMS (Stock ROMS, AOSP, CM, MIUI) may sork on others aswell but 2.2 and below have a different process.

for anyone who understands this stuff a bit this code here is what i edited for our TEAM ROM. this is hiding with an option from an app that sets a "global" setting.
look in the statusbarpolicy.smali
i commented the part with "hide battery icon";


For everyone else what you will need to do is,

1. Decompile your SystemUI.apk
2. Open /smali/com/android/systemui/statusbar/StatusBarPolicy.smali
3. Find the UpdateBattery function.
this can be a long way down.
just do a search for "battery" and you will find it eventually.

Option A - Lock out the battery icon forever!

basicaly to perma hide the icon add this to the start of the update battery function after the bit that looks like this.

Code:
Code:
.locals 12
.parameter "intent"

.prologue

add this!

Code:
Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mService:Landroid/app/StatusBarManager;

const-string v2, "battery"

const v0, 0x0

invoke-virtual {v1, v2, v0}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
return-void

then recompile and push back to phone.

If you don't know how or are having issues this is how I do it!

Notes:
a. i have a file on my desctop that i edit this is a copy of the file pulled from my phone.

Steps:
1. after all mods are done open up apk manager
2. type 22 hit enter and pick the file you were editing ( SystemUI.apk )
3. type 11 hit enter and the app will recompile.
4. Open a copy of the SystemUI.apk ( see note a ) in winnra or 7zip ect put that window on one side of your screen ( windows 7 snap too (windows key + -> or <- ) is awesome for this )
5. Navigate to the projects folder of APK Manager and then navigate to the app you edited (SystemUI.apk)
6. Navigate to the /build/apk folder ( snap this to the other side of your screen ) ( Note that the build/apk folder has the same structure as the apk file open in winnra / 7zip )
7. for THIS MOD only! you will need these files simply drag the 2 files listed below into the same folder location in the open apk in winnra / 7zip
- /classes.dex

8. Push the apk that you draged the files into to your phone with adb like this

adb push [where ever your apk is]/SystemUI.apk system/app/SystemUI.apk
adb shell chmod 0644 system/app/SystemUI.apk

9. whilst you have adb up reboot
adb reboot
that will perma hide the battery icon

Option B - Make it optional! ( my preferred way of doing things )

basically the same process but with different code and an app to set the settings.
i will add this soon and i will put the option to toggle into the BatteryBar settings app.

Aaron.
 
Last edited:

Mjergen

Member
Nov 19, 2010
17
2
hi there ; tried it on a SGS2 with the latest CM nightly and then with CheckROM 3.1.1 -- didn't work. no serious hang nor crash, just...nothing happens (I've done the decompiling and recompiling with APKTool)
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
hi there ; tried it on a SGS2 with the latest CM nightly and then with CheckROM 3.1.1 -- didn't work. no serious hang nor crash, just...nothing happens (I've done the decompiling and recompiling with APKTool)

It has to be enabled from the app. Did you turn it on?

Pvy

Sent from my TEAM powered x10
 
  • Like
Reactions: KingRedHot

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
sure, I installed the app and when first running the app, the "activate" box was already ticked. un-ticking and ticking it again did not help either :-l

Doesn't cm have it'd own bar? could be fighting.

Any chance of sending me your systemui and maybe grabbing some logs at boot and when you change the settings.

Pvy

Sent from my TEAM powered x10
 
Last edited:
  • Like
Reactions: KingRedHot

Mjergen

Member
Nov 19, 2010
17
2
Doesn't cm have it'd own bar? could be fighting.

well I thought it had it, hence me flashing it, but apparently not. either that or it's really really ... really well hidden. neither the latest SGS2 nightly (116), nor the stable rls (7.1) seem to have the top bar. i flashed the stable CM 7.1 yesterday evening and didn't apply your mod to the stable version just yet. gonna try that today and keep you posted (i'm in Czech, GMT+1, if you're australian, we might have quite the time difference here :D ).
what I'll do is i'll send you the unaltered systemui from the stable CM7.1 AND the same systemui with your mod, if that's okay with you ?
what is your method of choice for decompiling and recompiling, btw ?

Any chance of sending me your systemui and maybe grabbing some logs at boot and when you change the settings.

sure thing, i'll do as I said hereabove. also, which logs, pre- or post-mod ?
 
Last edited:

Ditamae

Senior Member
Oct 30, 2010
947
228
Hey there. First, thank you so much for this.

I apologize for the noob question, but I've never decompiled an apk before, but I'm eager to learn.

I used apkTool to unpack SystemUI.apk, and then added the files per your instructions, and then repacked. I then pushed SystemUI.apk to /system/app and rebooted. Upon reboot the status bar didn't work at all. When I looked at the apk itself it says "Parse error: There is a problem parsing the package."

I'm assuming I've not recompiled properly. I've attached the apkTool version I used. Perhaps I've some made obvious error? Any help you could provide would be much appreciated! I'll try again and see what happens in the meantime.
 

Attachments

  • apkTools.zip
    5.3 MB · Views: 432

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
well I thought it had it, hence me flashing it, but apparently not. either that or it's really really ... really well hidden. neither the latest SGS2 nightly (116), nor the stable rls (7.1) seem to have the top bar. i flashed the stable CM 7.1 yesterday evening and didn't apply your mod to the stable version just yet. gonna try that today and keep you posted (i'm in Czech, GMT+1, if you're australian, we might have quite the time difference here :D ).
what I'll do is i'll send you the unaltered systemui from the stable CM7.1 AND the same systemui with your mod, if that's okay with you ?
what is your method of choice for decompiling and recompiling, btw ?



sure thing, i'll do as I said hereabove. also, which logs, pre- or post-mod ?

Hey there. First, thank you so much for this.

I apologize for the noob question, but I've never decompiled an apk before, but I'm eager to learn.

I used apkTool to unpack SystemUI.apk, and then added the files per your instructions, and then repacked. I then pushed SystemUI.apk to /system/app and rebooted. Upon reboot the status bar didn't work at all. When I looked at the apk itself it says "Parse error: There is a problem parsing the package."

I'm assuming I've not recompiled properly. I've attached the apkTool version I used. Perhaps I've some made obvious error? Any help you could provide would be much appreciated! I'll try again and see what happens in the meantime.

I use APK Manager v5

then drag/ drop updated files into the apks. to replace the old ones.

i cant find a decent guide atm but i know there is one.

Pvy
 
  • Like
Reactions: Ditamae

Mjergen

Member
Nov 19, 2010
17
2
i cant find a decent guide atm but i know there is one.Pvy

I used & followed this tuto : http://youtu.be/YgWd0jsDtH0

if I used the plain SystemUI from APKTool\SystemUI\dist , I get neverending FC. upon reboot, the status bar is simply gone and even the launcher's "Notifications" soft menu option doesn't make it appear. gotta reflash the ROM to set things straight & get the statusbar back.

if I copy/paste "resources.arsc" from APKTool\SystemUI\build\apk into the fresh SystemUI I obtain in APKTool\SystemUI\dist, there are no FC and the status bar shows, but your top bar mod isn't present, not even when repeatedly checking/unchecking/rechecking "show battery bar" in your app.

it doesn't take a rocket scientist to understand & follow your tutorial, so I believe that my problem comes from somewhere in the recompiling process...
at work now, whenever I have 10min, I'll upload my systemUI apks
 

pvyParts

Inactive Recognized Developer
Oct 11, 2010
1,858
2,341
35
I used & followed this tuto : http://youtu.be/YgWd0jsDtH0

if I used the plain SystemUI from APKTool\SystemUI\dist , I get neverending FC. upon reboot, the status bar is simply gone and even the launcher's "Notifications" soft menu option doesn't make it appear. gotta reflash the ROM to set things straight & get the statusbar back.

if I copy/paste "resources.arsc" from APKTool\SystemUI\build\apk into the fresh SystemUI I obtain in APKTool\SystemUI\dist, there are no FC and the status bar shows, but your top bar mod isn't present, not even when repeatedly checking/unchecking/rechecking "show battery bar" in your app.

it doesn't take a rocket scientist to understand & follow your tutorial, so I believe that my problem comes from somewhere in the recompiling process...
at work now, whenever I have 10min, I'll upload my systemUI apks

OK my gimme 5 i'll edit the op with my full decompile/compile process

EDIT*** all done. hope it is enough... i really had to think on how to word it all LOL!

also the file in apktool/[apk name]/dist
has no signatures and will not run (from memory)

Pvy.
 
Last edited:

Mjergen

Member
Nov 19, 2010
17
2
well, so far...no good. i followed your tuto using APK Manager 4.9, I got numerous errors when decompiling. log coming up in next post.



---------- Post added at 01:27 PM ---------- Previous post was at 01:26 PM ----------

Part 1


Code:
-------------------------------------------------------------------------- 
|p* 02.12.2011 -- 12:16:52,24| 
-------------------------------------------------------------------------- 
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
adb nenˇ n*zvem vnitýnˇho ani vnŘjçˇho pýˇkazu,
spustiteln‚ho programu nebo d*vkov‚ho souboru.
Nelze najˇt M:\FICHIERS RECUS\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk.
Nelze najˇt M:\FICHIERS RECUS\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk.
I: Baksmaling...
I: Loading resource table...
I: Decoding resources...
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x0000000a
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=minSdkVersion, value=0x0000000a
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=targetSdkVersion, value=0x0000000a
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x7f090000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=icon, value=0x7f020009
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=allowClearUserData, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=persistent, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=exported, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=excludeFromRecents, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010300a3
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=excludeFromRecents, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010300a3
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=exported, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=excludeFromRecents, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=finishOnCloseSystemDialogs, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010300a3
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=exported, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=excludeFromRecents, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=finishOnCloseSystemDialogs, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010300a3
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=exported, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=excludeFromRecents, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=finishOnCloseSystemDialogs, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010300a3
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=exported, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=excludeFromRecents, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=finishOnCloseSystemDialogs, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=duration, value=0x010e0001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=fromXDelta, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=toXDelta, value=0x00000101
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=oneshot, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=duration, value=0x00000320
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f02009c
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=duration, value=0x000004b0
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f02009d
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_window_focused, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_enabled, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f020002
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_window_focused, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_enabled, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f020003
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_pressed, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f020005
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_focused, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_enabled, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f020006
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_enabled, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f020002
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_focused, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f020004
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f020003
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=orientation, value=0x00000001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0x00004102
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b002e
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0108008c
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x00000602
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=focusable, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=clickable, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0x00004002
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x7f020008
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=gravity, value=0x00000011
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=orientation, value=0x00000001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b0000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=textSize, value=0x00001201
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=textColor, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=gravity, value=0x00000003
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b0001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x00001301
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=text, value=0x7f090006
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=textSize, value=0x00001201
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=textColor, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=gravity, value=0x00000003
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b0002
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x00001301
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x00000a00
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b0003
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingTop, value=0x00000a00
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x00000f00
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=src, value=0x7f020000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=duration, value=0x010e0001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=fromXDelta, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=toXDelta, value=0xffffff01
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=oneshot, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=duration, value=0x000001f4
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x7f02008a
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=duration, value=0x000001f4
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010802d9
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=orientation, value=0x00000001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=focusable, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=descendantFocusability, value=0x00000001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=orientation, value=0x00000001
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b001d
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x7f0200bf
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingTop, value=0x00000301
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x00000301
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x00000501
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b001e
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=gravity, value=0x00000010
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=orientation, value=0x00000000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=id, value=0x7f0b001f
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_width, value=0xffffffff
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_height, value=0xfffffffe
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x01010040
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=textColor, value=0x7f060000
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_gravity, value=0x00000010
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x00000401
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x00000101
 
Last edited:

Mjergen

Member
Nov 19, 2010
17
2
pt 2 of the log is basically repeating the pt1 above with different "name=" values

it goes on like that for a while and then at the very end of the log :
Code:
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x01030065 style/TextAppearance.StatusBar.Title, config=[DEFAULT]
	at brut.androlib.res.data.ResConfig.addResource(Unknown Source)
	at brut.androlib.res.data.ResConfig.addResource(Unknown Source)
	at brut.androlib.res.decoder.ARSCDecoder.readEntry(Unknown Source)
	at brut.androlib.res.decoder.ARSCDecoder.readConfig(Unknown Source)
	at brut.androlib.res.decoder.ARSCDecoder.readType(Unknown Source)
	at brut.androlib.res.decoder.ARSCDecoder.readPackage(Unknown Source)
	at brut.androlib.res.decoder.ARSCDecoder.readTable(Unknown Source)
	at brut.androlib.res.decoder.ARSCDecoder.decode(Unknown Source)
	at brut.androlib.res.AndrolibResources.getResPackagesFromApk(Unknown Source)
	at brut.androlib.res.AndrolibResources.loadFrameworkPkg(Unknown Source)
	at brut.androlib.res.data.ResTable.getPackage(Unknown Source)
	at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
	at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)
	at brut.androlib.res.data.value.ResReferenceValue.getReferent(Unknown Source)
	at brut.androlib.res.data.value.ResReferenceValue.toResXmlFormat(Unknown Source)
	at brut.androlib.res.data.value.ResStyleValue.serializeToXml(Unknown Source)
	at brut.androlib.res.AndrolibResources.generateValuesFile(Unknown Source)
	at brut.androlib.res.AndrolibResources.decode(Unknown Source)
	at brut.androlib.Androlib.decodeResourcesFull(Unknown Source)
	at brut.androlib.ApkDecoder.decode(Unknown Source)
	at brut.apktool.Main.cmdDecode(Unknown Source)
	at brut.apktool.Main.main(Unknown Source)


i tried reducing memory size (option 20) or running the .bat as Admin (Win 7 x64) but the same error kept coming back in the log. and before you ask, I do have ADB installed but APK Manager doesn't find it.

i'll try flashing a stock SGS2 ROM or a non-CM ROM, who knows, maybe it's CM's SystemUI's fault...i'll also try doing the procedure on a more powerful PC than the curent one I got at work :rolleyes:
 
Last edited:

Mjergen

Member
Nov 19, 2010
17
2
it seems you haven't installed the appropriate framework.

that makes perfect sense, efharisto good sir ;)
I'm somewhat of an advanced-noob person -- I don't have problems fiddling with files and recovering from my mistakes, but when something's implicit (as pulling the framework files), that's when my brain starts to FC :)

--- EDIT ---

alright, it decompiled ! now it seems the problem lies in the recompiling :

Code:
|p* 02.12.2011 -- 13:07:11,05| 
-------------------------------------------------------------------------- 
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)
adb nenˇ n*zvem vnitýnˇho ani vnŘjçˇho pýˇkazu,
spustiteln‚ho programu nebo d*vkov‚ho souboru.
Nelze najˇt M:\FICHIERS RECUS\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk.
Nelze najˇt M:\FICHIERS RECUS\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk.
I: Baksmaling...
I: Loading resource table...
I: Decoding resources...
I: Loading resource table from file: C:\Users\PROMOTHERM\apktool\framework\1.apk
I: Copying assets and libs...
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
W/ResourceType( 5884): Unable to get buffer of resource asset file
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:3: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.StatusBar'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:4: error: Error: No resource found that matches the given name: attr 'android:textAppearance'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:6: error: Error: No resource found that matches the given name: attr 'android:textColor'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:5: error: Error: No resource found that matches the given name: attr 'android:textStyle'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Large'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:9: error: Error: No resource found that matches the given name: attr 'android:textColor'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:11: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Widget.Button'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:14: error: Error: No resource found that matches the given name: attr 'android:background'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:13: error: Error: No resource found that matches the given name: attr 'android:textColor'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:12: error: Error: No resource found that matches the given name: attr 'android:textSize'.
M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res\values\styles.xml:16: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.StatusBar'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\PROMOT~1\AppData\Local\Temp\APKTOOL1867850949983348058.tmp, -I, C:\Users\PROMOTHERM\apktool\framework\1.apk, -S, M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res, -M, M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\AndroidManifest.xml]
	at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
	at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
	at brut.androlib.Androlib.buildResources(Unknown Source)
	at brut.androlib.Androlib.build(Unknown Source)
	at brut.androlib.Androlib.build(Unknown Source)
	at brut.apktool.Main.cmdBuild(Unknown Source)
	at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\PROMOT~1\AppData\Local\Temp\APKTOOL1867850949983348058.tmp, -I, C:\Users\PROMOTHERM\apktool\framework\1.apk, -S, M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\res, -M, M:\FICHIERS RECUS\apk_manager_4.9\other\..\projects\SystemUI.apk\AndroidManifest.xml]
	at brut.util.OS.exec(Unknown Source)
	... 7 more

i pulled framework-res.apk from the phone, copied it to C:\Users\(username)\apktool\framework and renamed it 1.apk since it's the filename apktool is looking for, and i got the above log when recompiling
any ideas before i go jump off a cliff... ? :D
 
Last edited:

iridaki

Retired Forum Moderator
Feb 21, 2007
4,532
5,190
37
Edinburgh, Scotland
that makes perfect sense, efharisto good sir ;)
I'm somewhat of an advanced-noob person -- I don't have problems fiddling with files and recovering from my mistakes, but when something's implicit (as pulling the framework files), that's when my brain starts to FC :)

Trust me, pulling the framework is as harmless as it gets!
Pushing a modified one is somewhat a risk, but if you have working adb and/or recovery, you should have nothing to worry about. :)
Good luck!

PS: I am more of a madam, than a sir! :D

i pulled framework-res.apk from the phone, copied it to C:\Users\(username)\apktool\framework and renamed it 1.apk since it's the filename apktool is looking for, and i got the above log when recompiling
any ideas before i go jump off a cliff... ? :D

You certainly did not install the framework by renaming it to 1.apk.
The link I posted nowhere does it mention this is what you should do. :p

Code:
apktool if framework-res.apk
;)
 
Last edited:

Mjergen

Member
Nov 19, 2010
17
2
Trust me, pulling the framework is as harmless as it gets!
Pushing a modified one is somewhat a risk, but if you have working adb and/or recovery, you should have nothing to worry about. :)
Good luck!

actually, for 95% of what I do, I only need CWM recovery and samsung's download mode, sooo...

PS: I am more of a madam, than a sir! :D
:eek: my apologies, I couldn't have guessed !

You certainly did not install the framework by renaming it to 1.apk.
The link I posted nowhere does it mention this is what you should do. :p

yup, I'll re-do it all this afternoon and take my time. now I'm trying to install Pvy's MOD at work, when I have 5 free minutes between two tasks... :eek:
 

Mjergen

Member
Nov 19, 2010
17
2
so... i solved this the lazy way :p

I actually found a package that's flashable in recovery that did the trick ! it was lying around on a Polish Samsung forum (link : http://s5830.pl/thread-242.html). it is intended only for CyanogenMod and apparently the Galaxy Ace, but it works perfect on the latest CM 7.1 and a Galaxy S2 !

link to the mod flashable, in CWM recovery : http://db.tt/79ytqshA

maybe some of you brainiacs could make a universal, flashable zip ? :) all credit goes to Konsky from http://s5830.pl (and to Lady Luck for not f@µ*& up my phone...)

anyway, BIG thanks to Pvy and the rest of you guys for the immediate follow-up customer care and i'm bookmarking this thread nonetheless for when I'll change my SGS2 - hopefully by then I'll be experienced enough not to fumble over de/re-compiling :p
 

Top Liked Posts

  • There are no posts matching your filters.
  • 117

    MOD Version

    App Version Here - http://xdaforums.com/showthread.php?t=1568318

    Howdy All,

    Few people have been asking me how i got the Miui Battery Bar into my ROM on the x10! short answer is i didn't i wrote my own battery bar! and here is how you can use it!

    Features
    Hide / Show
    Selectable Colors
    Static Color
    Auto-Magicaly Color (Low Med Reg Charge)
    Auto Detection of screen Width ( Bar works in Portrait and Landscape Mode )
    Selectable Height
    Charge Animation options.

    Screen Shots
    device-2011-12-01-213858.png


    Change Log
    Code:
    [B]Options App[/B]
    v2.0
    added height options.
    
    v3.0
    added new color dialogs.
    
    v4.0
    fixed default color of med level to be non-transparent.
    Code:
    [B]Battery Bar[/B]
    v2
    added height options and fixed default colors.


    How To!

    Ok so there are 2 files attached

    First is a Zip with the files needed to add to the SystemUI.apk (THIS IS NOT FLASHABLE)

    Second is an the Settings app for the Battery Bar.

    Step 1
    decompile your SystemUI.apk

    i use Apk Manager

    Step 2
    Navigate to smali\com\android\systemui\statusbar\ Folder
    Place the 3 Smali Files from the zip here
    BatteryBar.smali
    BatteryBar$1.smali
    BatteryBar$SettingsObserver.smali

    Step 3
    You need to Navigate to the res\layouts\ Folder
    open your statusbar.xml

    Step 4
    Underneath the line with

    Code:
    com.android.systemui.statusbar.DateView

    add this
    *** CHANGED ON v3 ***
    Code:
    <com.android.systemui.statusbar.BatteryBar android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="wrap_content" [B][COLOR="Red"]android:layout_height="wrap_content"[/COLOR][/B] />


    it should be right at the bottom above the

    Code:

    i have added my statusbar.xml for reference if yours is in a different order no big deal just put it last and above this line
    Code:
    </com.android.systemui.statusbar.StatusBarView>


    Step 5
    Recompile the apk however you normaly would (there are so many ways i wont cover this here)
    then push it to your phone and reboot.

    If you don't know how or are having issues this is how I do it!

    Notes:
    a. i have a file on my desctop that i edit this is a copy of the file pulled from my phone.

    Steps:
    1. after all mods are done open up apk manager
    2. type 22 hit enter and pick the file you were editing ( SystemUI.apk )
    3. type 11 hit enter and the app will recompile.
    - 4. Open a copy of the SystemUI.apk ( see note a ) in winnra or 7zip ect put that window on one side of your screen ( windows 7 snap too (windows key + -> or <- ) is awesome for this )
    5. Navigate to the projects folder of APK Manager and then navigate to the app you edited (SystemUI.apk)
    6. Navigate to the /build/apk folder ( snap this to the other side of your screen ) ( Note that the build/apk folder has the same structure as the apk file open in winnra / 7zip )
    7. for THIS MOD only! you will need these files simply drag the 2 files listed below into the same folder location in the open apk in winnra / 7zip
    - /res/layouts/status_bar.xml
    - /classes.dex

    8. Push the apk that you draged the files into to your phone with adb like this

    adb push [where ever your apk is]/SystemUI.apk system/app/SystemUI.apk
    adb shell chmod 0644 system/app/SystemUI.apk

    9. whilst you have adb up reboot :)
    adb reboot
    + 4. Open a copy of the SystemUI.apk ( see note a ) in winnra or 7zip ect put that window on one side of your screen ( windows 7 snap too (windows key + -> or

    - 10. Proceed to next step
    -
    Step 6
    Once your status bar is back and running (you will have no battery bar yet)
    Simply install "BatteryBarSettings.apk" then open the app and pick your settings!

    Thats it ( I think )!

    all i ask is you don't modify the about section of the app if you choose to use it! and give credits where credits due. feel free to change my dodgy icon and if anyone has a better one ;) i will also put the sources for the settings app up on my git when i get git back up ( and when i tidy up and add comments ) and running in the next few days so that those of you running on source versions can cook it in from scratch. ( i don't think i need to explain how to do that if you are compiling sources i think you'll know what to do )
    Vissit My Git to have a Look


    with some help i can probably port this to older android versions (<2.3) as needed but i dont have access to a rom to test it on currently. so if you can help me there let me know :D

    Hope you found this helpfull! Let me know if this is not clear enough!

    Q&A
    Q: I am getting a FC on this or that, can you help me!
    A: NO. We can't help you. Because what you just said means nothing to us.
    We want to help you SO much, but in order to do that you need to report the bug properly.
    We took care of that too, see here:
    http://xdaforums.com/showthread.php?t=1292625

    Q:OMG YOU STOLE MY WORK! YOU A!@#$!% etc etc etc
    A: I kindly ask you that if you have an issue with anything above to PM me so i can sort it out politely. There is no need to flame in the thread.

    Pvy


    Credits
    Color Picker
    http://xdaforums.com/showthread.php?p=10739805#post10739805
    Thanks to Devmil

    19
    [APP] or [MOD] Battery Bar for All ROMs - Updated 16/1/12

    Hiding the battery Icons on your beloved ROM's
    tested on 2.3.* ROMS (Stock ROMS, AOSP, CM, MIUI) may sork on others aswell but 2.2 and below have a different process.

    for anyone who understands this stuff a bit this code here is what i edited for our TEAM ROM. this is hiding with an option from an app that sets a "global" setting.
    look in the statusbarpolicy.smali
    i commented the part with "hide battery icon";


    For everyone else what you will need to do is,

    1. Decompile your SystemUI.apk
    2. Open /smali/com/android/systemui/statusbar/StatusBarPolicy.smali
    3. Find the UpdateBattery function.
    this can be a long way down.
    just do a search for "battery" and you will find it eventually.

    Option A - Lock out the battery icon forever!

    basicaly to perma hide the icon add this to the start of the update battery function after the bit that looks like this.

    Code:
    Code:
    .locals 12
    .parameter "intent"
    
    .prologue

    add this!

    Code:
    Code:
    iget-object v1, p0, Lcom/android/systemui/statusbar/policy/StatusBarPolicy;->mService:Landroid/app/StatusBarManager;
    
    const-string v2, "battery"
    
    const v0, 0x0
    
    invoke-virtual {v1, v2, v0}, Landroid/app/StatusBarManager;->setIconVisibility(Ljava/lang/String;Z)V
    return-void

    then recompile and push back to phone.

    If you don't know how or are having issues this is how I do it!

    Notes:
    a. i have a file on my desctop that i edit this is a copy of the file pulled from my phone.

    Steps:
    1. after all mods are done open up apk manager
    2. type 22 hit enter and pick the file you were editing ( SystemUI.apk )
    3. type 11 hit enter and the app will recompile.
    4. Open a copy of the SystemUI.apk ( see note a ) in winnra or 7zip ect put that window on one side of your screen ( windows 7 snap too (windows key + -> or <- ) is awesome for this )
    5. Navigate to the projects folder of APK Manager and then navigate to the app you edited (SystemUI.apk)
    6. Navigate to the /build/apk folder ( snap this to the other side of your screen ) ( Note that the build/apk folder has the same structure as the apk file open in winnra / 7zip )
    7. for THIS MOD only! you will need these files simply drag the 2 files listed below into the same folder location in the open apk in winnra / 7zip
    - /classes.dex

    8. Push the apk that you draged the files into to your phone with adb like this

    adb push [where ever your apk is]/SystemUI.apk system/app/SystemUI.apk
    adb shell chmod 0644 system/app/SystemUI.apk

    9. whilst you have adb up reboot
    adb reboot
    that will perma hide the battery icon

    Option B - Make it optional! ( my preferred way of doing things )

    basically the same process but with different code and an app to set the settings.
    i will add this soon and i will put the option to toggle into the BatteryBar settings app.

    Aaron.
    5
    Howdy Guys

    I built My Battery Bar into an app.

    grab it on the market. has all the same features without the need to mod it into system. am going to update the OP now :D

    https://market.android.com/details?id=com.pvy.batterybar

    Pvy.
    4
    Updated to V1.4

    Howdy All!

    Updated the "App Version" today with these changes!

    V1.4
    1. Fixed the height issues
    2. You can now set what ever height you like
    3. Fixed the issue with the bar not moving when the alignment is set
    4. removed the notification sound
    5. small code rewrite in the service

    Grab it in the OP or on the market :D

    Pvy.
    3
    I used & followed this tuto : http://youtu.be/YgWd0jsDtH0

    if I used the plain SystemUI from APKTool\SystemUI\dist , I get neverending FC. upon reboot, the status bar is simply gone and even the launcher's "Notifications" soft menu option doesn't make it appear. gotta reflash the ROM to set things straight & get the statusbar back.

    if I copy/paste "resources.arsc" from APKTool\SystemUI\build\apk into the fresh SystemUI I obtain in APKTool\SystemUI\dist, there are no FC and the status bar shows, but your top bar mod isn't present, not even when repeatedly checking/unchecking/rechecking "show battery bar" in your app.

    it doesn't take a rocket scientist to understand & follow your tutorial, so I believe that my problem comes from somewhere in the recompiling process...
    at work now, whenever I have 10min, I'll upload my systemUI apks

    OK my gimme 5 i'll edit the op with my full decompile/compile process

    EDIT*** all done. hope it is enough... i really had to think on how to word it all LOL!

    also the file in apktool/[apk name]/dist
    has no signatures and will not run (from memory)

    Pvy.