Galaxy S6 & Edge get €100 Price Cut—New Models Incoming

Samsung has dropped the price of both the Galaxy S6 and S6 Edge by … more

How To Port Fully Featured Sony Xperia Z4 Camera

Xperia Z4’s hardware may not impress, but its software is definitely … more

Experimental TWRP Available For Moto G 2015

XDA Senior Member squid2 has posted experimental builds of TWRP for the Moto G … more

Sunday Debate: How Can We Get a No-Compromise Phone?

Join us in a fun Sunday Debate on Compromises. Come with your opinions and … more

[Q] Trying to mod framework-res.apk, what am I doing wrong ???

262 posts
Thanks Meter: 26
By BlueScreenJunky, Senior Member on 22nd May 2011, 07:24 AM
Post Reply Subscribe to Thread Email Thread
Hello everyone, I hope this belongs to the dev section, if not feel free to move it. Anyway, I'm trying to mod the framework-res.apk in order to include battery percentage and maybe change a few other things. Anyway, I've looked at already modified files and some threads for different phones and thought I knew how to do it, but it doesn't work.
So here's what I'm doing, I hope someone can tell me what's wrong :
1-I installed XKE7 and then flashed the XDDD insecure kernel over it.
2-I got the framework-res.apk through adb pull
3-I decompiled it with apktool d
4-added a bunch of png files in res/drawable-hdpi/ (stat_sys_battery_0.png to stat_sys_battery_100.png)
5-modified the /res/drawable/stat_sys_battery.xml file so that it looks like this :
<level-list xmlns:android="">
<item android:drawable="@drawable/stat_sys_battery_0" android:maxLevel="0"/>
<item android:drawable="@drawable/stat_sys_battery_1" android:maxLevel="1"/>
<item android:drawable="@drawable/stat_sys_battery_2" android:maxLevel="2"/>
<item android:drawable="@drawable/stat_sys_battery_3" android:maxLevel="3"/>
<item android:drawable="@drawable/stat_sys_battery_4" android:maxLevel="4"/>
<item android:drawable="@drawable/stat_sys_battery_5" android:maxLevel="5"/>
<item android:drawable="@drawable/stat_sys_battery_6" android:maxLevel="6"/>
<item android:drawable="@drawable/stat_sys_battery_7" android:maxLevel="7"/>
<item android:drawable="@drawable/stat_sys_battery_8" android:maxLevel="8"/>
<item android:drawable="@drawable/stat_sys_battery_9" android:maxLevel="9"/>
<item android:drawable="@drawable/stat_sys_battery_10" android:maxLevel="10"/>
<item android:drawable="@drawable/stat_sys_battery_11" android:maxLevel="11"/>
<item android:drawable="@drawable/stat_sys_battery_12" android:maxLevel="12"/>
<item android:drawable="@drawable/stat_sys_battery_13" android:maxLevel="13"/>
<item android:drawable="@drawable/stat_sys_battery_14" android:maxLevel="14"/>
<item android:drawable="@drawable/stat_sys_battery_15" android:maxLevel="15"/>
<item android:drawable="@drawable/stat_sys_battery_16" android:maxLevel="16"/>
<item android:drawable="@drawable/stat_sys_battery_17" android:maxLevel="17"/>
<item android:drawable="@drawable/stat_sys_battery_18" android:maxLevel="18"/>
<item android:drawable="@drawable/stat_sys_battery_19" android:maxLevel="19"/>
<item android:drawable="@drawable/stat_sys_battery_20" android:maxLevel="20"/>
<item android:drawable="@drawable/stat_sys_battery_21" android:maxLevel="21"/>
<item android:drawable="@drawable/stat_sys_battery_22" android:maxLevel="22"/>
<item android:drawable="@drawable/stat_sys_battery_23" android:maxLevel="23"/>
<item android:drawable="@drawable/stat_sys_battery_24" android:maxLevel="24"/>
<item android:drawable="@drawable/stat_sys_battery_25" android:maxLevel="25"/>
<item android:drawable="@drawable/stat_sys_battery_26" android:maxLevel="26"/>
<item android:drawable="@drawable/stat_sys_battery_27" android:maxLevel="27"/>
<item android:drawable="@drawable/stat_sys_battery_28" android:maxLevel="28"/>
<item android:drawable="@drawable/stat_sys_battery_29" android:maxLevel="29"/>
<item android:drawable="@drawable/stat_sys_battery_30" android:maxLevel="30"/>
<item android:drawable="@drawable/stat_sys_battery_31" android:maxLevel="31"/>
<item android:drawable="@drawable/stat_sys_battery_32" android:maxLevel="32"/>
<item android:drawable="@drawable/stat_sys_battery_33" android:maxLevel="33"/>
<item android:drawable="@drawable/stat_sys_battery_34" android:maxLevel="34"/>
<item android:drawable="@drawable/stat_sys_battery_35" android:maxLevel="35"/>
<item android:drawable="@drawable/stat_sys_battery_36" android:maxLevel="36"/>
<item android:drawable="@drawable/stat_sys_battery_37" android:maxLevel="37"/>
<item android:drawable="@drawable/stat_sys_battery_38" android:maxLevel="38"/>
<item android:drawable="@drawable/stat_sys_battery_39" android:maxLevel="39"/>
<item android:drawable="@drawable/stat_sys_battery_40" android:maxLevel="40"/>
<item android:drawable="@drawable/stat_sys_battery_41" android:maxLevel="41"/>
<item android:drawable="@drawable/stat_sys_battery_42" android:maxLevel="42"/>
<item android:drawable="@drawable/stat_sys_battery_43" android:maxLevel="43"/>
<item android:drawable="@drawable/stat_sys_battery_44" android:maxLevel="44"/>
<item android:drawable="@drawable/stat_sys_battery_45" android:maxLevel="45"/>
<item android:drawable="@drawable/stat_sys_battery_46" android:maxLevel="46"/>
<item android:drawable="@drawable/stat_sys_battery_47" android:maxLevel="47"/>
<item android:drawable="@drawable/stat_sys_battery_48" android:maxLevel="48"/>
<item android:drawable="@drawable/stat_sys_battery_49" android:maxLevel="49"/>
<item android:drawable="@drawable/stat_sys_battery_50" android:maxLevel="50"/>
<item android:drawable="@drawable/stat_sys_battery_51" android:maxLevel="51"/>
<item android:drawable="@drawable/stat_sys_battery_52" android:maxLevel="52"/>
<item android:drawable="@drawable/stat_sys_battery_53" android:maxLevel="53"/>
<item android:drawable="@drawable/stat_sys_battery_54" android:maxLevel="54"/>
<item android:drawable="@drawable/stat_sys_battery_55" android:maxLevel="55"/>
<item android:drawable="@drawable/stat_sys_battery_56" android:maxLevel="56"/>
<item android:drawable="@drawable/stat_sys_battery_57" android:maxLevel="57"/>
<item android:drawable="@drawable/stat_sys_battery_58" android:maxLevel="58"/>
<item android:drawable="@drawable/stat_sys_battery_59" android:maxLevel="59"/>
<item android:drawable="@drawable/stat_sys_battery_60" android:maxLevel="60"/>
<item android:drawable="@drawable/stat_sys_battery_61" android:maxLevel="61"/>
<item android:drawable="@drawable/stat_sys_battery_62" android:maxLevel="62"/>
<item android:drawable="@drawable/stat_sys_battery_63" android:maxLevel="63"/>
<item android:drawable="@drawable/stat_sys_battery_64" android:maxLevel="64"/>
<item android:drawable="@drawable/stat_sys_battery_65" android:maxLevel="65"/>
<item android:drawable="@drawable/stat_sys_battery_66" android:maxLevel="66"/>
<item android:drawable="@drawable/stat_sys_battery_67" android:maxLevel="67"/>
<item android:drawable="@drawable/stat_sys_battery_68" android:maxLevel="68"/>
<item android:drawable="@drawable/stat_sys_battery_69" android:maxLevel="69"/>
<item android:drawable="@drawable/stat_sys_battery_70" android:maxLevel="70"/>
<item android:drawable="@drawable/stat_sys_battery_71" android:maxLevel="71"/>
<item android:drawable="@drawable/stat_sys_battery_72" android:maxLevel="72"/>
<item android:drawable="@drawable/stat_sys_battery_73" android:maxLevel="73"/>
<item android:drawable="@drawable/stat_sys_battery_74" android:maxLevel="74"/>
<item android:drawable="@drawable/stat_sys_battery_75" android:maxLevel="75"/>
<item android:drawable="@drawable/stat_sys_battery_76" android:maxLevel="76"/>
<item android:drawable="@drawable/stat_sys_battery_77" android:maxLevel="77"/>
<item android:drawable="@drawable/stat_sys_battery_78" android:maxLevel="78"/>
<item android:drawable="@drawable/stat_sys_battery_79" android:maxLevel="79"/>
<item android:drawable="@drawable/stat_sys_battery_80" android:maxLevel="80"/>
<item android:drawable="@drawable/stat_sys_battery_81" android:maxLevel="81"/>
<item android:drawable="@drawable/stat_sys_battery_82" android:maxLevel="82"/>
<item android:drawable="@drawable/stat_sys_battery_83" android:maxLevel="83"/>
<item android:drawable="@drawable/stat_sys_battery_84" android:maxLevel="84"/>
<item android:drawable="@drawable/stat_sys_battery_85" android:maxLevel="85"/>
<item android:drawable="@drawable/stat_sys_battery_86" android:maxLevel="86"/>
<item android:drawable="@drawable/stat_sys_battery_87" android:maxLevel="87"/>
<item android:drawable="@drawable/stat_sys_battery_88" android:maxLevel="88"/>
<item android:drawable="@drawable/stat_sys_battery_89" android:maxLevel="89"/>
<item android:drawable="@drawable/stat_sys_battery_90" android:maxLevel="90"/>
<item android:drawable="@drawable/stat_sys_battery_91" android:maxLevel="91"/>
<item android:drawable="@drawable/stat_sys_battery_92" android:maxLevel="92"/>
<item android:drawable="@drawable/stat_sys_battery_93" android:maxLevel="93"/>
<item android:drawable="@drawable/stat_sys_battery_94" android:maxLevel="94"/>
<item android:drawable="@drawable/stat_sys_battery_95" android:maxLevel="95"/>
<item android:drawable="@drawable/stat_sys_battery_96" android:maxLevel="96"/>
<item android:drawable="@drawable/stat_sys_battery_97" android:maxLevel="97"/>
<item android:drawable="@drawable/stat_sys_battery_98" android:maxLevel="98"/>
<item android:drawable="@drawable/stat_sys_battery_99" android:maxLevel="99"/>
<item android:drawable="@drawable/stat_sys_battery_100" android:maxLevel="100"/>
6-built a new apk from these files with apktool b
7-extracted the content of this new apk and integrated it to my original one
8-pushed with adb push

