Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
phimuskapsi
Old
#1  
Senior Member - OP
Thanks Meter 8
Posts: 126
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
Default Modifying .xml's that are encoded into resources.arsc

Ok this is a quick little guide. Decided not to put this in the notification text thread as that needs to be cleaned up anyway.

This is for modifying .xml's in say /values or wherever you want. This particular example is going to use /values/styles.xml

First up, decode your framework using apktool
** Make a backup! **
Code:
: adb pull /system/framework/framework-res.apk /sdcard/mytheme/backup.apk
: adb pull /system/framework/framework-res.apk C:\themes\mytheme.apk
: apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
Quote:
Then open up the /res/values/styles.xml.
Find "<style name="Widget.Button" parent="@style/Widget">
Change the textcolor to #FFFF0000
This will make all buttons have a RED text color.
Now re-encode the file

Code:
:apktool b C:\themes\mytheme\decoded C:\themes\mytheme\encoded\mytheme-new.apk
Quote:
Now, the simplest thing to do is to do the following:
- Open the original C:\themes\mytheme.apk with 7-zip
- Drag and drop the META-INF and AndroidManifest.xml File into a folder, like C:\themes\mytheme\signed
* Now you have a copy you can always use, and skip the above steps after doing it once *
- Open the new encoded mytheme-new.apk with 7-zip
- Drag and drop the META-INF and AndroidManifest.xml from the \signed directory
Code:
: adb push C:\themes\mytheme\encoded\mytheme-new.apk /sdcard/mytheme/framework-res.apk
: adb remount (if available for you!)
: adb shell
**Only if remount doesn't work.**
: mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system 
: cp /sdcard/mytheme/framework-res.apk /system/framework/framework-res.apk
Quote:
**Wait for the theme to apply, no need to reboot**
**If you Bootloop and stay in shell (which you should if you don't reboot)**
Code:
: cp /sdcard/mytheme/backup.apk /system/framework/framework-res.apk
Quote:
**After this the bootloops should stop as your last stable framework is loaded**
That's it!

Questions? Comments? Leave em!
No more theme development for me...too much work for a thankless job :P

Gonna step up my game to an HTC One on 4/19!

http://www.twitter.com/phimuskapsi
http://www.xperimentalcode.com
The Following User Says Thank You to phimuskapsi For This Useful Post: [ Click to Expand ]
 
benclayton
Old
#2  
Member
Thanks Meter 0
Posts: 55
Join Date: Jul 2010
So, for instance, in the Vanilla Froyo theme for 2.1, where all of the text elements that should be a dark grey or black are white, this would allow me to change them?
 
phimuskapsi
Old
#3  
Senior Member - OP
Thanks Meter 8
Posts: 126
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
Yep. Just a matter of figuring out which style controls what...that's next on my list to document lol. It's a LOT easier than trying to Hex Edit everything.
No more theme development for me...too much work for a thankless job :P

Gonna step up my game to an HTC One on 4/19!

http://www.twitter.com/phimuskapsi
http://www.xperimentalcode.com
 
benclayton
Old
#4  
Member
Thanks Meter 0
Posts: 55
Join Date: Jul 2010
I'm really surprised this thread isn't exploding with questions, but I have to say great work, man!

I'm gonna wait it out until I know my way around the SDK a little more, but I really wanna dig through this and finish the Vanilla theme I'm using.
 
phimuskapsi
Old
#5  
Senior Member - OP
Thanks Meter 8
Posts: 126
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
Thanks! I should make one big guide get it stickied and be fine with it lol. You can check out my vanilla theme fire an idea of what I've done.

Sent from my DROIDX using XDA App
No more theme development for me...too much work for a thankless job :P

Gonna step up my game to an HTC One on 4/19!

http://www.twitter.com/phimuskapsi
http://www.xperimentalcode.com
 
NegativeOne
Old
#6  
Senior Member
Thanks Meter 108
Posts: 632
Join Date: Jul 2010
Great tutorial man. I especially appreciate the part about not having to reboot. I wonder why everyone always says to do that for installing themes.
 
kevdog
Old
#7  
Senior Member
Thanks Meter 4
Posts: 150
Join Date: Jan 2010
If you use apkmanager (which is a frontend for apktool) -- it automates some of the steps mentioned here. Its in the G1 development section as well as apktool.
 
RaiBinger
Old
(Last edited by RaiBinger; 28th December 2010 at 09:55 AM.)
#8  
Member
Thanks Meter 0
Posts: 50
Join Date: Oct 2010
Location: Ukhta
Not work...
Very sad
After complete all steps, device not boot after LG lable longer.
Any ideas?
log cmd in process:
Code:
D:\Android\SDKTools\tools>apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...

D:\Android\SDKTools\tools>apktool b C:\themes\mytheme\decoded C:\themes\mytheme\encoded\mytheme-new.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
 
SysAdmin-X
Old
#9  
Senior Member
Thanks Meter 167
Posts: 675
Join Date: Sep 2010

 
DONATE TO ME
Quote:
Originally Posted by phimuskapsi View Post
Thanks! I should make one big guide get it stickied and be fine with it lol. You can check out my vanilla theme fire an idea of what I've done.

Sent from my DROIDX using XDA App
Phim, you're the best! I have been searching for a simple guide like this, as I found one a while ago when theming, but lost the link. Thanks for all your contributions on here, they are greatly appreciated! If I have some questions on editing some xml files, can I shoot you a PM or two?

Sent from my DROIDX using XDA App
If I've helped you out, feel free to hit that cool little thanks button down and to the right
 
SysAdmin-X
Old
(Last edited by SysAdmin-X; 30th December 2010 at 04:47 AM.)
#10  
Senior Member
Thanks Meter 167
Posts: 675
Join Date: Sep 2010

 
DONATE TO ME
I am trying to edit the color of the text in the drop down notification bar for the text such as USB Connection.

Can someone please tell me which xml file and which portion needs to be edited?

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...

XDA PORTAL POSTS

Gear Up Because it’s Time to Save Earth

*Cue Dramatic Music*Put on your red and blue latex overalls and cape because it’s time to … more

Recognized Contributor Code of Conduct

During the first half of 2012, XDA initiated the Recognized Contributor (RC) program to recognize … more

Careers in Android: What Hiring Managers Won’t Tell You – XDA Developer TV

XDA Developer TV Producer Jayce released a video a … more