[How-To]Themeing your hero - Hero CDMA Themes and Apps

well since there have been ALOT of threads asking how to theme a hero I figured I would go ahead and make a quick guide. I am sure that I will miss stuff so if anyone else sees what I miss let me know and I will add it to the post.
ok first things first there are a few programs that you are going to need. The first is some kind of archive program such as 7zip or winrar. I personaly use winrar but 7zip is free you can download it here.
http://www.7-zip.org/download.html
next you will need a image editing program the favorites are Photoshop and gimp. if you dont have photoshope already and dont want to buy it then download gimp. it just as good and once again its free. You can download gimp here.
http://www.gimp.org/downloads/
Now that you have those programs it is now time to start making your theme.
1. download the ROM of your choice that you want to use since not all files are the same across all ROM's
2. I have 2 folders on my desktop one named "theme apks" and one named "working apks"
3. Use 7zip to unzip the rom you downloaded.
4. in the newly unziped ROM find and open the "system" folder, you will see a list of several sub-directories. The two that we are mainly concerned with are "app" and "framework".
5. Open the "app" folder and move any of the apps that you want to change to the "theme apks" folder that you created earlier in a sub-directory named "app" then open the "framework" folder in the unziped Rom and find and move the "com.htc.resources.apk" and the "framework-res.apk" to your "theme apks" folder into a sub-directory name "framework".
6. now that you have your files seperated out into your "theme apks" folder choose an apk that you want to edit and use 7zip to unzip the .apk into the "working apks" folder you created.
7. now in your "working apks" folder you should have a folder named "res" in this folder there will several other folders. the main ones we need are "drawable", "drawable-mdip" in the 2.1 builds and "drawable", drawable 480x320" in the 1.5 builds" there maybe others depending on what you are trying to change.
8. open the proper drawable folder and find the image you want to edit and open it with your image editor (gimp, photoshop) and make your changes then save it using the same name into the "working apk" folder.
9. now that you have your images edited there are a few ways to add them to your apk the process described here is how I do it since I find it to be the easiest way. go back into your "theme apks" folder and find the apk that you edited. Use 7zip to open NOT unzip the apk. Inside 7zip open the "res" folder and then the proper "drawable" folder now pull up you "working apks" folder and select the edited images and drag them into the 7zip window. A dialog should pop up asking if you want to add and replace existing files and just choose yes. you can now close 7zip.
you have now themed your apk. just repeat steps 6-9 for the rest of the apks you want to theme. then just push the files back to your phone using ADB. I push them back after I am done editing each one before I clear my "working apks" folder so that I can make sure that it looks the way it should that way if I need to make changes then I dont have to go through all the steps again.
after you have created and tested your theme if you want to share it you will want to make an update zip. there are a few ways to do this. by far the easiest way is to use the fresh pre-kitchen to sign it. for this process you will need to follow these steps. download the pre-kitchen here
http://geekfor.me/android15/fresh-pre-kitchen-02/
1. if you followed the steps above then this will be a snap. just open your "theme apks" folder and create a folder named "system"
2. then select either the app folder or the "framework" folder or both depending on what you changed and move them into the "system" folder you just created.
3. now use 7zip to zip the system folder and name it whatever you like.
4. now open fresh pre-kitchen and go to the tools section and choose the sign a zip option. Follow all the prompts and you should have a signed update zip that anyone can flash.
a few side notes
the process above works great for regular images such as png, jpeg and the like now you will find that to change some things they will be in the dreaded ".9.png" format. these images need extra steps to edit them. that I am not going to go into in this guide but they can be found here
http://forum.xda-developers.com/showthread.php?p=5206698
also there is another method to making an update zip that I am not going to go into in this guide but all the tools and how to do it can be found in this thread here. in the first post 4th section.
http://htcpedia.com/forum/showthread.php?t=1404
if you are completely new to themeing I would suggest trying a 1.5 ROM first as they are a little more straight forward because in 2.1 they spread the images for some of the more popular mods over several different apk's.
I want to give a few quick thanks to the great devs here that give us these ROM's to work Flipz, Toast, Damage, Obalisk, Zenulator, and any that I missed thank you. Also to some of the people that have helped me out emensly in my quest to learn how to theme. Noj you have been such a help, Godzson, Chubbzlou and the others that have helped thank you as well.
I hope that this helps some people on their way to customizing their Heros.
if there is anything that someone sees that I missed let me know and I will add it to the post.

I din't see anything about the META-INF folder with update-script to make it flashable. I don't use Fresh kitchen so I'm not sure if it does it or not. I would visually include the layout of the folders before zipping.I might have missed something you typed.
/system/app/
/system/framework/

Looks right. But my name is chubbzlou.

chubbzlou said:
Looks right. But my name is chubbzlou.
Click to expand...
Click to collapse
sorry cubbz was trying to do it from memory but its fixed now.

Thanks for the how-to write up

No prob just busting chops. The how to looks good. Now we need a how to for the .9.png images.
wtphoto said:
sorry cubbz was trying to do it from memory but its fixed now.
Click to expand...
Click to collapse

I din't see anything about the META-INF folder with update-script to make it flashable. I don't use Fresh kitchen so I'm not sure if it does it or not. I would visually include the layout of the folders before zipping.I might have missed something you typed.
/system/app/
/system/framework/
Click to expand...
Click to collapse
I didn't add anything about META-INF because the pre kitchen adds it but that's why I added the link to the other way of signing it explains all that
@chubby that is also why I put the link to the other post I think its a pretty easy to understand guide for the .9.pngs
Sent from my HERO200 using the XDA mobile application powered by Tapatalk

added to wiki

This is just what I have been looking for. Thanks for putting it together.

Related

[Theme Request] Code Name Ninja