So the phone boots, but it displays a ? instead of my battery icons.... I've spent a few hours on that already and am really at a loss. Could someone help please ?
22nd May 2011, 08:58 AM |#2  
padlad's Avatar
Senior Member
Thanks Meter: 424
Why don't you just use the UOT kitchen? Its a hell of a lot easier than doing it all yourself.
22nd May 2011, 09:00 AM |#3  
walda's Avatar
Senior Member
Thanks Meter: 243
Donate to Me
I would do the following:

* Extract your framework-res.apk
* let UOT cook a new one with Battery Mod
* replace png in the UOT cooked apk

no decompilation and so on needed.
22nd May 2011, 09:04 AM |#4  
Senior Member
Thanks Meter: 46
Originally Posted by walda

I would do the following:

* Extract your framework-res.apk
* let UOT cook a new one with Battery Mod
* replace png in the UOT cooked apk

no decompilation and so on needed.

That's it?
No Decompilation, no editing the xml?
Only UOT Kitchen and ready?
The Following User Says Thank You to spline1 For This Useful Post: [ View ]
22nd May 2011, 09:12 AM |#5  
walda's Avatar
Senior Member
Thanks Meter: 243
Donate to Me
if u only want to change the pictures, yes. UOT does the rest for you. UOT changes the xml files für 1% steps while loading and so on.

you can change every picture, if the pic already exists in the apk by simply copýing another over it. no decompile needed.

Same in SysytemUI.apk. So you can simply change to "green google" icons.
22nd May 2011, 09:27 AM |#6  
BlueScreenJunky's Avatar
OP Senior Member
Thanks Meter: 26
Thanx, I might do that. I wasn't sure if UOT worked with SGS2.

Although the point of doing it myself was in great part to learn how to do it. So I'm still curious about what I was doing wrong...
22nd May 2011, 09:27 AM |#7  
Senior Member
Thanks Meter: 46
i test it on the new firmware in future.
I extract the framework, put it on the uot, let's cooking and copy in the phone ;)
23rd May 2011, 03:24 PM |#8  
Senior Member
Thanks Meter: 6
BlueScreenJunky can you please post your stock unmodified KE7 framework-res.apk file? As I've *ucked up mine ..
23rd May 2011, 03:41 PM |#9  
BlueScreenJunky's Avatar
OP Senior Member
Thanks Meter: 26
haha, sorry I lost mine too
I'm using This one at the moment (or at least I got a very similar result to this one using the UOT kitchen). I'll wait for the next update or next time I brick my phone to get the original unmodified apk.

Still don't understand how to manually edit the xml though, and still curious about it.
The Following User Says Thank You to BlueScreenJunky For This Useful Post: [ View ]
23rd May 2011, 04:18 PM |#10  
Senior Member
Thanks Meter: 14
Here's mine, (remove spaces in link because i cant post links yet, not enough posts), i hope this breach of user agreement will be tolerated for trying to help someone

http :// dl . dropbox . com / u / 7741811 / framework-res.apk
The Following User Says Thank You to DruNKfuX For This Useful Post: [ View ]
23rd May 2011, 05:35 PM |#11  
BlueScreenJunky's Avatar
OP Senior Member
Thanks Meter: 26
Thanx !

Sent from my GT-I9100 using XDA App

Read More
Post Reply Subscribe to Thread

framework-res.apk, mod, samsung, sgs2
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes