How-to Theme Development

Search This thread

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
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 probably 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://xdaforums.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://xdaforums.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, you will need to do a wipe.

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.

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.

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 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? If not hit the windows key and R at the same time. Type in regedit. go to HKEY_CLASSES_ROOT and expand it. Now find .apk and click it. Double click on (Default) and erase apk_auto_file. Hit ok and close the Reg editor. Now right click an apk and the option ResignApk should be there.

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, so that you can create an update file which will install the theme onto the users phone.

You need to make sure that you do this correctly, because if you don't then you will have the potential to create problems for people trying to install your theme. You also 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 res and more specifically in folders that are named Drawable, drawable-land, drawable-port, etc. 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 update which will do all of this for you. Note that these updates will not completely wipe your phone, your apps will be retained, however, they will require you to re-enter your Google info, and you will lose you call history.

Links down

Just put the correct update.zip, depending on what version you are running, onto your sd card, boot into recovery and hit alt + s.

Now you can push your own apk's one at a time without re-wiping your phone.

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.

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

See here to unhide file extension types for Vista: http://maximumpcguides.com/windows-vista/how-to-change-a-file-extension/


After changing the apk to a zip open it 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.

This must be done in LINUX! Not WINDOWS! Yes it may work for you if you do it in windows but other people's phones will enter an indefinite loop! Just do it from Linux! If you absolutely cannot make your own update.zip, contact me and we'll see if I can make one up for ya.

I have created a template for you to make your own update.zip. Just download, open in Linux, and 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/Androidstuff/update_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
 
Last edited:

jashsu

Senior Member
Nov 15, 2008
1,849
20
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/reference/draw9patch.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. :D Nice tutorial, btw.
 
Last edited:

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
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
 
Last edited:

jashsu

Senior Member
Nov 15, 2008
1,849
20
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.

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...)
 

kron2

Senior Member
Mar 30, 2008
477
1
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
 

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
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
 
Last edited:

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
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.
 

limitlis

Member
Jan 2, 2009
9
0
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.
 
Last edited:

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
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
 

limitlis

Member
Jan 2, 2009
9
0
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

Hey, I tested it with this one:
Rc30 resigned: http://www.fightforthepits.com/Andro...pdate_Rc30.zip

Update went fine, until I booted back up then the applications kept force quitting, without me even doing anything.

Thanks,
Limitlis
 

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
yes there is a temp problem with those right this moment I am on the problem as we speak, expect a fix tonight...

Stericson
 

aron4588

Senior Member
Jun 14, 2007
169
0
Can we get the fix cuz it bricking fone I had to flash rc29 nbh

Edit: I forgot please.... feel kinda rude when ur helping me out lol but it bricking some phones and for our less experince members we don't global meltdown lol
 
Last edited:

andonnguyen

Senior Member
Nov 12, 2008
842
3
I found the cyclon boot effect images in in framework-res/assets/images,
is there any way to replace the android boot image with those images?
 

cannon1616

Member
Jun 14, 2008
37
0
Is there anyway to make the theme with a custom boot screen? Also is there a way to change the second boot screen(The one that says Android and has the little robot)
 

andonnguyen

Senior Member
Nov 12, 2008
842
3
i tried using the testkeys from JF to resign my apks, but the update still says there is not signature =[
 

parmenti

Senior Member
Feb 28, 2009
157
1
hello, I used the tutorial and everything worked great. I'm trying to change the background to the notification section but I can't find that file. Could you tell me where it is? Thank you.