Can somebody make or instruct me how to rework the theme "Code Name Ninja" so that it will for with CM5.0.6. Right now its only out for Enomther's rom at Nexus-nation.com
Thanks in advance for any help or advice
Quick and dirty port guide:
Make x folder some where on your computer, for ease you can name it code_name_ninja_port
Open theme.zip file with 7-zip (what I use, so I understand how it works better than any of the others) or whatever file archiver you use.
Make a folder inside of the folder you just made for each .apk inside of the theme.zip with the name of that .apk.
Make a folder named res inside of each of those folders.
Now drag any and all folders with the part or all of the name drawable from inside each of the .apk's inside of the theme.zip. Those folders will be located at appname.apk/res/.
Now you will need to delete any and all .xml files out of the folders.
That is how you isolate all the images in a theme to make it easy to port to new/different ROMs.
You can now go to the MetaMorph sticky section and figure out how to easily make a morph from the way you just set that up. Really, all you need, if you set it up exactly that way is a .nomedia (so none of the images show up in your gallery, you can get a .nomedia from pretty much any morph) and a .thm (soon to be obsolete but still works with free version of metamorph) and a .xml (should make one anyways since on the 31st of April .thm files will no longer be used in the free version of metamorph) file, and package them all up in a .zip and you are good to go.
You may need to make the text a different color, but all the instructions/guides you need are in the sticky. Good luck on porting it.

[How To] Basic Themeing

This is a very basic guide to beginning themeing. It is not meant to be all-inclusive, just some simple steps that can be taken to make your own custom theme fairly easily. This guide should allow anyone to be able to grab images they like from any ROM and incorporate them into their own.
I SUGGEST YOU ALWAYS MAKE A BACKUP OF ANY FILE BEFORE YOU THEME IT AND NANDROID FIRST BEFORE FLASHING
Here is a basic overview of changing images in an apk:
1. Get your base file to theme – framework-res.apk, com.htc.resources.apk, phone.apk ect.
2. “Open” apk archive with 7-zip (don’t unzip!) and drag and drop the new images into the appropriate folder.
3. Flash new file.
Now some details:
1. The first step is to obtain the file you are going to theme. The file you are themeing ( i.e. going to flash to your phone) must come from the ROM you are currently running. Always use files from your current ROM as a base, however the images you want to change can come from other ROMs, or you can edit existing ones or make your own from scratch. You can obtain your theme base through an ADB pull of the files from your phone, or simply downloading the ROM zip file and extracting the files you need.
2. Now that you have the file to theme, don’t touch it! OK, more specifically, you won’t unzip or do anything to this file except “open” it with 7-zip (unless this is a market app, but more on that later). You are going to drag and drop the new icons into this file by “opening” it and navigating to the appropriate folder. The images you want to change are stored in the apk under /res/drawable-hdpi. Once you have your new icons from other sources, open your base file and navigate to this folder and drop them in.
3. Now you can flash this new file. I have provided empty zip files that you can place your themed files into and flash in recovery. Place your framework-res.apk and/or com.htc.resources.apk into the /system/framework folder located in the zip file provided. Now highlight the META-INF and system folders and zip them up. You can now place this file on the root of your SD card and flash. System apps can be placed under /system/app in the zip file.
Some more info on common themeable files:
Framework-res.apk – this is the meat and potatoes of a theme. On an AOSP ROM it will contain almost everything you want to theme aside from individual apps themselves. Sense ROMs have another file com.htc.resources.apk, as well as framework-res.apk. Both of these files are located in a ROM under /system/framework.
System apps: These apps come packaged in a ROM under /system/apps. They can be themed in the same manner as a framework apk. Some of these apps include Gmail, browser, camera, ect. Place them in your flashable zip under the folder /system/app.
Market apps: These apps are downloaded from the market and are can be pulled from your phone from /data/app. These files require a bit more to theme. They don’t share the same signature as the system apps and you must resign them using a program such as apkmanger. Place them in your flashable zip under /data/app.
If there are any errors, or if anyone has suggestions please let me know. I may have over looked some details, ect.
Thanks to everyone on XDA who has shared their knowledge and made this a great community!
Thanks that will be helpful
Sent from my PC36100 using XDA App
so using this guide we can pull parts and what not from other elements of themes we like and create our own framework to push back? Also, based on what you have, shouldn't it be easy to put this up on bid for hire (?) website to create a program to automate that?
xlGmanlx said:
so using this guide we can pull parts and what not from other elements of themes we like and create our own framework to push back? Also, based on what you have, shouldn't it be easy to put this up on bid for hire (?) website to create a program to automate that?
Click to expand...
Click to collapse
Yes the idea of this guide was to help people pick and choose icons they like in other ROMs and add it to their own. I'm not sure what bid for hire is?
its a website where you can load your requirements and folks can bid to do your work
linky
nukedukem said:
Yes the idea of this guide was to help people pick and choose icons they like in other ROMs and add it to their own. I'm not sure what bid for hire is?
Click to expand...
Click to collapse
xlGmanlx said:
its a website where you can load your requirements and folks can bid to do your work
linky
Click to expand...
Click to collapse
Interesting. Didn't know anything like this existed.
Sent from my EVO (CM6.1) using XDA App
Thank you, thank you!!!! I've been looking for something like this for a while.
evolishesh said:
Thank you, thank you!!!! I've been looking for something like this for a while.
Click to expand...
Click to collapse
No prob. Let me know if it works for you.
I couldn't get the auto signing to work, but the manual way of doing it worked.
Hmm, I got a boot loop on first try and doing this. Does that mean something went wrong with the signing, or that what I created for the theme was wrong? I used the empty .zip folder and re-zipped it, so I don't think that is the issue.
JasonK75 said:
Hmm, I got a boot loop on first try and doing this. Does that mean something went wrong with the signing, or that what I created for the theme was wrong? I used the empty .zip folder and re-zipped it, so I don't think that is the issue.
Click to expand...
Click to collapse
The signing should be ok. If you are using Amon_ra recovery it wont let you flash an unsigned zip I believe. Are you on sense or AOSP? Are you editing images or just copying from other ROMs?
What you might want to do is just create a simple test file. Change just one image and then flash that. That should let you know that your process is correct.
I using Amon Ra and using AOSP. I was moving some items out of a sense ROM so I guess that is where I might have went wrong. I think I'll take your advice and move just a single image and see how that works for me. Thanks!
I tried again this time I ended up stuck at the EVO white screen. I'm guessing it doesn't like the sense part I'm trying to throw in there. I'll have to try again with a AOSP theme instead.
Sent from my EVO (CM6.1.1) using XDA App
A couple things to look out for when swapping sense/CM icons - some file names are slightly different between sense and AOSP. Rename any sense icons to their AOSP counterparts and vice versa. Also, double check the image size of the icon is the same in both, i.e. 70x70 pixels, ect. and make sure you are not adding images that don't exist normally in the framework. For example there wont be any 4G icons in CM framework.
Also, make sure you aren't unzipping the new framework-res.apk you want to theme and flash, or trying to resign it. Only sign the flashable zip, not the individual files inside. The only thing you want to do with the framework-res.apk you will package and flash is open (not unzip) with 7-zip and navigate to the res/drawable-hdpi folder so you can drag and drop the new icons into it, overwriting the old.
I hope that helps!
How important is it to re-sign? I have modified the Framework and Resources apks with 7zip by switching images out. I have also modified the Rosie.apk. I put everything back where it was supposed to go, backed out of 7-zip and flashed. I have never had an issue with it, nor have I re-signed it. Just wondering.
spence341 said:
How important is it to re-sign? I have modified the Framework and Resources apks with 7zip by switching images out. I have also modified the Rosie.apk. I put everything back where it was supposed to go, backed out of 7-zip and flashed. I have never had an issue with it, nor have I re-signed it. Just wondering.
Click to expand...
Click to collapse
AFAIK if you are on clockwork recovery, I don't think it checks for signatures. I think Amon_ra requires a signed file to flash. I think it's just added protection against flashing any old junk. If you can flash in amon_ra without a signature and you don't have problems then I wouldn't worry about it. It's the signature of the framework-res.apk ( or com.htc.resources.apk) that's important. That's why you don't unzip it.
I think that
1.7.0.2 = yes
1.8 = no
nukedukem said:
AFAIK if you are on clockwork recovery, I don't think it checks for signatures. I think Amon_ra requires a signed file to flash. I think it's just added protection against flashing any old junk. If you can flash in amon_ra without a signature and you don't have problems then I wouldn't worry about it. It's the signature of the framework-res.apk ( or com.htc.resources.apk) that's important. That's why you don't unzip it.
Click to expand...
Click to collapse
nukedukem said:
A couple things to look out for when swapping sense/CM icons - some file names are slightly different between sense and AOSP. Rename any sense icons to their AOSP counterparts and vice versa. Also, double check the image size of the icon is the same in both, i.e. 70x70 pixels, ect. and make sure you are not adding images that don't exist normally in the framework. For example there wont be any 4G icons in CM framework.
Also, make sure you aren't unzipping the new framework-res.apk you want to theme and flash, or trying to resign it. Only sign the flashable zip, not the individual files inside. The only thing you want to do with the framework-res.apk you will package and flash is open (not unzip) with 7-zip and navigate to the res/drawable-hdpi folder so you can drag and drop the new icons into it, overwriting the old.
I hope that helps!
Click to expand...
Click to collapse
Thanks, any advice does help.
I did make sure the the icons I was swapping out were named the same thing in the CM ROM, but I didn't check the size of it at all.
I didn't unzip the famework-res.apk but instead just went into it with 7-Zip and dragged the icons into that. Then I backed out of 7-Zip so that it would save and close everything properly - know that does work because that is how I add the Fold transistions to the ROM - and then I put the famework-res.apk into the folder and zip it up per your instructions above. Then I manually sign it (still haven't been able to get the auto-signing to work) and then flash.
I'll have to try again moving a CM theme to the CM framework-res.apk and see if it is working. What I was attempting to do was take, from the Batman Theme for sense, the drop down notification shade with the Bat Icon and put it into the CM ROM. I don't know if you have time to try it yourself to see if it works, or if you get the same issues that I had.
Either way, thanks for the help! I know I'll get this theming down at some point!
nukedukem said:
No prob. Let me know if it works for you.
Click to expand...
Click to collapse
Hey buddy.
I’m stuck. I had to download and install Eclipse with the sdk plus java. I don’t know where to go from there. Every time I open the rom that I want to theme and get the framework.apk and edit the PNG’s , how do I go about saving them? Do I just used the same name as the old ones or I have to save them with a new name.
Or pm Me.
xlGmanlx said:
I think that
1.7.0.2 = yes
1.8 = no
Click to expand...
Click to collapse
So the new amon_ra doesn't require a signed file to flash? I'll make a note off that. Thanks.
JasonK75 said:
Thanks, any advice does help.
I did make sure the the icons I was swapping out were named the same thing in the CM ROM, but I didn't check the size of it at all.
I didn't unzip the famework-res.apk but instead just went into it with 7-Zip and dragged the icons into that. Then I backed out of 7-Zip so that it would save and close everything properly - know that does work because that is how I add the Fold transistions to the ROM - and then I put the famework-res.apk into the folder and zip it up per your instructions above. Then I manually sign it (still haven't been able to get the auto-signing to work) and then flash.
I'll have to try again moving a CM theme to the CM framework-res.apk and see if it is working. What I was attempting to do was take, from the Batman Theme for sense, the drop down notification shade with the Bat Icon and put it into the CM ROM. I don't know if you have time to try it yourself to see if it works, or if you get the same issues that I had.
Either way, thanks for the help! I know I'll get this theming down at some point!
Click to expand...
Click to collapse
OK I'll try and do what you are trying to do and see if it works...
evolishesh said:
Hey buddy.
I’m stuck. I had to download and install Eclipse with the sdk plus java. I don’t know where to go from there. Every time I open the rom that I want to theme and get the framework.apk and edit the PNG’s , how do I go about saving them? Do I just used the same name as the old ones or I have to save them with a new name.
Or pm Me.
Click to expand...
Click to collapse
So now you have an unzipped framewor-res.apk with a bunch of images. This framework should be the one that you want to take icons from. If not, start over with the ROM you want to copy images from. You will want to copy the images you want to put into another ROM so that you can dump them into the new framework-res.apk. After you figure out what icons you want to bring to your new framework, get a clean version of framework/com.htc from the ROM you are actually running - i.e. if you are running myn ROM on your phone, download the myn ROM and pull out the framework-res.apk or com.resources.apk that you are going to theme.
Now with this fresh clean framework you will "open" it with 7-zip to navigate to the /res/drawable-hdpi folder so you can now drag and drop the images you want to copy over into it. Then the close the 7zip window and your framework-res.apk is all set to flash. You don't need to rename if the file names are the same, you can just drag and drop and the files will be overwritten in the new framework.

[GUIDE] Newbie's How To: Port Theme's

How To Port Theme's
(Using Apktool, and Theme Porter)
Since there are some people out there willing to learn but not exactly able to with all of the convoluted information on the forums, I decided I'd start putting together a guide similar to other's to aid those trying to learn. Stay tuned as this is under construction!
All credit is due to original creators of the product's used in this process, without them there wouldn't be a reason for this guide . Please be respectful of other's work, sometimes it's best to ask before attempting (if it is an original product) but at very least give credit and a link back.
What is porting?
Porting very basically is taking .png files and XML changes from one theme (typically created for a different model, but using the same resolution) and copying them into deodexed stock rom's such as EC10/EE19 Pick and Pack so that they can be flashed onto our phones and used with our framework and/or updated framework.
Sounds really easy, doesn't it? At first it will be cumbersome and frustrating, but after you've used the processes enough you will be able to snap these out in 30 minutes or less! The problem lies in the way these files are packaged, they are mainly just a .zip file that isn't compressed, however there is another layer to an .apk that you can only see once you've learned how to use tools such as apktool/apkmanager. The other tool we will use to aid us in this painstaking process is an application called Theme Porter, which essentially is a script that has been written that will do all of the legwork for us. Let's get started!
What will I need?
Apktool I currently use an older version of the program, you can download here, this one I know works for sure - last I heard the other has issues.
ThemePorter
7zip (Win rar could be used instead)
Notepad++ (Or equivalent code editing software) which will be used to make the xml changes. If you're not familiar with using something such as this, you may want to take time to research before attempting to port.
How to set up;
Begin by getting ThemePorter setup, you just need to unzip the download and that will be "theme porter" It is basically just made up of a few folders, and has a batch script that you will use to initiate the process. I just place mine on the desktop for easy access.
Secondly, get apktool downloaded and unzipped. place the apt folder somewhere where you can easily navigate to it through a command prompt. C: might be a good place if you want to save yourself some keystrokes.
Next just make sure you have notepad++ or another editor installed for use later.
Lastly, get 7zip installed so that you're able to open .apk and .zip files without actually extracting the files.
Where do I get my source files?
You can use any framework from any rom that can be decompiled correctly with apktool. This means when you decompile it, there are no errors and it generates a folder with the same name. Download the rom of your choice and save it (still zipped) somewhere on your desktop, and make an extra copy in case you mess up and overwrite the wrong files. You will ALWAYS use these in the NEW folder within theme porter, but we will get to that.
As for the theme you're trying to port, I usually use fascinate theme's, because it is basically a direct copy of our phone (Note: As of 2.2 they now have a Data on/off icon in their status pull down, where we have Silence, so this will often need to be taken care of separate from this process.) I've also recently started using Vibrant theme's, as these are also very similar - but there are tweaks with these too and I will try to cover them in the guide at some point. You may find others that will work too, at this point this is all I've had time to mess with. Either way, download the .ZIP file and also place it somewhere easy to access.
This is where it get's sort of difficult.
Stock ROM's have some differences to theme's that theme porter cannot handle for you. These are basically MOD's that may exist in the theme ROM and/or XML changes that have been made to alter text color's to accommodate the theme (black to white, white to black, etc.) These changes WILL NOT be ported over using theme porter and unfortunately also cannot be made AFTER using theme porter, so there is a certain process to go about this.
Now enter's apktool. Apktool is a script brut.all very kindly wrote to assist android developers in decompiling/recompiling .apk files without losing structure that normal compression software breaks. Basically there are two reasons you will need to take this step.
When;
Editing Text Color- When choosing a theme to port you will need to pay attention to the screenshots the original poster has posted, as these will clue you in whether or not this needs to happen.
The Pick and Pack rom is essentially still stock, as far as XML goes - so the text on menu's for example, will be Black text on a white background. If the theme you chose has something different, you will need to take this step so that the text is legible in the final theme.
Adding accurate battery MOD- Also when choosing a theme you will need to take a look at the framework-res.apk file to determine if the themer has added the accurate battery mod. Essentially all this means is the XML and image's have been edited to show you each percentage of battery life vs. the stock one that only shows odd increments of 10/15/20.
Open framework-res.apk with 7zip
Navigate to res/drawable-hdpi (this also may be drawable-hdpi-v4 depending on your theme, I haven't quite figured out why this is)
Scroll down until you see the status_battery icons near the bottom - if there are not images for every percentage - then no mod exist's and you can skip using apktool for this step.
How;
For either change you will follow this process to decompile To gain access to the XML/PNG files that contain these text values, we will need to decompile the framework-res.apk file from the rom.
Copy framework-res.apk from the rom and place in the APT folder created earlier.
Rename this to something shorter such as "FW.apk" for easier command lines
Start a command prompt (in windows 7 type "cmd" in the search bar within start menu)
Navigate to the APT folder, For example;
Code:
CD c:\Users\brandon\Desktop\apt
Type
Code:
apktool d FW.apk
This will decompile the .apk into a folder called FW within the APT folder, allowing you access to the files. I will cover the actual changes in a later post.
At this point you have the files in a folder and they can be edited how you see fit (should you choose to just edit the stock ones vs. actually porting already changed ones).
You'll notice when examining the folder that there are quite a bit more files. Also, you will be introduced to the .9.png file type, which essentially is just a .png file that has some black lines embedded in the file to instruct android how to resize and reuse the image within the framework.
Any edits made to these files must be made carefully, as to not alter the integrity of these black lines. When the file is recompiled, the lines will disappear but will be included (if you tried doing this without decompiling - your photo editor would nix these lines and android wouldn't know how to size them)
If all your edits were complete, you would then recompile the file through apktool. (I will continue with the theme porting guide in the next step, this is just a good reference point for these steps.)
Type this into the command prompt
Code:
apktool b FW framework-res.apk
This would then create the framework-res.apk file in the APT folder, however there is an important step here. During this process the META folder is lost, and the AndroidManifest file is corrupted.
Delete the AndroidManifest.xml file from the new framework-res.apk
Copy the META-INF folder and the AndroidManfiest.xml file from the ORIGINAL framework-res.apk (now named FW.apk in this example) and place it in the new framework-res.apk using 7zip (do not extract the file, open the archive with 7zip.)
At this point, your framework could be ready for replacing in your theme.zip (will be covered later) with the edit's you've made Or if you're learning how to port theme's, continue reading.
Guide Part 2....
Preparing for Theme Porter
Okay now that we have some of the side process out of the way, let's get back to the guide.
Determine if you need to make any XML edit's for battery or text color changes and perform them per the processes detailed below. If you do not need to make them, you may skip this step completely and move on to using theme porter.
Correcting Accurate Battery Mod Animations-
Follow this guide to make the changes to the framework to use the new charging animation images and will allow you to then use theme porter to swap the .png files
Decompile the framework-res.apk from the ROM download (I usually just rename this to EE19.apk or whatever the rom is i'm working with)
Decompile the framework-res.apk (I first rename the framework-res.apk file to NEW.apk (or whatever you wish) Note: It will typcially give you errors (unless it's theme'd correctly) but you're just after some code from a few .xml files so don't worry.
In the NEW folder Navigate to
Code:
\res\drawable-hdpi\
or
\res\drawable-hdpi-v4\
Copy all of the battery charging .png's and drag them to a folder on your desktop. Then open the EE19 folder within APT (the one you decompiled from the rom you're working from) Drag those images into the /res/drawable-hdpi-v4 directory replacing any existing ones.
open the following file in notepad++
Code:
\apt\NEW\res\drawable\stat_sys_battery_charge.xml
Also open the same file within the EE19 decompiled folder
In the THEME xml file select all and copy
In the EE19 xml file, paste this replacing the text. Then save it overwriting the original.
At this point, the battery mod is done and the new .png files exist so that theme porter can do it's work (And the xml is there to make it works when it get's to your phone). If you don't have any text edits to make, you can recompile the apk (as stated in steps in first post) and move on to steps below (skipping the section on changing text).
Changing text colors-
If you have determined that the text in the theme is different from the rom framework (I.E. Text on notifications, menu's, etc.) then you will follow these steps to locate where these changes need to be made.
If you haven't already, decompile the framework-res.apk from the Rom.
Next, determine what text color edit's you need to make and then use this wonderful reference to determine which actual files those edit's correspond to.
Locate the file you need to edit in the decompiled folder, and open it with 7zip.
Typically removing the "inverse" reference on the color line will change it from black to white, or white to black and is the easiest/best way to alter colors in a ROM. (For a quick note, searching for "menu" in the styles.xml files located in /values/ will give you the items you need to change, watch for _bright references for the dividers, change those to _dark instead.
Once you are done making these edits, recompile the folder as stated in first post. And move on to using theme porter.
Using Theme Porter-PAY CLOSE ATTENTION HERE.
Now that you have the appropriate prep-work done, the easy part finally comes. (Hopefully)
Copy and paste the applications & framework-res.apk twframework-res.apk files from the THEME.zip into the appropriate folders within the OLD folder in theme porter.
Now copy and paste the same files that you copied from the theme.zip, now from the rom (EE19 for example) to the NEW folder in theme porter.
Once all files are in appropriate folders, run the Script.bat file in theme porter. Use a selection of "1" and press enter.
Theme porter will now copy all of the .png files from one .apk to the other (where the folder names are an exact match)
NOTE:At this step, you may have issues where the images aren't brought over (This typically only effects the framework files and just depends on how the file was generated/edited). This can be detrmined by opening the .apk in 7zip and pulling out the res folder, where you can view the files (you will see if it's been changed or not) If it hasn't, you will need to make sure the folder within the Themed .apk's are the exact same as the ROM you're themeing and re-run the theme porter script. (meaning you need to add or remove the -v4 ending depending on where the previous themer placed the themed files)
If you're lucky, everything is done at this point and you can move on to packaging a flashable update.zip.
Packaging A Flashable Update.Zip
A flashable package is simply a .zip file (stored as "store" in 7zip, no compression) that is made up of META-INF and System folders. The META-INF folder is very important as there is a big difference between using one from a ROM (pick and pick) and a theme (NeonGT) You will need to download a theme and pull the META-INF folder out so that you can use it in your theme ports. This is to ensure you have the correct script (edify or ammend) typically now we're using edify so use one from one of the H57 theme's via baked_tator The system folder should contain two folders "framework" and "app" each of which will hold the respective .apk files you have been working with. (but could also contain a "Media" folder for changing bootanimation.zip files, basically any files within the folder structure you create (matches the system structure) will be replaced when flashed. So be careful not to include things I haven't listed here unless you know what you're doing. And be sure to test these things before even thinking about a release.
Create the following folder that can be re-used with any new theme port, it's the easiest way to keep things organized and not lose track of files.
Create a new folder on your desktop called New Theme
Within that folder paste in the META-INF folder from another EE19 theme.
Create a new folder called "system"
Open system and create two new folders "app" and "framework" (and "media" if you are including the bootanimation.zip from the theme (which typically will work on our phone)
Place approprate files from the NEW folder within theme porter into these folders, respectively
Back up so that you see the META-INF folder and System folder, select those two, right-click and select "add to archive" in the 7zip menu.
Name the file "EE19 ThemeName VX.zip" and select "Store" for the method
Drag this to your desktop and this will be what you will place on your SD card for flashing.
Test the theme thoroughly to make sure everything ported over and everything still works (make sure to test USB, even color XML edits can cause odd issues) and get help from others to make sure the bugs are out.
If you run into issues, check the next post for possible resolutions.
BE SURE TO CREDIT THE PROPER CREATORS!!! I can't express this enough, I have a format for the way I do release posts, feel free to copy it if you'd like but either way make sure you make it known that it's not your work!
FAQ / Common Issues / Other Resources
Common Issues:
Images do not transfer to new framework.apk files.
(typically the applications all have the same folder names, so no problems occur here.)
As stated in the guide, all folders within each res folder within each .apk file used in theme porter must have exact matching folders/files for the .png to actually transfer. If it's been edited with apktool, it typically has the -v4 extension.
Troubleshoot your issue by opening the resulting .apk file in 7zip and comparing to the downloaded theme file in 7zip. You may have to pull the res folders out and look that way to actually see which images didn't transfer.
First thing to check is the folder names within the res folder, if the rom folder's names are "drawable-hdpi" and "drawable-land-hdpi" and the theme has "drawable-hdp-v4" then you need to remove the -v4 from those folders and run theme porter again.
NOTE: I've also run into situations where both folder's existed in the .apk file, meaning both drawable-hdpi and drawable-hdpi-v4 folders were there, but only one actually had the themed .pngs. In this case it was the drawable-hdpi folder that had the themed ones, but I needed it to be -v4, so I deleted the existing -v4 folders and renamed the others to -v4 - this also slimmed the rom because you really don't need the extra folders/files (nor wan't them!)
Some times icons don't exist on other phones, or they are completely different icons. I.E. with 2.2 fascinate theme's the Silence icon does not exist and therefore would need to be pulled from another theme or created to be fixed. This can be done with 7zip, no need to decompile the file if you're just swapping .png files (in the final framework-res.apk .
[*]Problems after testing theme.
This has happened to me on all sorts of levels;
Problems Restoring - Sometimes after testing theme's you'll go to restore and things will not be right when you boot, FC's and whatnot. Best case scenario you can restore to a vanilla restore (meaning your rom + any app's you wanted, but no theme's) or just flash your rom to fix.
Problems with icon's not being correct on a restore or a flash.
Same as above, sometimes things just go awry when you're flashing theme on top of theme, so i'ts best to start from the rom. Make a restore point with your rom + all your apps, then you can always go back to it and flash your day to day theme - this will give you the least trouble.
Phone stuck in airplane mode, setting is disabled.
I had this happen to me randomly once, no idea why but if you do run into this the only thing that fixed it for me was an odin back to a full build. No restore or flash would fix it. Typically your problem should be solved with a fresh flash of your rom, but sometimes going to a full build with odin is the only way.
FAQ:
Post them and we'll get them answered and edited in here. So far I've tried to cover everything I knew of in the guide .
Reserved
Reserved
Reserved
Other Resourcs:
Great guide by nitsuj17 on how to theme
Hex Colors
Free Photoshop Alternative
XML Color Edit Guide - in case you missed it above - credits to KBanause
wow, you rock bde. thanks for your time and help with this, I will be following it to help you guys out with stuff more.
Sent from my SCH-I500 using Tapatalk
sageDieu said:
wow, you rock bde. thanks for your time and help with this, I will be following it to help you guys out with stuff more.
Sent from my SCH-I500 using Tapatalk
Click to expand...
Click to collapse
Great, and thanks, I'm glad to share what I've learned with the community
Great write up,ive read through it several times. Just wish I hadn't traded my desktop for tattoo work this weekend. ..
Sent from my SCH-I500 using Tapatalk
man you write some good tutorials...
Very thorough and still easy to understand, Great work!!
Very nice! Just fixed the white on white text in my super light port. Big Thanks!
Great write up!
So, I tried using apktool to decompile the framwork-res.apk and it worked fine, recompiled it and everything was good, are these the same steps I would use for other APK's such as in the apps folder (i.e. Settings.apk) because I cannot get them to work I keep getting brut.androlib errors
bwot75 said:
So, I tried using apktool to decompile the framwork-res.apk and it worked fine, recompiled it and everything was good, are these the same steps I would use for other APK's such as in the apps folder (i.e. Settings.apk) because I cannot get them to work I keep getting brut.androlib errors
Click to expand...
Click to collapse
Usually if you get errors in compiling there have been things added or removed after compiling, this is sometimes caused by using theme porter for example.
Apktool works on any apk, but i'ts fussy about what's there before it recompiles. Try decompiling and recompiling with no changes, if it doesn't work then it won't work on that .apk (to my knowledge). You basically will always need to start with one of the deodexed apks from phidelt's pick and pack, then add changes while i'ts decompiled, then run theme porter after it's recompiled if needed.
And glad you all appreciate it
I vote sticky on this how-to...very good write up and it makes my life easier!!!
Definitely sticky
Sent from my SCH-I500 using XDA App
Thanks for the good reading bde. great tutorial.
Hey thanks, glad to share the wealth
Sent from my SCH-I500 using XDA Premium App
I followed this guide and made XML editing for Framework-res.apk to change font colour in the Menu using Notepad++, but after xml edit, cant build the framework.apk, it says sources have changed and does not build the apk. Am using apktool for this. Any suggestions how to go about it. Or somebody can guide, how can I change the menu background so that Menu texts are visible?
trip007in said:
I followed this guide and made XML editing for Framework-res.apk to change font colour in the Menu using Notepad++, but after xml edit, cant build the framework.apk, it says sources have changed and does not build the apk. Am using apktool for this. Any suggestions how to go about it. Or somebody can guide, how can I change the menu background so that Menu texts are visible?
Click to expand...
Click to collapse
As stated in an above post, try decompiling the framework-res.apk you are working with - without any edits and see if it will recompile with no error. If it doesn't then re-read my guide
Ok thanks will check it.
Never mind, I figured it out.
Sent from my SCH-I500 using XDA App
I did some major fixin' on the OP, hope it's more clear!

[Q] How to edit .xml files within and .apk

Im not trying to re-engineer an app, but I simply want to check out an apk to look at the placement of a certain line of code. When i open up the files within the apk though, i get a bunch of nonsense. How do I edit the files within the apk...i know theres a way, or else we wouldnt have custom roms.
Apktool (or some wrapper like Apk Manager). It's quite outdated, so you won't be able to decode some newer apks though.
Brut.all said:
Apktool (or some wrapper like Apk Manager). It's quite outdated, so you won't be able to decode some newer apks though.
Click to expand...
Click to collapse
gahh, i was hoping there would be an easier way than that xP...I experimented with apktool, but it wasnt recognizing the .apk i was typing in...i just suck with command prompt stuff
....thanks anyway though
schwartzman93 said:
gahh, i was hoping there would be an easier way than that xP...I experimented with apktool, but it wasnt recognizing the .apk i was typing in...i just suck with command prompt stuff
Click to expand...
Click to collapse
Brut.all also mentioned APK Manager in his post which is a script wrapper for his apktool that automates much of the process. It's available at the link I gave for both Windows and Linux. All you should need to do is run the script, place your apk in the appropriate folder created by the script, have the script decompile your apk, then you can find the decoded xml file(s) of interest.
thanks guys
i was having a bit of trouble with apk mananger, i couldnt get it to do anything with this one app, i would tell it an action and it just closed the script
EDIT: I figured it out
Hi guys, i'm using APK Manager and i was able to change the xml without having any trouble by decompressing the apk. I'm wondering what i need to do in order to resign the APK. I have already tried to compress the apk and then sign it, but streight away after I installed the apk i got in boot looping.
The file i'm talking about is the framework-res.apk
Any suggestion?
Thanks in advance.
Edit/
Solved.
Basically i was trying to sign framework-res.apk, instead i have found the solution in this forum that actually worked fine for me:
Code:
1. Place your original "framework-res.apk" into "\place-apk-here-for-modding\" folder
2. Run "script.bat"
3. Set Project (22) and choose the "framework-res.apk" (1)
4. Decompile (9)
5. Place or overwrite new Xmls and PNGs in "\projects\framework-res.apk\res\drawable or drawable-hdpi"
5. Recompile (11)
6. Answer "Yes" when it asks wheter it is system file
7. Answer "Yes" when it asks "would you like to copy over any additional files...?"
8. Script is paused => (don't press a key)
9. Go to the "keep" folder (it's in the same folder than "script.bat")
10. In this "Keep" Folder,
- delete "resources.arsc" file
- delete originals "stat_sys_battery.xml" and "stat_sys_battery_charge.xml" from the "keep\res\drawable" folder
- delete all originals PNGs that were meant to be edited
11. Go back to "script.bat" and press a key to let him finish the job
12. Your new "framework-res.apk" has been created in the "\place-apk-here-for-modding\" folder. It's called "unsignedframework-res.apk".. but he's not working yet.
13. Unzip all the content of the "unsignedframework-res.apk". You should have 5 objects (3 folders, 2 files).
14. Zip these files with Winrar/Winzip (whatever) but you must choose "No compression" method to zip it.
15. Rename this zip into "framework-res.apk".
15. Put it into an update.zip and it should be OK to flash trough the recovery mode.
Thanks anyway!

Modding the sense 3.0 (step by step directions needed)

I love all the beautiful modified skins of Thypancy's intial theme. Is there a post where we could learn to mod these themes. too. I have 4 in mind that I would like to make or have modified, but i would rather learn how to do it myself. Can someone point me in the right direction.
Hi,
I am not a PRO at this... but i would just explain you the procedure:
1) extract/Decompile the .apk file you want to MOD or make changes to. Use m10 editor for this.Select the option "decomplie all"
2) Minimize the m10 editor, and open the folder where you m10 editor is installed. There you would find a folder with the name of the .apk file you just decomplied. Go to folder assests>"base theme name">drawble>shared folder.
3) now select the .png files you want to edit. Install Paint.net, and edit with them, it was easy process for me. Remeber to "flip image vertical" after you are done with editing.
4) now go back to m10 editor, and Save the file.
5) You should have AndroidSDK installed.If not, do it. Then go to the folder where you have installed it. open the "autosign" file. It will open command prompt. There select the option to sign the file manually. Give the path for the file. It will sign it then. Exit from that program.
6) you are done, you can install it now.
Well, this is the basic idea for modding, and it would work if you have a little bit knowledge. I have been taught all this by "laletsehgal21", who has a good thread of his MODS... you can ask him for a detailed help.
Happy Modding
mathrania said:
Hi,
I am not a PRO at this... but i would just explain you the procedure:
1) extract/Decompile the .apk file you want to MOD or make changes to. Use m10 editor for this.Select the option "decomplie all"
2) Minimize the m10 editor, and open the folder where you m10 editor is installed. There you would find a folder with the name of the .apk file you just decomplied. Go to folder assests>"base theme name">drawble>shared folder.
3) now select the .png files you want to edit. Install Paint.net, and edit with them, it was easy process for me. Remeber to "flip image vertical" after you are done with editing.
4) now go back to m10 editor, and Save the file.
5) You should have AndroidSDK installed.If not, do it. Then go to the folder where you have installed it. open the "autosign" file. It will open command prompt. There select the option to sign the file manually. Give the path for the file. It will sign it then. Exit from that program.
6) you are done, you can install it now.
Well, this is the basic idea for modding, and it would work if you have a little bit knowledge. I have been taught all this by "laletsehgal21", who has a good thread of his MODS... you can ask him for a detailed help.
Happy Modding
Click to expand...
Click to collapse
Thanks for the Info!!!
mathrania said:
Hi,
I am not a PRO at this... but i would just explain you the procedure:
1) extract/Decompile the .apk file you want to MOD or make changes to. Use m10 editor for this.Select the option "decomplie all"
2) Minimize the m10 editor, and open the folder where you m10 editor is installed. There you would find a folder with the name of the .apk file you just decomplied. Go to folder assests>"base theme name">drawble>shared folder.
3) now select the .png files you want to edit. Install Paint.net, and edit with them, it was easy process for me. Remeber to "flip image vertical" after you are done with editing.
4) now go back to m10 editor, and Save the file.
5) You should have AndroidSDK installed.If not, do it. Then go to the folder where you have installed it. open the "autosign" file. It will open command prompt. There select the option to sign the file manually. Give the path for the file. It will sign it then. Exit from that program.
6) you are done, you can install it now.
Well, this is the basic idea for modding, and it would work if you have a little bit knowledge. I have been taught all this by "laletsehgal21", who has a good thread of his MODS... you can ask him for a detailed help.
Happy Modding
Click to expand...
Click to collapse
cool man.....
Jst one thing attach the base file that one must use to decompile so that he does not have errors while re-compiling
In de-compiled files changes have to b made in three places.
1. Androidmanifest.xml (name of package).
2. Res\values\strings.xml (name of theme).
3. Assets\shared(change this to theme name)
Now compile and then edit
lalitsehgal21 said:
cool man.....
Jst one thing attach the base file that one must use to decompile so that he does not have errors while re-compiling
In de-compiled files changes have to b made in three places.
1. Androidmanifest.xml (name of package).
2. Res\values\strings.xml (name of theme).
3. Assets\shared(change this to theme name)
Now compile and then edit
Click to expand...
Click to collapse
I tried this but instead of pngs, i'm getting dat files in the "\\\drawable\shared" folder? Is anyone else having this problem?
keedog said:
I tried this but instead of pngs, i'm getting dat files in the "\\\drawable\shared" folder? Is anyone else having this problem?
Click to expand...
Click to collapse
no after using m10 editor u'll play with dat files only best part is inverted
lalitsehgal21 said:
no after using m10 editor u'll play with dat files only best part is inverted
Click to expand...
Click to collapse
What???? I'm way confused by that last sentence.
keedog said:
What???? I'm way confused by that last sentence.
Click to expand...
Click to collapse
he means, that the images you would like to EDIT would be inverted(up side down kind of) already...... the way it looks in your android phone...it wd be inverted
keedog said:
I tried this but instead of pngs, i'm getting dat files in the "\\\drawable\shared" folder? Is anyone else having this problem?
Click to expand...
Click to collapse
In the m10 editor, on the second tab "m10files", select "decode images". And then start the process.....
I have attached an .apk file. Install it on your sensation, apply the theme to your mobile. Observe the stuff. Then try to decompile the same file, and edit the images to your choice. It will help you to recognize what files you should change to get your desired result.
mathrania said:
I have attached an .apk file. Install it on your sensation, apply the theme to your mobile. Observe the stuff. Then try to decompile the same file, and edit the images to your choice. It will help you to recognize what files you should change to get your desired result.
Click to expand...
Click to collapse
Thatz a pretty nice one, and i like how u pointed out all the pages with text. thanks again.
mathrania said:
Hi,
I am not a PRO at this... but i would just explain you the procedure:
1) extract/Decompile the .apk file you want to MOD or make changes to. Use m10 editor for this.Select the option "decomplie all"
2) Minimize the m10 editor, and open the folder where you m10 editor is installed. There you would find a folder with the name of the .apk file you just decomplied. Go to folder assests>"base theme name">drawble>shared folder.
3) now select the .png files you want to edit. Install Paint.net, and edit with them, it was easy process for me. Remeber to "flip image vertical" after you are done with editing.
4) now go back to m10 editor, and Save the file.
5) You should have AndroidSDK installed.If not, do it. Then go to the folder where you have installed it. open the "autosign" file. It will open command prompt. There select the option to sign the file manually. Give the path for the file. It will sign it then. Exit from that program.
6) you are done, you can install it now.
Well, this is the basic idea for modding, and it would work if you have a little bit knowledge. I have been taught all this by "laletsehgal21", who has a good thread of his MODS... you can ask him for a detailed help.
Happy Modding
Click to expand...
Click to collapse
I have all the pngs replaced and the its back in a apk, but now I don't see a autosign file in the sdk folder. am I looking in the wrong place?
This is the Android-sdk (along with java jdk) that i downloaded. I can't find a autosign file anywhere.
i found the autosign bat fle. but now im getting errors.
question: how/where do i change these?
In de-compiled files changes have to b made in three places.
1. Androidmanifest.xml (name of package). how do u change this?
2. Res\values\strings.xml (name of theme). how/where do u change this?
3. Assets\shared(change this to theme name) h0w/where do u change this?
---
also when I replaced the background image, and he skin png, they resorted back to the original and didn't keep my background image nor skin pmg.
Sorry to hijack, but how would I change the dock/nav bar?
Sent from my HTC Sensation Z710e

Categories

Resources