[HOW-TO]Hex edit resources.arsc from

1,739 posts
Thanks Meter: 3,810
By ViNOK16Bit, Recognized Themer on 26th November 2013, 02:40 PM
Post Reply Email Thread
I wrote this "How-to" because I haven't found such a thing on XDA or Google yet and it maybe helpful to others.

I have based this little guide on ViperOne which is Sense based. So things might be different on other ROM resource files.

As a lot of you out there know editing may cause issues when trying to decompile and compile. And when successfully compiled there probably are issues. Some don't care about it but others do.

This guide is to help anyone that successfully decompiled and edited the colors.xml in the res folder to use this custom colours in their theme or ROM. I changed only colors.xml and no other xml files so some things may be different if you edit other files that will compile in resources.arsc. If you have, then simply compare your resources.arsc with the stock one to see where the differences are. U can use KDiff3 or Beyond Compare to do this for example.

First. If you have any issues with decompiling and / or compiling with apktool take a look at this thread by @he_stheone64

or if you use Virtuous Ten Studio use the method of @Ajthescot here

Now, you have edited your colors.xml and compiled the apk. The apk or the resources.arsc flashes fine in your theme but you will end up with bad battery life and at medium sticking font size. What you have to do to fix this is hex edit the original resources.arsc from to match the changes you made in the colors.xml

This is how I do it:
Pull the resources.arsc from the original and place it on the desktop. Open the file in an hex editor (I use HxD Hex Editor)
To look up the beginning of the colors.xml search for e5 b5 33 (in hex it’s reversed so you probably are not going to find 33 b5 e5). It should be line 0022F3E0 for Android 4.3 and line 0022E2A0 for Android 4.4 which is the beginning of the colors.xml. On 4.4.2 it is 0022F7D0.

Now change the stock hex colours to the hex colours you have in your modified colors.xml. Work from the top to the bottom and look carefully at the ones you didn't change so you know where you are.
When you are done save the file and put the resources.arsc you just edited in the for your theme or ROM or in your vrtheme folder. Flash the theme and enjoy your work without issues!
Credits to @Basil3 who point me in the right direction!
The Following 11 Users Say Thank You to ViNOK16Bit For This Useful Post: [ View ] Gift ViNOK16Bit Ad-Free
26th November 2013, 02:41 PM |#2  
ViNOK16Bit's Avatar
OP Recognized Themer
Flag New Joke
Thanks Meter: 3,810
Donate to Me
Just in case...
28th November 2013, 10:38 PM |#3  
Senior Member
Thanks Meter: 98
Donate to Me
Thanks for excellent tips. Really useful as I was looking for this.

What I did was:
a) pulled the original Resources.arsc and open it HxD,
b) then, in HxD I opened the same file from the which I had built earlier with VTS including altered colors.xml
c) noticed that the number of lines in original and in my build were different so the line numbers (0022F3E0) did not match
d) I used search to find first altered color code, once found
e) resized the tabs in HxD for comparison, "synced" the lines in the tabs/windows on the same hight
f) slided the tab showing the initial resources.arsc on the left, on top of the other one so that the color codes from both files would be as close each other as possible.
g) did the changes and saved

See the attached pics to see above, unsaved changes are show as red on the left tab, on the original resources.arsc file. Can happily confirm that this method really works.
Attached Thumbnails
Click image for larger version

Name:	HxD.arsc.1.png
Views:	3052
Size:	95.7 KB
ID:	2421184   Click image for larger version

Name:	HxD.arsc.2.png
Views:	2896
Size:	62.2 KB
ID:	2421185  
The Following 5 Users Say Thank You to For This Useful Post: [ View ] Gift Ad-Free
20th December 2013, 10:03 AM |#4  
fisha21's Avatar
Senior Member
Thanks Meter: 4,306
This has been on my to do list for months, very happy to see someone beat me to it

Nicely explained mate

Sent from my HTC One using Tapatalk
The Following 3 Users Say Thank You to fisha21 For This Useful Post: [ View ] Gift fisha21 Ad-Free
20th December 2013, 12:31 PM |#5  
nashshafrulrezza's Avatar
Senior Member
Flag Johor Bahru
Thanks Meter: 1,437
Donate to Me
Nice one mate!! This will help a lot people around. Including me.

Ps : kanging @fisha21 theme still a priority. :P
Sent from my HTC One using Tapatalk
The Following 2 Users Say Thank You to nashshafrulrezza For This Useful Post: [ View ] Gift nashshafrulrezza Ad-Free
25th December 2013, 07:18 PM |#6  
Bellitsch89's Avatar
Senior Member
Flag Schermbeck
Thanks Meter: 293
Thx for this guide :thumbup:

Sent from my BLUE HTC ONE bitten by a Viper
The Following 2 Users Say Thank You to Bellitsch89 For This Useful Post: [ View ] Gift Bellitsch89 Ad-Free
1st February 2014, 01:35 PM |#7  
ViNOK16Bit's Avatar
OP Recognized Themer
Flag New Joke
Thanks Meter: 3,810
Donate to Me
OP updated

The beginning of colors.xml changes in each Android version:

Android 4.3 - 0022F3E0
Android 4.4 - 0022E2A0
Android 4.4.2 - 0022F7D0

It could be different depending on the rom you're editing.
The Following User Says Thank You to ViNOK16Bit For This Useful Post: [ View ] Gift ViNOK16Bit Ad-Free
Post Reply Subscribe to Thread

compile, hex edits, resources.arsc, theming, theming tutorial

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes