Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,721 Members 51,788 Now Online
XDA Developers Android and Mobile Development Forum

[MOD][ICS][9'Jun] * Battery Mod Tool * ALL CM9/Samsung ROMs *

Tip us?
 
semdoc
Old
#951  
semdoc's Avatar
Senior Member
Thanks Meter 1614
Posts: 2,153
Join Date: Mar 2011
Location: Istanbul

 
DONATE TO ME
Quote:
Originally Posted by claude96 View Post
@semdoc maybe I know why, about making a java path ( sorry I was very busy ), but here goes : in windows (64bit) go to control panel, system at the top right press Advanced system settings, a window will pop out, in that window press Environment Variables, another window will pop out, now in that window in System variables , look for Path and press on it once, then press the edit button, at the end of Variable value, copy&paste this : ;C:\Program Files\Java\jdk1.7.0_03\bin\java.exe ( PS : first change jdk1.7.0_03 to the java version on your PC, just go to : C:\Program Files\Java\ , also C: should be changed to where you OS is installed ), check the pics, hope this helps.
Thank you for your help claude96, All stated settings are DONE.

Same Error
Htc ONE M7 Int:

ROM: AICP KitKat 4.4.4

Nexus 7 2013 LTE (deb):

ROM: AICP KitKat 4.4.4

Daily AICP KitKat 4.4.4 Builds for m7 | deb | flo

AICP (Android Ice Cold Project) COMMUNITY ON Google +
 
adit17
Old
#952  
Senior Member
Thanks Meter 9
Posts: 119
Join Date: Sep 2011
Location: Bekasi
Quote:
Originally Posted by shayne77 View Post
It means SystemUI can't be decompiled using conventional methods anyway.
Attach your SystemUI and I'll have a look.

sent from my XOOM using XDA Premium HD
here you go, thanks for your help
Attached Files
File Type: apk SystemUI.apk - [Click for QR Code] (1.27 MB, 3 views)
Device : Samsung Galasy S II i9100
ROM : Tester for any new JB ROM
 
claude96
Old
#953  
claude96's Avatar
Senior Member
Thanks Meter 1632
Posts: 1,086
Join Date: Mar 2010
Quote:
Originally Posted by semdoc View Post
Thank you for your help claude96, All stated settings are DONE.

Same Error
ok, then do the same steps, and copy/paste this ( without the quotes ) at the end of Path ( ;C:Program Files (x86)\Android\android-sdk\platform-tools\ ) , press OK to all, reboot , pu the battery tool file in your username folder, and try it, hope this helps.
PS : you have installed android sdk !, right ?
The Following User Says Thank You to claude96 For This Useful Post: [ Click to Expand ]
 
semdoc
Old
#954  
semdoc's Avatar
Senior Member
Thanks Meter 1614
Posts: 2,153
Join Date: Mar 2011
Location: Istanbul

 
DONATE TO ME
Quote:
Originally Posted by claude96 View Post
ok, then do the same steps, and copy/paste this ( without the quotes ) at the end of Path ( ;C:Program Files (x86)\Android\android-sdk\platform-tools\ ) , press OK to all, reboot , pu the battery tool file in your username folder, and try it, hope this helps.
PS : you have installed android sdk !, right ?
:P....

Please don't shoot me ... Nope, but it doesn't said that I have to... Ok... Will install nd will try again.... Sorry!

Sent from my TF201 using XDA Pre HD app
Htc ONE M7 Int:

ROM: AICP KitKat 4.4.4

Nexus 7 2013 LTE (deb):

ROM: AICP KitKat 4.4.4

Daily AICP KitKat 4.4.4 Builds for m7 | deb | flo

AICP (Android Ice Cold Project) COMMUNITY ON Google +
 
claude96
Old
(Last edited by claude96; 25th April 2012 at 03:16 PM.)
#955  
claude96's Avatar
Senior Member
Thanks Meter 1632
Posts: 1,086
Join Date: Mar 2010
Quote:
Originally Posted by semdoc View Post
:P....

Please don't shoot me ... Nope, but it doesn't said that I have to... Ok... Will install nd will try again.... Sorry!

Sent from my TF201 using XDA Pre HD app
No problem, just remove the sdk tools path b4 you install the sdk, then download the sdk tools, then re-ad the path reboot & good luck.
PS: b4 that, just move the batt_tool to your user folder, and try it, also right click the bat file & run as admin, see if this works.
PPS : did you change the java version to the one on your PC !
 
cielik
Old
#956  
cielik's Avatar
Senior Member
Thanks Meter 20
Posts: 105
Join Date: Oct 2010
Location: Minsk Maz.
Mod works great, thanks for the post
One_M8
GT-P3100
 
shayne77
Old
(Last edited by shayne77; 26th April 2012 at 12:41 AM.)
#957  
Senior Member - OP
Thanks Meter 692
Posts: 1,638
Join Date: Mar 2011
Location: Gold Coast

 
DONATE TO ME
Quote:
Originally Posted by dixit View Post
I think there is a bug in this. I dont think its a bug in your script but more maybe an issue with 7za.exe -u command that is being run.

I noticed in the output folder that the SystemUI.apk is not fully updating all the battery images. So I extracted that newly built apk with 7zip. Then looked at the drawable-hdpi folder and noticed all the original icons are still there like "stat_sys_battery_15.png" but the other ones were added. So it seems like it added all 204 PNGs but failed to overwrite the existing ones.

I see in your batch file you are calling this cmd to update the PNGs:

7za.exe u SystemUI.zip res\drawable-hdpi\*.png > nul

Now if I manually run that by say calling:
7za.exe u SystemUI.zip res\drawable-hdpi\stat_sys_battery_15.png > nul
It still doesnt update that _15.png. So for some reason the cmd line "-u" is not actually overwriting existing files. If you use the filemanager gui portion of 7zip then it works fine.

So.... you might want to look into that for folks that might be using the APK directly instead of using the flashable zip. I couldnt find any particular switch to force the overwrite.

Dixit
Quote:
Originally Posted by GeyerA View Post
Hello shayne77, I can't stop looking at my circle and noticed today that it went back to the "stock" CM battery. So I re-copied (overwrote) the file SystemsUI.apk in the app folder and circle returned. Later, while browsing and using internet connection (IM), I saw again the CM stock battery coming back. I ignored it, and out of the blue, the circle returned. Is there some other place the system gets the battery pic from? Is there any mistake I could have made? Should I wike Dalvik and flash the .zip...? I will try on my Thunderbolt and Nexus One tonight (on CM beta:)
I checked this out and it seems fine on my system. [See screenshot attached]
For some reason, I reckon the APK is being set to read-only while I import the images on your systems. Try right-clicking the Battery Mod folder and unchecking read-only (apply to sub-directories as well) and see how you go.

EDIT: If you look at files 15 and 28 in the screenshot, you will see they've been updated. Also, check my directory is the same as well.
Attached Thumbnails
Click image for larger version

Name:	Battery_mod_Check.jpg
Views:	128
Size:	250.1 KB
ID:	1025006  
Samsung Galaxy S4 mini: running...
ROM: KK-4.4.2: CM.11 Nightlies
Google Nexus 7: running...
ROM: KK-4.4.2: CM.11 Nightlies

Retired, hall of fame:
Google Nexus 4
Samsung Galaxy S2
 
dixit
Old
(Last edited by dixit; 26th April 2012 at 01:21 AM.) Reason: more info
#958  
dixit's Avatar
Senior Member
Thanks Meter 64
Posts: 216
Join Date: Apr 2006
Location: ATL
Quote:
Originally Posted by shayne77 View Post
I checked this out and it seems fine on my system. [See screenshot attached]
For some reason, I reckon the APK is being set to read-only while I import the images on your systems. Try right-clicking the Battery Mod folder and unchecking read-only (apply to sub-directories as well) and see how you go.

EDIT: If you look at files 15 and 28 in the screenshot, you will see they've been updated. Also, check my directory is the same as well.
For sure yours works as your screenshot proves that. I checked my readonly and made sure its off, tried it again, still the stock files like 15, 28, 43, etc are still not being updated.

Also just went to Command Prompt as Admin then manually called your BAT file and it ran fine as Admin thinking maybe its permissions, but it still created an APK without the original stock ones updated like 15, 28, 43, etc.

What I cant get is why when you actually manually run the 7zip command manually from the command line using the -u it still doesnt update it, acts like the command ran fine, but inside it didnt update the file at all.

Now its going to bug me to find out why on my system it dont work when on yours it does. Time to do more digging, try another system if i can and maybe then try to find out why this fails to update the stock images that exist.

Dixit

---------- Post added at 08:34 PM ---------- Previous post was at 08:17 PM ----------

Alright well I think I narrowed it down some more. I used a different Framework-res.apk and SystemUI.apk and it worked fine, one from a different rom (actually from a GB rom). Original one I kept trying was from an ICS based Rom.

So then tried a different ICS's ROM set of Framework-res.apk and SystemUI.apk. Still failed on the same 15, 28, 43, etc stock files not being over written.

So then tried a 3rd different ICS ROM using its Framework-res.apk and SystemUI.apk and what you know, it flipping WORKED! So not sure what these other two have done in the SystemUI.apk but clearly the 7zip cmd line using -u cant seem to overwrite the existing stock images and leaves them in place but just adds all the other new ones.

Dixit
 
shayne77
Old
#959  
Senior Member - OP
Thanks Meter 692
Posts: 1,638
Join Date: Mar 2011
Location: Gold Coast

 
DONATE TO ME
Quote:
Originally Posted by dixit View Post
For sure yours works as your screenshot proves that. I checked my readonly and made sure its off, tried it again, still the stock files like 15, 28, 43, etc are still not being updated.

Also just went to Command Prompt as Admin then manually called your BAT file and it ran fine as Admin thinking maybe its permissions, but it still created an APK without the original stock ones updated like 15, 28, 43, etc.

What I cant get is why when you actually manually run the 7zip command manually from the command line using the -u it still doesnt update it, acts like the command ran fine, but inside it didnt update the file at all.

Now its going to bug me to find out why on my system it dont work when on yours it does. Time to do more digging, try another system if i can and maybe then try to find out why this fails to update the stock images that exist.

Dixit

---------- Post added at 08:34 PM ---------- Previous post was at 08:17 PM ----------

Alright well I think I narrowed it down some more. I used a different Framework-res.apk and SystemUI.apk and it worked fine, one from a different rom (actually from a GB rom). Original one I kept trying was from an ICS based Rom.

So then tried a different ICS's ROM set of Framework-res.apk and SystemUI.apk. Still failed on the same 15, 28, 43, etc stock files not being over written.

So then tried a 3rd different ICS ROM using its Framework-res.apk and SystemUI.apk and what you know, it flipping WORKED! So not sure what these other two have done in the SystemUI.apk but clearly the 7zip cmd line using -u cant seem to overwrite the existing stock images and leaves them in place but just adds all the other new ones.

Dixit
Ah. It's gotta be how they're creating (or modding) those APKs then. They must be compressed differently and/or the files inside the ZIP have different attributes.
Samsung Galaxy S4 mini: running...
ROM: KK-4.4.2: CM.11 Nightlies
Google Nexus 7: running...
ROM: KK-4.4.2: CM.11 Nightlies

Retired, hall of fame:
Google Nexus 4
Samsung Galaxy S2
 
dixit
Old
#960  
dixit's Avatar
Senior Member
Thanks Meter 64
Posts: 216
Join Date: Apr 2006
Location: ATL
Quote:
Originally Posted by shayne77 View Post
Ah. It's gotta be how they're creating (or modding) those APKs then. They must be compressed differently and/or the files inside the ZIP have different attributes.
If it helps any, I think/wonder it might have to do with actually the "Host OS" and Version. Notice in the screenshot I highlighted the stock file that didnt get updated, you notice how its HostOS is Unix and Version number is higher (20) then the ones you added which are 10. I wonder if the cmd lind 7zip -u command wont update it if the version is lower then whats going in or if it fails cause the HostOS is wrong. Thats something that caught my eye on why two of the ROM set files I used failed, but the 3rd one worked, that 3rd one, all stock files are in the APK itself are FAT on HostOS and 10 on Version.

Dixit
Attached Thumbnails
Click image for larger version

Name:	PossibleReason.JPG
Views:	112
Size:	123.2 KB
ID:	1025051  

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes