FORUMS
Remove All Ads from XDA

[Updated] - How-to Theme Development

1,203 posts
Thanks Meter: 413
 
By Stericson, Retired Senior Mod / Retired Senior RecDev - Godfather of Android Theming on 2nd January 2009, 12:22 PM
Thread Closed Email Thread
To create themes, or to edit themes to your liking, you will need a working knowledge of android, adb, how to resign apk's, knowledge of your own O/S.

Before you start be aware that you will may end up wiping your phone once, if not more. So lets go over the things that you will need.

You will need JF's RC30, RC8, or ADP1 V1.3, depending on what version you intend to create for.

Here is the link to these: http://forum.xda-developers.com/showthread.php?t=466174

You will also want to get the dev bootloader installed on your phone and to HIGHLY suggest everyone trying your theme to install it as well.

Link to dev bootloader: http://forum.xda-developers.com/showthread.php?t=455860

You will also need to resign all the apks located in /system/app and framework-res.apk located in /system/framework. When you push all of these to your phone.

JesusFreke was kind enough to build a custom signing tool for me that would allow me to right click on an apk and resign it from there. I am posting it here for others to use as well. Note that this is a courtesy of JF, so thank him for it. I cannot stress how much time this has saved me and will save you.

Here is the link: Http://www.FightForthePits.com/testsign(2).zip

Before using this you need to know how to set this up:

I will assume that you have the sdk downloaded and extracted somewhere(if not, do that now), extract both files to the tools directory of your sdk.

Now you will need to add the tools dir of your sdk to the environment variable CLASSPATH.(This is for XP, Vista coming soon)

To do this, right click on My Computer click properties, then choose the tab that says advanced. Click the button that says environmental variables. Go to system variables find the one that says CLASSPATH, double click it, go to the end of variable value. There should be a semicolon ; at the end. type in the path to the testsign.jar located in the tools directory of your SDK, for example the path to my testsign.jar was c:\sdk\android-sdk-windows-1.0_r1\tools\testsign.jar If CLASSPATH is not in your system variables then create it. Secondly, Find the system variable called PATH and add to the end of it, the full path to your sdk directory. For example, mine was c:\sdk\android-sdk-windows-1.0_r2\tools

Now right click the reg file that you extracted and choose to install it, or merge.

Now, right click an apk, do you see an option that says ResignApk? That's how you will resign your .apks and .zips.

If you find the right click menu not working for some reason you can type the following in cmd to sign your files: java testsign whateverfiletosign

Now through doing this you have done two things, first off you have made the resigning process extremely easy, secondly you will not have to cd to the tools dir of the sdk to use adb or any other tool in the sdk.

You will also need a version of linux installed or running vmware with linux, if you want to create, or edit, an update script, which will install the theme onto the users phone.

You will need to be specific in addressing what version your theme is for, RC8, RC30, or ADP1. Make sure every file gets signed. Make sure you test the update.zip before you release it.

Every .apk contains the images relating to itself. However, every apk has the ability to use the images in framework-res.apk. The images for every apk is located inside of itself. To find these images open up the apk, you can rename it to .zip or open it with an archiver of your choice, winrar, winace, etc. Then after opening the apk open the folder called res and inside of that there are folders that are named Drawable, drawable-land, drawable-port, etc. This is where the images are stored.

Ther are some things you cannot edit unless you rebuild the entire apk from source, which we will not go into here.(another tutorial, another time) Just know that at this time you SHOULD NOT edit, or even open images with the extension .9.png. If you do you will have problems...Trust me. These are special images called ninepatch images and android resizes these images to fit wherever android, or any other apk, needs it to. if you do open them or edit them they will no longer render correctly when resized. I believe that in order to edit these you must do so and then put them into the source and rebuild the entire apk.

Before getting started you must also realize that you cannot simply resign one or two apk's and stick them in your phone and expect them to work. You must resign every apk inside of /system/app and framework-res.apk and put them on your phone at the same time.

To simplify this process for you though, I have provided an empty update.zip which you can place all of your resigned apps into and use to update your phone to your custom theme. You can also download someonelses theme and use there files, since they are resigned already. It may also be easier to see what files do what and go where since they have already been edited and are easy to point out.


Now, your ready to start changing things up.

You will now need to open the apk, which you can do by adding .zip after .apk, effectively changing it to a zip. Note that if you are using windows you will need to unhide known file extension types. you can also use your favorite archiver such as winrar, winzip, etc.

See here to unhide known file extension types for Xp: http://www.mediacollege.com/microsof...on-change.html

See here to unhide file extension types for Vista: http://maximumpcguides.com/windows-v...ile-extension/


After opening the apk go to res and copy the folders that have drawable in their name. Go to your desktop, or wherever, create a new folder called Images, or whatever. Open the folder, paste the drawable folders in there. Now you can see what the files look like without opening them. Btw, you may also want to add -frame, or -launcher, to the end of the folders you cope over to keep them separated from others.

Finally, you've edited the images put them all in the apk renamed it back to an apk and resigned it. Now it's time to push it to your phone and see the changes you've made.

Important! : Whenever pushing files to the phone NEVER do it while the phone is running. Do this in recovery mode! If you do this while the phone is running normally you will begin to lose space in /system.

So, boot into recovery plug your phone in and open a cmd prompt. From the cmd prompt type adb shell mount /system then type the following: adb push c:\whereveryourfileis\whateveryourpushing.apk /system/app (system/framework if your pushing framework-res.apk)

Now reboot your phone. If it doesn't boot, try doing a wipe, if that doesn't work reinstall an update and try again. There are alot of things people can do wrong, I can't explain them all here. If you get real stuck, you can ask for help here or contact me on Gtalk Stericson.G1@gmail.com.

So now your theme is done and your ready to make an update.zip for others to install your theme.

I have created a template for you to make your own update.zip. Just download, add the system apps to app, and framework to framework. Zip it up, SIGN IT, TEST IT YOURSELF, and then distribute it!

Empty update.zip template: Http://www.FightForthePits.com/Andro...date_empty.zip

If anyone has any questions please try asking for help in this thread before emailing me for help Usually I will respond to questions in this forum.

I hope this Tutorial has been helpful. I will add on to it as needed.

Stericson

Links of interest:

Downloading SDK: http://code.google.com/android/intro/installing.html
Using ADB: http://code.google.com/android/reference/adb.html
The Following 4 Users Say Thank You to Stericson For This Useful Post: [ View ] Gift Stericson Ad-Free
 
 
2nd January 2009, 12:29 PM |#2  
jashsu's Avatar
Senior Member
Thanks Meter: 15
 
More
Working with ninepatch should be straightforward if you use the draw9patch tool included in the SDK. Documentation on usage here:

http://code.google.com/android/refer...raw9patch.html

JF could also save theme users a wipe by resigning /system/app/* and /system/framework/framework-res.apk in his builds with the test keys. Nice tutorial, btw.
2nd January 2009, 12:31 PM |#3  
Stericson's Avatar
OP Retired Senior Mod / Retired Senior RecDev - Godfather of Android Theming
Thanks Meter: 413
 
More
However it doesn't. I have used that to no avail. I believe you need to edit the images, put them in the source then rebuild the apks from the source.


As for JF's update, it does not currently wipe your phone after install. So, for him to do this he would have to have his update do a wipe. So technically, they would still have to do this initial wipe.

Stericson
2nd January 2009, 01:05 PM |#4  
jashsu's Avatar
Senior Member
Thanks Meter: 15
 
More
Quote:
Originally Posted by Stericson

However it doesn't. I have used that to no avail. I believe you need to edit the images, put them in the source then rebuild the apks from the source.

Good point. I thought you could simply drop a similarly dimensioned PNG in but apparently there is some metadata that only the android tool can create.

Quote:

As for JF's update, it does not currently wipe your phone after install. So, for him to do this he would have to have his update do a wipe. So technically, they would still have to do this initial wipe.

True, but a user who is upgrading to a JF update after having put in customized (and test-key signed) system apps will have to wipe again anyway =) Anyone using custom themes will have to wipe every time a JF update (or any update) comes out. However if JF resigns, custom theme users would not have to wipe and stock theme users only have to wipe once. (Nevermind the fact I think everyone should wipe when updating...)
2nd January 2009, 03:35 PM |#5  
kron2's Avatar
Senior Member
Thanks Meter: 1
 
More
thx stericson this will help big time how long before I can get resigned rc30 last night when you said all the apk. need to be resigned I was like this is going to be a long night but I see jf hooked you up save some big time with his resigning tool
2nd January 2009, 07:47 PM |#6  
Stericson's Avatar
OP Retired Senior Mod / Retired Senior RecDev - Godfather of Android Theming
Thanks Meter: 413
 
More
Quote:
Originally Posted by jashsu

Good point. I thought you could simply drop a similarly dimensioned PNG in but apparently there is some metadata that only the android tool can create.

True, but a user who is upgrading to a JF update after having put in customized (and test-key signed) system apps will have to wipe again anyway =) Anyone using custom themes will have to wipe every time a JF update (or any update) comes out. However if JF resigns, custom theme users would not have to wipe and stock theme users only have to wipe once. (Nevermind the fact I think everyone should wipe when updating...)

Ah, good point

The resigned apps will be released maybye sometime tonight...I had them done but ran into a script problem on adp1 and I have yet to try the rc30 and rc8 ones yet. so I won't release those until I've tested them. If you want to be a Guinea pig however, just let me know

Stericson
3rd January 2009, 07:02 AM |#7  
Stericson's Avatar
OP Retired Senior Mod / Retired Senior RecDev - Godfather of Android Theming
Thanks Meter: 413
 
More
Quote:
Originally Posted by Stericson

Ah, good point

The resigned apps will be released maybye sometime tonight...I had them done but ran into a script problem on adp1 and I have yet to try the rc30 and rc8 ones yet. so I won't release those until I've tested them. If you want to be a Guinea pig however, just let me know

Stericson

The resigned apps have been released, each update file will resign all of apps in /system/app and framework-res.apk. However, these updates make no changes to them whatsoever...Meaning your phone will look just like a brand new phone without any modifications.
3rd January 2009, 05:28 PM |#8  
kron2's Avatar
Senior Member
Thanks Meter: 1
 
More
rc30 works thx Stericson made it easy for use
4th January 2009, 07:26 PM |#9  
Junior Member
Thanks Meter: 0
 
More
Issues with using the update.zip above
Hi all,

I just wanted to point out that after I applied the update.zip above and rebooted applications kept force closing randomly and constantly even through the initial setup (where you have to click the green android to start).

Prior to this, I had JF's RC30 1.3, and the engineering bootloader V2 no sigcheck.

First I did just a alt+s then a alt-w and alt+s. And still nothing.

I'm new to all this so I'm not even sure where to begin troubleshooting. Should I be using the HardSPL?

Thanks in advance and I appologize if this isn't the right place for this post.

Update:
After reflashing with JF's 1.3 RC30 and the problem persisted I noticed that there was a new release 1.31 and this has fixed the problem. I hope this helps anyone else who runs into the same problem.

I still don't know what went wrong though, can anyone shed some light on this? thanks.
4th January 2009, 09:14 PM |#10  
Stericson's Avatar
OP Retired Senior Mod / Retired Senior RecDev - Godfather of Android Theming
Thanks Meter: 413
 
More
Truly there's no telling, sounds like J'f's update fixed it. Can I ask what version you tested?

I would also like to announce that now, thanks to JF, again, you do not have to wipe your phone completely to apply the resigned app updates. However, you will have to re-enter your google info and your call history and other minor things will be gone, but all of your apps will be retained.

Stericson
5th January 2009, 06:08 PM |#11  
brandenk's Avatar
Senior Member
Flag San Diego
Thanks Meter: 78
 
More
Alright, I am a little confused........

So I downloaded testsign.zip and extracted it to the tools folder. Then I went into environmental variables and added CLASSPATH with the value D:\Android\tools\testsign.jar and now I am not sure what to do next. Can someone give me some clarification. And btw I am on XP but I can get on linux at home if I need it, but I am a total noob to all this stuff so be gentle.
Thread Closed Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes