[RELEASE] Metamorph - Theme Control File Upgrader - Android Themes

Stericson have a new Metamorph App.
It uses xml theme control files instead of the old thm files.
danation from the ModMyMoto forum has made a program, that updates the thm file to the new xml format.
It works very very well.
Please at all themers:
Use the Pro Version, use the new Metamorph with xml. Upgrade your Morphs with the xml files. Its not many work for you, but you can help us themers and users if you do this.
Download
http://www.4shared.com/file/5l0E6t76/ThemeControlFileUpgrader.html
Original Post at ModMyMotoForum
http://www.modmymoto.com/forums/showpost.php?p=3917253&postcount=10
Thanks, danation, thanks stericson! Great work!

Ummm, do you themers not use the pro version?
Only a question. I think, this app from stericson is every buck worth!
I've upgraded my themes all for Metamorph xml files.
Now all themes have an xml AND a thm file, so everybody could use them.

Today is the day.
I hope, you themers out there have changed your theme control files to the new one (*.xml)
Today, stericson has released the new Metamorph free version which supports only the xml file.
Please update your themes. We dont want to have some chaos in the theming community, isn't it so?

Stop getting angry at Stericson for moving Metamorph into a safer environment for the user (giving more information as to what is being changed).
HTCClay put it best:
@Stericson you can't update...where do you get off making things better? How dare you...
Click to expand...
Click to collapse
This utility is VERY easy to use and will convert any .thm file to .xml in seconds.

JAguirre1231 said:
This utility is VERY easy to use and will convert any .thm file to .xml in seconds.
Click to expand...
Click to collapse
Thanks I've updated it, in case anybody still needs some converting to do. This is the final version, unless there are any bug fixes needed.
Included in the download is an executable JAR file that will work on any operating system that has the Java Runtime Environment installed (version 6 or later.) Windows, Mac, and most Linux Distros will be able to run this program.
An equivalent EXE file was also added for the convenience of Windows users.
Original download location at M3 is here.
Download from XDA here.
-1.3-
* Drag and drop directories - All .thm files in the directory and all subdirectories will be converted. Other files are ignored. You can convert all of your themes at the same time
-1.2-
* Drag and drop feature added (I borrowed some public domain code found here.) Tested on Windows 7 and Ubuntu. Should work on Mac and Kubuntu as well.
* Option to disable dialogs
-1.1-
* Fixed bug that always warned about duplicate files
* When errors are found, it finishes writing all valid data before terminating.
-1.0-
* Ignores single blank lines
* Captures notes after double blank lines
* Adds functionality to enter in header information
* Prevents file overwriting
* Puts framework at the bottom no matter where it is in the .thm file

I'm still not clear on how you actually *use* this converter. Could someone post a step-by-step breakdown? Right now, I have the thing sitting on the root of my SD. Do I need to move it to the Android Themes?

No, not using with your mobile phone.
Copy it to your pc.
Open the Programm and take your *.thm file you want to convert to an *.xml file.
Thats all.

Related

[TOOL] FlashMOD 1.1.2 (2010-11-22) Now Supports Applying MetaMorph Themes!

FlashMOD is a tool for creating and applying themes on Android. FlashMOD resolves the difficulties in applying MetaMorph themes by applying the themes to the ROM or update zip file instead of on the live phone. It takes less than a minute to apply a large theme to a ROM. You can then flash the ROM and you will have the theme up and running quickly and painlessly. If your ROM has a separate package for the gapps, then you will need to apply the theme to both the ROM and the gapps package.
FlashMOD should be compatible with any any Android Phone, ROM, or update zip, but I have only tested it on the Eris and with the following ROMs:
-Conap's CELB/gapps package.
-KaosFroyo
-TazzFroyo
For developers, the program also includes many more features for batch compiling, decompiling, compressing, resizing, signing, zipaligning, and extracting NAND .img files. For more information, please read the pdf documentation I bundled with the program.
Always make a nandroid backup before applying ROMs themed with FlashMOD.
Credits:
icbeer - FlashMOD
Cheezo - DotNetZip Library
Brut.all - apktool
Android Open Source Project - aapt, draw9patch, zipalign, media.pk8 media.x509.pem, platform.pk8, platform.x509, shared.pk8, shared.x509.pem, testkey.pk8, testkey.x509.pem, signapk.jar
Oracle - swing-worker-1.1.jar
Cosmin Truta - OptiPNG
Jean-loup Gailly - zlib
Mark Adler - libpng
ImageMagick Studio LLC - ImageMagick
Everaldo Coelho - Crystal Project icons
Kai Wei - I ported his unyaffs program to C#
Change Log:
1.1.2 - (2010-11-22) Fixed an issue when modifying the update script for the ROM. I was adding the wrong line endings.
1.1.1 - (2010-11-22) Minor tweaks. Looks like I have a bug in this version that shows the version number incorrectly in the title bar. I'll have that fixed in a bit.
1.1.0 - (2010-11-22) Added the ability to directly apply MetaMorph themes. Added ability to extract all the different .img files from a NAND backup (data.img, system.img, and boot.img). This was pretty cool because I ported/implemented the entire thing in C# code.
1.0.1 - Fixed bug in signing form. Pem and pk8 keys were reversed for certain radio buttons. Also modified theme application process. Apks are no longer signed, but are still zipaligned. KaosFroyo didn't like it when I signed certain apks with the test key even though this was OK in CELB.
Downloads:
- FlashMOD 1.1.2 (SHA1:207bda5d7cb9f3185ff01d9188f1c75e0f3bb47e)
FlashMOD runs on .NET FrameWork 3.5 on Windows and Mono on other platforms. There is 1 distribution for all platforms. FlashMOD also requires Sun Java JRE 6. To run on Windows you double-click on FlashMOD.exe. To run on mono you type "mono FlashMOD.exe" from the command prompt. Most linux tools are bundled or preinstalled under Ubuntu. I have never tried this on a Mac, but it should work. If you use any of the tools besides applying themes on a platform other than Windows you will need to change the file "FlashMOD.exe.config" and change the path of the external tools to point to their location on your system. It's been a while since I tested FlashMOD on Linux and I hope to start looking at that again soon.
- FlashMOD 1.1.2 Source Code (SHA1:1b524c0301027a98097c1f4a1f2a4db1b94c04a2)
FlashMOD is open source licensed under the GPL v3. FlashMOD is written in C#.NET and was developed in Visual Studio 2010.
Themes:
Buuf Theme 1.0.0 for FlashMOD.
This is a port of the Buuf theme by petsasj on the hero forums. This theme also installs the Buuf ADW theme in your /data/app folder. Make sure to select this theme in ADW to get the best experience.
[Reserved]
This looks cool. I will see if I have time to play around with it soon. I have been having problems with metamorph and it can be very slow with framework files. Hopefully I can get it working in the mac terminal.
synesthete said:
This looks cool. I will see if I have time to play around with it soon. I have been having problems with metamorph and it can be very slow with framework files. Hopefully I can get it working in the mac terminal.
Click to expand...
Click to collapse
I'm sure it will work under emulation. I'm curious whether it would work natively on the Mac under Mono. I tried it a little under Mono on Linux and it seemed to work fine for applying themes, but I never tried any of the other features. It's kind of surprising, but the same exe that works under windows should work on Linux and Mac like a Java application. Mono is binary compatible with windows. You just type "mono FlashMOD.exe" from the command line to run it. Mono supports Windows Forms on Windows, Linux, and MacOSX. I do not have all the external tools bundled for Mac, so you would have to round those up, but they are all open source. There is a config file that sits alongside the exe that tells it the path of the executables. I have it setup for Windows, so you would need to change it for other platforms.
If anyone wants to help me provide Mac and Linux support I would appreciate that.
cool mod! gonna use it asap
Let me know if it works for you. This is pretty much in the beta phase at the moment. It definitely works nicely for me on Conap's CELB ROM. Hopefully later today I will have time to test this on Kaos Froyo and some of the others.
Oops, found a couple bugs in the signing utility. I had the pem and pk8 keys reversed in the hardcoded values when selected from the radio buttons. I have corrected this in version 1.0.1. Also there was a compatability problem with KaosFroyo that I have resolved in version 1.0.1. It looks like Conap's ROM has different signing requirements than Kaos. According to logcat, KaosFroyo was complaining that I didn't sign certain apks with the shared keys. Rather than dealing with all that, I'm just going to take the more common approach of not resigning the apks. This will cause header mismatch warnings in zipalign, but I have suppressed these warnings internally. I just built the releases and will be posting them shortly.
Here's a crazy idea I just thought of...would it be possible to make a nand of whatever ROM you're currently running, zip it up, and apply a zipped theme using your method? My thinking behind this is that I'd rather not go through setting up all the mundane stuff such as email, relocating certain apps to system/apps, deleting apps I don't use/duplicate apps, ringtones, and the countless other modifications. If this is just a ridiculous idea, please ignore. Otherwise, any thoughts on this?
hoovnick said:
Here's a crazy idea I just thought of...would it be possible to make a nand of whatever ROM you're currently running, zip it up, and apply a zipped theme using your method? My thinking behind this is that I'd rather not go through setting up all the mundane stuff such as email, relocating certain apps to system/apps, deleting apps I don't use/duplicate apps, ringtones, and the countless other modifications. If this is just a ridiculous idea, please ignore. Otherwise, any thoughts on this?
Click to expand...
Click to collapse
There are other way of reapplying your customizations such as using a Titanium Backup restore. My application does not require that you apply the theme to a ROM either, just a flashable zip file. You can apply it to an update.zip file instead with only the apps you want themed included in the file (and probably framework-res). It's pretty easy to set that up, but it is a manual process. Automatation is a beautiful thing
What you are suggesting is not impossible to do...nand backups are images of the partitions on the phone in yaffs format. There is a program called unyaffs that I have compiled that can extract these. The program could then generate an update.zip file for you to reapply the system apps/framework. This is something I have been considering, although I was thinking of doing it a different way. I was thinking of pulling the apps with adb and then generating an update.zip from that. The problem with the way I was thinking of doing it is that it would require everyone to have the android sdk installed. I like your idea because it would remove the adb requirement. This sounds like a good addition to the next version. I'll look into this. Thanks for the suggestion.
Wonderful job =) works like a charm! Much better than metamorph.
Has anyone tested this on froshedyo v5?
Sent from my FroShedYo.V5 using XDA App
I tried in on CELB. Why don't you just try it on FroyoShed? Just do nand backup before you do it.
danielahl137 said:
Has anyone tested this on froshedyo v5?
Sent from my FroShedYo.V5 using XDA App
Click to expand...
Click to collapse
I haven't tried his ROM out yet. His ROM is compiled with the source code for CELB though if I remember correctly, so it will probably work. I'll try it out after I get off work.
Major accomplishment tonight! FlashMOD is now the first C# application to natively extract all the types of NAND img files, including data.img, system.img, and boot.img. I even created a CPIO archive decompressor to extract the ram disk in the boot.img file. This will all be available in 1.1.0, which I'll try to release this weekend.
icbeer said:
Major accomplishment tonight! FlashMOD is now the first C# application to natively extract all the types of NAND img files, including data.img, system.img, and boot.img. I even created a CPIO archive decompressor to extract the ram disk in the boot.img file. This will all be available in 1.1.0, which I'll try to release this weekend.
Click to expand...
Click to collapse
Very nice! Will test when you post it.
Sent from my FroyoEris using XDA App
Thx, for your help. I will try to post tonight if I have the energy after seeing Harry Potter in the IMAX.
Sent from my ERIS using XDA App
The new release sounds awesome. Nice job icbeer
Sent from my Eris using XDA App
Thanks for the support guys. It's nice to feel like other people appreciate what I'm doing. I didn't make it to post things tonight. I wanted to change part of the implementation to lower memory requirements. I also need to write up all the acknowledgements and round up all the licenses, from anyone I borrowed code from. It's actually kind of tedious to build a release that doesn't violate any licenses.
I'm trying to bundle all these little tools into one package. I'm not adding anything you couldn't do already, but you'd have to compile a C application to extract the unyaffs volumes and you'd have to run a perl script followed by extracting the cpio volume with 7z or cpio (on linux) to do it. By getting them into C# I can now provide a cross platform method for doing this and a graphical interface. It will also allow me to incorporate these utilities into the progress bar at some point.
For now, this is mostly going to be for curiosity sake, or in case you need to pull stuff out of your Nandroid backups. It's pretty interesting to look at the boot.img file and some of the config files in there. The next step will be to generate themed update zip files from the system apps and the framework in the nandroid backups as requested. That was really the whole reason I did this.
I'm trying to port all the external tools to C# to simplify things and give me more control over everything. The real challenge now is signapk and zipalign, because those are the 2 external tools involved in applying themes. Signapk is tricky, because I have to port portions of the Java security library to C#. It looks like the BouncyCastle crypto library may provide a lot of what I need. Zipalign looked a little more straight forward to port.
Sorry I didn't post again today, my internet has been down since this morning. However I added the ability to apply MetaMorph themes, so hopefully that makes up for my lagging. I'll go build the release now so I can post it when I get to work tommorow.
Sent from my ERIS using XDA App
Ughh, took me like 3 versions to get it right, but it is now correctly updating the update script for the ROM in case the theme needs to copy items to the data folder or sdcard. I am very curious to hear from anyone trying MetaMorph themes with this tool. Let me know if things are working out for you.

ZipThemer - theme installer with support for MetaMorph files

ZipThemer is a theme installer app with MetaMorph compatibility. It builds flashable "update.zip" files onboard your Android device by combining your existing system files with modifications from the theme files of your choosing. Supported theme files formats are ZipThemer and MetaMorph theme files.
The app determines which system files need to be patched by reading the XML descriptor information from the theme files. It then creates patched versions of the system files by merging in content from the theme files. The result is then packaged as a signed "update.zip" which you flash via recovery to apply the changes.
Add as many theme files as you want to install in a single "update.zip" file. Order is important when two theme files update the same resources. For example, lets say you have a status bar theme which updates all of the status bar icons, and a cool circle battery pack which updates only the status bar battery icons. You'll want to add the battery pack theme after the status bar theme so that the battery pack takes precedence. In other words, the battery theme should appear further down the list.
This method of patching/modding preserves themes you've installed previously that don't conflict with newly applied themes. It also allows multiple themes to be installed in a single recovery/flash/reboot cycle.
ZipThemer has the capability to also create flashable "undo" files that can be used to quickly and reliably revert a theme install. See the user manual for more information.
Unlike MetaMorph, ZipThemer works with the theme files in their unextracted format -- there is no step to unpack the theme files. ZipThemer will not work with the extracted zip files.
The following links will take you to the official ZipThemer website for more information:
User Manual
Overview and Feature List
Issues & Limitations
Screenshots
Donate
Edify workarounds:
NOTE: as of version 2.0 workarounds are no longer required. ZipThemer 2.0 can create an Edify configuration on the device by reading the required information from a flashable ROM or update on your sdcard. In the app, visit Menu -> Update Edify.
Deprecated workaround instructions...
Select the "Update Edify" menu item to force the creation of /sdcard/ZipThemer/edify.
Download the edify-support.zip file for your device.
Extract and push the two files, phoneDatabase.xml and update-binary, to /sdcard/ZipThemer/edify/. Use 'adb push' or your favorite onboard file manager app.
In ZipThemer's settings, change the 'Update Script Format' to the Edify option with your device name in it.
ZipThemer will now be able to create flashable updates with the correct Edify commands for your device.
NOTE: if you use the 'Update Edify' menu option after installing the workaround, it will overwrite the phoneDatabase.xml and you'll either have to delete the update-binary file or re-install the workaround.
I just published version 1.1 to the market. This removes three of the previously listed limitations.
Changelog:
* Added checkboxes to enable/disable theme subcomponents.
* Fixed update zip script generation so it automatically includes commands for copying to DATA and SDCARD as appropriate for the theme content.
* Improved the theme meta-descriptor format to allow files to be copied at build time.
* Added build completion status/log display.
This is sweet! I had a little trouble at first but then I realized that all the themes I was trying to build either had 'spaces' or 'periods' in their filenames. After renaming the main folder and the xml file it works fine.
Thank you!
Glad you like it. If you can point me at a theme with spaces/periods in the name I can probably fix ZipThemer to make it work without having to change the theme file.
Ken
Version 1.2 is out. The list of limitations just got shorter again.
Changelog:
* Added long press context menu to items in the theme list.
* Added ability to remove themes from the list via context menu.
* Added ability to move themes up and down in the list (because order is important, see first post).
* Added theme details screen which displays information from the theme's XML file and screenshot.
* Some minor fixes.
Error on build out
I'm trying to build a zip to theme swype. I'm using one of the zip files from here and trying to apply it to the swype.apk in the system/app folder.
When I click "build it" I get the following error "IllegalArgumentExecption: Incorrect offset/len parameters"... any help would be appreciated.
Thanks!
Do you have the Android SDK installed on your computer? If so, it would help to run the 'adb logcat' command while doing this and then send me the output so I can get a better idea about what's going on.
Was Swype was installed from the market? ZipThemer doesn't yet support theming market apps (but its on my TODO list). The error may be related to that.
Ken
Swype wasn't installed from the market. I'm on Calkulin's EViO 2 ROM v1.7.1 swype came in package ROM so it's the OTA version.
I've attached the log file
mwhiz said:
Swype wasn't installed from the market. I'm on Calkulin's EViO 2 ROM v1.7.1 swype came in package ROM so it's the OTA version.
I've attached the log file
Click to expand...
Click to collapse
Thanks. Unfortunately I forgot to tell you to increase certain log levels, so the output is not as useful as I had hoped. Anyway, after thinking about the problem and reading the SwipeHD theme thread I see at least three things that need fixing.
First, I'm pretty sure that the "IllegalArgumentExecption: Incorrect offset/len parameters" error is what happens when you try to theme what I call a "market app". But what I mean by that is any app which is not signed by one of the four well-known Google keys. An OTA version of Swype falls into this category because probably signed by a key private to the app makers. Anyway, there's a bug in ZipThemer which results in this error when you try to theme such an app. FYI, MetaMorph doesn't sign the files after patching them. Two things for me to do here -- provide a better error message in this case, and implement an option to patch market apps by a) re-signing with a Google key, or b) not signing the result.
The other thing I noticed is that the SwypeHD morph files have an item to copy a custom system library into place. I missed this feature of MetaMorph during my analysis, so I also need to implement support for this also.
I'm not sure how long it will take me to get a new version out that supports these features. Maybe a week or two. There are certain experiments that will help determine which way to go with the signing/not-signing part -- e.g., to figure out which one to implement, or if both are need which one is the best default, etc. Let me know if your willing to help with this.
My appologies for not having better news at this time, but with your help we can make ZipThemer a great app.
Thanks again,
Ken
Ken,
Thanks for the quick replies! I'll do what I can to help, let me know what I can do.
-Mark
mwhiz said:
Ken,
Thanks for the quick replies! I'll do what I can to help, let me know what I can do.
-Mark
Click to expand...
Click to collapse
Try the attached 1.3-beta1 version...
adb uninstall kellinwood.zipthemer
adb install ZipThemer-1.3-beta1.apk
or Gmail the attachment to yourself and click the "install" button in Gmail onboard the device -- this probably requires allowing "Unknown sources" to be enabled in the phone's Applications settings.
Your first attempt to build an update zip file should result in a "Key Selection Error" dialog. This is the fix for the incorrect offset/len parameter exception in the previous version. This dialog is issued when the key signing mode is "auto" (the current default) and the certificate of the app being patched is not recognized.
Next, visit ZipThemer's menu, select Settings and change the Package Key Mode to "auto-none". Retry the build... it should succeed. The Swype app should get patched but not re-signed because the app's certificate will not be recognized. The log ouput should say it updated entries, but should not say that it was signed.
Create a second update zip before flashing the first. This time set the package key mode to "auto-testkey", rename the output file using the "*Output" button and build again. In this version, the Swype app will be resigned with the Google testkey.
BACKUP YOUR SYSTEM BEFORE FLASHING EITHER OF THESE UPDATES!!!!
See what happens when you flash one of the files and reboot. Test swype and then flash the other update and reboot. In my tests I updated the YouTube app and didn't see any difference between the signed and unsigned versions.
I'm anxious to hear how it goes.
Ken
Worked like a charm! I flashed both updates with no problems and both updates appeared to work just fine. Nice work!!!
Going to try a few more and I'll let you know how it goes.
For my info does it matter which Package Key mode I use? Does one give me anything that the other doesn't?
Thanks again..
Nice!
I'm not exactly sure which one is better... auto-testkey results in a signed app which means it has a valid digital signature, but the certificate is different than the original and could cause problems in the future, e.g., if an updated version becomes available you might not get the update.
auto-none results in the same outcome as using MetaMorph -- a patched app with an invalid digital signature, because the file was patched and not re-signed.
I might be inclined to use auto-testkey myself until a problem was discovered, especially since I like the idea that everything is signed correctly. But with auto-none having the same result as MetaMorph which as been around for a while, it might be a better choice in the mean time.
I'll try to get an official 1.3 release out to the Market in the next day or two.
Ken
I uploaded 1.3 to the Market this morning. Most of the changes address Mark's issues above, but I also sneaked in the theme list save/restore feature and fixed a few bugs along the way.
FYI, in the 1.3 release the package key mode is "auto-none" by default, which means user's are unlikely to have to change it. The default was "auto" for the beta version.
Change log:
* Added support for including plain files to the generated zip via "xxx.cpy" item's in the theme control files.
* Preference settings to control key signing mode for patched packages and the update zip file
* Theme list save and restore operations
* Various other bug fixes.
Is the final output a theme file or an entire rom with the theme incorporated into it?
Neither... its an update zip file that you flash in recovery to apply the changes for the themes. The file is bigger than a theme file, but much smaller than a full rom. For example, say you have a theme which modifies the icon for the Calendar app. The theme file contains a single image and the theme control file. The resulting update zip file will contain a patched version of /system/app/Calendar.apk and the update-script file. When you flash the update the new version of Calendar.apk gets installed and you'll see the new icon. ZipThemer can easily create update zips to install multiple themes and therefore patch multiple packages/apps in one update, so this is just a simple example to explain things.
Hope that helps,
Ken
kellinwood said:
Neither... its an update zip file that you flash in recovery to apply the changes for the themes. The file is bigger than a theme file, but much smaller than a full rom. For example, say you have a theme which modifies the icon for the Calendar app. The theme file contains a single image and the theme control file. The resulting update zip file will contain a patched version of /system/app/Calendar.apk and the update-script file. When you flash the update the new version of Calendar.apk gets installed and you'll see the new icon. ZipThemer can easily create update zips to install multiple themes and therefore patch multiple packages/apps in one update, so this is just a simple example to explain things.
Hope that helps,
Ken
Click to expand...
Click to collapse
Worked like a charm and thanks for the quick response!
Kfunk said:
Is the final output a theme file or an entire rom with the theme incorporated into it?
Click to expand...
Click to collapse
Sorry, if you meant "theme file" as a something you flash in recovery to apply the theme, then the answer is the final output is a theme file.
I tend to think of theme files as MetaMorph files, and I forget that there are a lot of themes delivered as flashable updates.
Ken
kellinwood said:
Sorry, if you meant "theme file" as a something you flash in recovery to apply the theme, then the answer is the final output is a theme file.
I tend to think of theme files as MetaMorph files, and I forget that there are a lot of themes delivered as flashable updates.
Ken
Click to expand...
Click to collapse
Yes, that was my intent by using the word "theme". It is a relative term in the world of Android!
I just released 1.4 after fixing some issues which came up installing a large morph that patches about 20 apps. Some of the apps were missing on my device...
Change Log:
* Better support for installing themes when some system files are not found on the device. This version skips theme sub-components when the corresponding system file is not present. A notice is displayed when themes are loaded indicating which files are missing and the completion status display also notes skipped files. This is not an error condition but an FYI that some of the files the theme is capable of updating will not be updated because they weren't found. The previous version issued a "file not found" error during the build and you had to explicitly disable sub-components as a workaround.

[HOW TO] Do it yourself guide for theme editing

To get started, read the posts below by tsachi.
Then give this a glance - Do it yourself guide for theme editing
More Resources:
http://forum.xda-developers.com/showthread.php?t=982300
https://docs.google.com/Doc?docid=0AcdxIJRSH9ypZGZzc2pxNDlfMjdnazk4OHNxZA&hl=en
http://forum.xda-developers.com/showthread.php?t=916814
Info on how to edit the items in notification bar:
+ http://forum.xda-developers.com/showpost.php?p=11158662&postcount=3
All credit belongs to the original authors. I am simply gathering all this information to make it easier.
For any help or support, post in this thread and we will try to help you the best we can.
Expanded Information
Introduction
The link in OP gives you instructions on how to replace images, but it lacks information for the inexperienced themer. Here is some background information and some more details on the steps before and after you insert new images in your framework.
System Icons and background images sit in two main files: framework-res.apk and twframework-res.apk. Within these files there is a res directory, and under that you have the folders containing data. Google has guidelines on icon design, although themers usually ignore those in order to get a different from stock look. One thing you would notice is that there are a lot of repeated icons. For example, framework-res.apk has both drawable-hdpi and drawable-hdpi-v4. The first is there for compatibility with older APIs (anroid 1.6 or older) so I am not sure why it is still there, but if you remove it your phone will not like it.
Each application has its own res folder where the launcher icon and other visuals are kept. There are, however, a lot of applications that reference the framework.apk for visuals. An example is the dialer that calls on some background images from both framework-res and twframework-res.
There are 2 types of images that you would encounter. Normal icons and images are non-scalable. They take a certain amount of real estate on the phone, and that’s it. Example of these are the battery levels and notification icons. The other type is the .9 images. These are images that are going to be stretched to fit whatever space is needed. An example of that are the menu backgrounds. The .9 images have a special format. The one pixel border around them defines how they stretch and how content is displayed in them. It is highly recommended to follow the standards in order to get repeatable and consistent look. Android SDK has a tool to help with .9 file design: draw9patch.bat.
Important note: The .9 files show the borders ONLY when de-compiled. If you grab a file from the framework directly you will not see that line. It is therefore required to compile the .9 files after you make them. You can use apk manager or ThemePro-JAVA to recompile the framework apk after modifying the files.
Definitions for which image is used where sit in the xml files under the drawable folder. These are compiled xml files, you can’t edit them with a text editor. For this introduction I will not go into modifying xml files. Each apk also has a resources file that describes what is in there. If you add, remove, or rename files in the apk you will have discrepancy with the resource file and the theme will not work (more likely you will be stuck in an infinite bootup loop)
Before you start:
Warning: frameworks are highly linked with other files. You can’t just take a framework from one ROM and put it in another. Always keep a backup of the original files ready to be installed (see below), otherwise you may need to re-flash the ROM. Frameworks are also sensitive to compression. DO NOT use winzip to handle the files, it can cause problems with the final apk file.
There are several things you would need before you start
A rooted phone
SDK installed on the computer
A zip handling software other than winzip (winRAR and 7-zip are both good options)
Auto-sign (http://forum.xda-developers.com/showthread.php?t=471634) or signing tool (http://forum.xda-developers.com/showthread.php?t=473580)
Create a backup
Grab the framewor
k-res.apk and twframework-res.apk from your phone. They are located in the system/framework folder. You would need them as a starting point for your modification and you need them for a backup
Create a clockwork installation file of the original files (see post below)
Name the installation framework-original.zip, or something else that would be easily recognized in
case of trouble, and then copy it to your internal sd card.
After you are done modifying files
Create an installation file (see post below)
Give the file a name that is easy to recognize and copy it to your internal sd card
Reboot into recovery
Select install zip from card -> choose zip from sdcard
Select the installation of the new framework and confirm the installation
Reboot
If you are stuck in an infinite boot-up cycle
Take the battery out
Using 3-key combination boot into recovery (up-down volume + power. Hold until the AT&T screen cycles back, then release)
Install your original framework backup and reboot
Creating clockwork installation
After you have finished modifying the files, the best way to get them to the phone is through clockwork installation. Make sure that you have the original update.zip file on the sdcard. If you have a rooted phone, you probably have that already, but if not you can install ROM manager from the market and run it to get the update in place.
To create the installation file follow these steps:
Create a folder \framework
Place your modified framework files in that folder
Back in the main folder, create the following folder tree: \META-INF\com\google\android
In the android folder create a text file named update-script
WARNING: Do not name your framework file "update.zip"! You need both the original update.zip and the framework one for the installation.
Note: Although copying of the framework files may be possible, it is highly risky. In my experience installation from clockwork is the easiest
Puzzle Lock Screen Mod
Here is information for people who want to modify the look of the puzzle lock screen. It is only the list of images to replace, not the coding to change functionality.
The files sit in framework-res.apk under res\drawable-hdpi. The files are zzz_unlock_puzzle...
puzzle pieces
zzz_unlock_puzzle_noti_icon_call.png : Missed call piece in the floating state
zzz_unlock_puzzle_noti_icon_call_fit.png : Missed call when it gets to the unlock spot
zzz_unlock_puzzle_noti_icon_unlock.png : General unlock floating
zzz_unlock_puzzle_noti_icon_unlock_fit.png : General unlock at the unlock spot
Same for messages and voicemail.
Background
zzz_unlock_puzzle_bg.png : The image that shows on the lock screen. This should be semi-transparent if you want to show the regular screen background
zzz_unlock_puzzle_bg_pressed.png : Image that shows while dragging the puzzle pieces. Usually a slight modification of the regular background
zzz_unlock_puzzle_bg_land.png : The landscape version
Music player
zzz_unlock_disk... and zzz_unlock_ctr_pr... are the files related to the player.
zzz_unlock_ctr_bg.9.png is the background for the music controls
Text background
Overlaying the unlock image is text. That text can have background that is more opaque than the rest of the unlock screen.
The attached image shows the three regions. These regions also apply to the glass unlock.
Note: These are .9 files and should be done right to ensure correct stretching and text boundries.
Other files
There are some extra background files in the frameworks but I haven't been able to find where they go. There are also some files to control the clock numbers zzz_unlock_clock_...
Working with APK manager
What is APK manager?
APK manager is a tool for decompiling / recompiling apk files. If you want to change anything other than images, it is a must have.
The basics
The basic flow when using APK manager is
Place apk file in place-apk-here-for-modding folder
run the Script.bat file
Type 22 and select the file you want to work with
Type 9 and wait for it to finish decompiling
Modify the items you want modified (they will be in the projects folder)
type 11 to recompile
Sounds easy? It is, and it isn't. There are several places where things can go wrong. Here are a few of the things to watch for:
Bad starting file
This is mostly true for framework files that went through several cycles of modifications. The framework is forgiving to having extra items, or having bad .9 images (see post above about .9 images). Some people may have replaced images without recompiling the framework in a way that breaks internal links. If this happens you will very likely see error messages during the decompile stage. If that happens check the log file and correct things. One of the most common errors is .9 files replaced with regular images. See this post for how to solve this.
Things may not always be "fixable", so the best approach is to get the original framework that is the base for the one you need. Having a clean start can save a lot of headaches later on.
Overwriting your changes
When you recompile, assuming everything worked ok, you are prompted if this is a system file. Most likely you want to say yes. This ensures that the original signature is copied over. You will also be prompted if you want to copy some files over from the original. BE CAREFUL!. There are people who say you reduce the risk of errors if you copy things that didn't change. Personally, if I changed anything that required recompilation (mostly added new images or modified xml files) I always choose not to copy extra files. If you do choose to copy some files over, pay attention to the next step. Do not hit any key until you remove the modified files. You will need to go to the newly created "keep" folder (in the top apk manager directory) and remove any image that you changed and any xml that you modified. Also, if you modified xml files to add new images you need to delete "resources.arsc".
Failed rebuild
APK manager is trying to minimize work by only compiling newly changed items. If you built an apk and realized you have an error, or want to add more changes, I recommend removing the cached build. Go to the projects folder and delete the "build" folder. I've had cases where the new items didn't catch.
Removed items
I highly recommend to leave icons that you do not need. I've had occasions where I removed things that I thought had no more reference, but then ended with endless boot-loops. For example, if you modify the xml to only show 6 out of the 101 battery charge animations, leave the remaining icons in your project.
If you're stuck
Look at the log file. That would usually give you an answer. Also, if you are working on a recent GB ROM you probably need to get the beta 5 version. Version 4.9 will have problems compiling the newer files.
Thanks for the info!!! I have been wanting to play with themes for a while. Now I gots the knowledge.
sent from my Cap using the app.
Thanks for this post...I'll be looking into this for sure.
tsachi said:
After you have finished modifying the files, the best way to get them to the phone is through clockwork installation. Make sure that you have the original update.zip file on the sdcard. If you have a rooted phone, you probably have that already, but if not you can install ROM manager from the market and run it to get the update in place.
To create the installation file follow these steps:
Create a folder \framework
Place your modified framework files in that folder
Back in the main folder, create the following folder tree: \META-INF\com\google\android
In the android folder create a text file named update-script
WARNING: Do not name your framework file "update.zip"! You need both the original update.zip and the framework one for the installation.
Note: Although copying of the framework files may be possible, it is highly risky. In my experience installation from clockwork is the easiest
Click to expand...
Click to collapse
Thanks for this.. Question In #4 above the text file in the android folder. Is that an empty file? no extension? Thanks for your help.
TorqueWrench001 said:
Thanks for this.. Question In #4 above the text file in the android folder. Is that an empty file? no extension? Thanks for your help.
Click to expand...
Click to collapse
The file has no extension but it isn't empty. It contains the installation instructions. Typical instructions would be:
copy_dir PACKAGE:framework SYSTEM:framework
which copies everything in the frameworks folder in the zip file to the system/framework folder on the phone
Sent from a captivate running phoenix using XDA app
https://docs.google.com/Doc?docid=0AcdxIJRSH9ypZGZzc2pxNDlfMjdnazk4OHNxZA&hl=en
http://forum.xda-developers.com/showthread.php?t=916814
Good info
Thanks, been wanting to play with themes for a while now!!!!!
This needs a bump for all those requesting themes to be made.
This needs to be a sticky. I detailed guide is just what was needed. I been wanting to play around with themes but always end up doing something stupid so it never works. Now I have some more knowledge and hopefully can avoid that mistake.
Thank you, one of the links has the info I need to fix my text color issue in my notification/menu window!
Sent from a phone using an app.
Why it's not pinned it's beyond me. We have a thread pinned for must have apps that aren't even must have apps, but not this.
That was do to some how me missing this thread for the post few months. It is corrected now. Stuck
Since the thread is getting more life, I just added info on lock screen (fourth post)
Sent from my captivate running the latest firefly
Resorce dump
Well now that this is not going to fall to the depths of page 500, ill unload some rubbish into it.
http://android.modaco.com/content/zte-blade-themes-and-design-customisation/328510/guide-theme-editing-and-related-things/
http://forum.xda-developers.com/showpost.php?p=9066440&postcount=1
http://forum.xda-developers.com/showthread.php?t=593932
http://forum.xda-developers.com/showthread.php?t=695701
http://forum.xda-developers.com/showpost.php?p=8105110&postcount=2
http://developerlife.com/tutorials/?p=309
http://www.droidforums.net/forum/team-inversion-conversion/116419-so-you-want-edit-xmls-more-adb-apk-manager-how-basics.html
http://www.colorschemer.com/online.html
http://www.colorsontheweb.com/colorwizard.asp
Edit: I purposefully did not include descriptions in the links. If you dont know what your doing reading all but the last two links in there entirety will help get you on your way.
whiteguypl said:
Well now that this is not going to fall to the depths of page 500, ill unload some rubbish into it.
http://android.modaco.com/content/zte-blade-themes-and-design-customisation/328510/guide-theme-editing-and-related-things/
http://forum.xda-developers.com/showpost.php?p=9066440&postcount=1
http://forum.xda-developers.com/showthread.php?t=593932
http://forum.xda-developers.com/showthread.php?t=695701
http://forum.xda-developers.com/showpost.php?p=8105110&postcount=2
http://developerlife.com/tutorials/?p=309
http://www.droidforums.net/forum/team-inversion-conversion/116419-so-you-want-edit-xmls-more-adb-apk-manager-how-basics.html
http://www.colorschemer.com/online.html
http://www.colorsontheweb.com/colorwizard.asp
Edit: I purposefully did not include descriptions in the links. If you dont know what your doing reading all but the last two links in there entirety will help get you on your way.
Click to expand...
Click to collapse
Very nice, I will add these to OP with details about each link.
I'm quite happy that this has been pinned finally. Now to get to work. I haven't decided on which ROM I want to do, or even if I wanna port another theme or make my own. SO MANY CHOICES!!

[HOW-TO] MIUI MiLocker Themeing / Customization

Good Afternoon XDA Family and Friends - Modders and such...
Today, I would like to bring you something of a how to that would possibly get Sticky-d as I think that this app is growing in popularity and customization requests. Due to some demand on our Youtube Partner Channel, we are working on a Video on how to modify and deploy these new themes for this app to your non-rooted phone / device.
Many of you may or may not know about this software: MiLocker - App to allow you to get the MIUI type Themes that are seen on their ROMS on Non-Rooted and Rooted Phones. This app will let you customize your Lockscreen and have that MIUI type theme.
Please note that this tutorial - How To involves basic knowledge of XML and modifications of types of variables that are used in the theme.
I have enclosed 2 Samples that you can use as a basis, I have converted them from Japanese / Chinese language so that you can understand them better.
Some of the basic steps are outlined below.
1. First get the theme downloaded that you wish to modify using the Machine of your choosing: Mac or PC.
a. Upon getting the theme from the provider of the application to the device, you will then need to get it on the PC.
b. Connect your device to your machine as normal, and use “Disk Drive” to access the data storage on the device. (this could be internal or SD depending on device)
c. Once you have accessed the data on the device, look for the folder “MIUI” and under will be the “Theme” folder. In this folder will be all your downloaded themes. (MTZ Format)
2. After you have the MTZ files copied to your machine, (always best to create copies as this ensures you don’t break the mtz file you have already as source)
3. You can then (if you don’t already get 7zip for PC or The Unarchiver for Mac both free utilities) to then open the MTZ file and extract it’s contents to your desktop or destination of choosing.
4. Upon extraction you will usually find a few folders and files in there. Most notably: “Preview Folder”, “Wallpaper Folder” “Fonts folder”, lockscreen file, icons file, description.xml.
5. These are usually the basics for the theming. Most of them are self-explanatory.
a. For modifying or making your own wallpaper or preview, this is quite simple, just modify the wallpaper you find in the folders and create new ones using Paint, Photoshop or GIMP (utility of your choice)
b. Create a new wallpaper of the same dimensions used and name it the same as the original file found in the folder. Just delete the original when done. (Best cases for this I have tested are : 480x954, 480x860 and a few others) at about 72DPI or better.
6. Once you have created the wallpaper and it’s preview that you wish to show in the chooser, place those files in the respective folders.
7. To first start the modification and in this the main reason for the XML is to change the Chinese Characters displayed to English or US. Most people will just change the Wallpaper and repack, and that is ok. This is for those who seek to have English displayed.
8. In the first XML : description.xml - This file allows you to customize fields of Title of the Theme , Author, Version and such. These are the only three I recommend changing. ONLY CHANGE DATA between the <Title> THIS IS TO BE CHANGED</Title>
a. (changing only the data between the start and stop tags which are the <Field></Field> items)
9. Please note that changing the information in-between the start tags and end tags for XML is how the data is read by the application. So those values are how this is displayed.
10. The second XML is called the manifest.xml file, and it’s in the lockscreen file.
11. To modify this file, you need to rename the lockscreen file to lockscreen.zip and then extract the contents and open the folder under and look for the manifest.xml file.
a. Renaming method for Windows: Start > Run > cmd | in the command prompt, CD to the correct location of the lockscreen file and then issue the command with out quotes: “rename lockscreen lockscreen.zip”
b. Renaming method for MAC: Terminal – cd to the location of the lockscreen file issue the following command : “sudo mv lockscreen lockscreen.zip” It will ask for password, input your user password.
12. If the renaming happened correctly you should now see the file as a zip file.
13. You can now extract this file using 7zip or Archive utility or other to extract to a destination of your choice.
14. After you have done this, find the “manifest.xml” file in the folder from extraction.
15. You can edit this file in any great number of free XML utilities out there: PC : Notepad++ and MAC : TextWrangler. Editing this will allow you to find all the characters, which are not English and then copy them, open a browser and go to translate.google.com and translate them and insert the correct words as necessary.
16. When you have completed editing all the Japanese and Chinese out of the document, save it and then back out of the directory that you extracted and then ZIP the lockscreen file back up using Winzip, 7zip or Arhcive Utility in Mac or whatnot.
17. Once you have compressed and ZIP’d the lockscreen folder back up, you will see a new lockscreen.zip file with your modified files in it.
18. Now it’s time for you to Reverse Rename the file and removes the .zip file making it a file plain object. (Hint – Do the reverse of step 11 above, going from lockscreen.zip to lockscreen)
19. Once you have completed this phase, you will need to compress it to a MTZ to put back on the phone. 7Zip has this built in and you can just compress using 7zip and select MTZ as the file format. As for MAC I recommend using this Automator, which will do it for you. (MAC USERS WILL NEED TO TO one extra step)
a. Mac users will need to after creating the MTZ file, make the file Unix Executable – Terminal (open this app) and then go to the MTZ file and issue the following command: “sudo chmod a+x yourfile.mtz” , it will ask for password, do as above. Then the system will make it a UNIZ Executable just like the other MTZ’ files
20. Now transfer the MTZ file you have created back to your device and launch the app and choose your new theme.
MAC TOOLS for MTZ:
PLEASE EMAIL ME for TOOLS (don't have enough posts)
IF you have any questions, please feel free to email us at [email protected]
Or check our Youtube Channel as we will be posting a tutorial on this soon!
Please EMAIL for YouTube Channel (not enough posts)
Thanks.
FluxboxMedia and GeekTekneek
*****UPDATE******
Upon more and more research , our team has discovered that simple repackaging of the theme once modified does not always work as listed above. If you are using the PC and wish to use the 7zip method, the tip we found on DroidForums was to Open the MTZ file in 7zip and leave it open. Then 'Drag' From the file manager of 7zip the contents to your machine which will allow you to modify a copy of the theme. Make your changes , wallpapers and such, and then copy 'drag' them back into the open Archive of MTZ theme you did from above in this update. Once done, close the archive by closing 7zip. If you make any changes to the 'advance' folder under the lockscreen file (note you can just 2x click on the lockscreen file while in the 7zip archive and it will open), you will need to copy the changed files into this folder, and then click the "up one folder icon " it will annouce "There are changes to the original packing files, would you like to update the file and repack?" CHOOSE YES. Then you can close the entire 7zip app and deploy to your device. If you have questions, please feel free to email us. Video YTube tutorials will be online shortly.
Great idea. I really like this application. I also see it becoming a hit.
Yup, this app is awesome! I didn't know about 7zip's ability to compress to mtz, thanks for sharing that. What we really need is a tutorial on converting themes to mdpi
Great tut tho. Excellent and clear.
Tapatalkin it from my IHO CM7.1'd, ICS Themed Optimus V
Thanks for the support so far. We at our studio have done lots over the last 2 years with customizations and installations and testing, and just feel that now is the perfect time on a brand new app.
We are going to be doing a tutorial Video which will show the basics on it.
Some of them however are not happy with configuring the XML in the manifest file. (meaning as soon as you modify any part of it, the repack and then put on device) The theme comes out as just the default.
We are still working on some of the buggy themes.
Thanks
Examples of our work thus far
Examples of the Customization Completed
Converted from Japanese/Chinese to English Format
Attached as Inline image posting is restricted to people more posts than 8
???
Nice, I'm also working a TUT, nice locker/screenlocker to have! Easy to theme!
Pitty it doesn't run the ICS'ed ones
Hello
if i want to modify a theme for my SGA what resolution and DPI should i choose?thnks
kcls said:
Yup, this app is awesome! I didn't know about 7zip's ability to compress to mtz, thanks for sharing that. What we really need is a tutorial on converting themes to mdpi
Great tut tho. Excellent and clear.
Tapatalkin it from my IHO CM7.1'd, ICS Themed Optimus V
Click to expand...
Click to collapse
From HDPI to M/LDPI just resize images, and change dimension values in manifest.xml (be aware of how MIUI roms/apps sees y value), although you don't need to do that, if you're using newest MiLocker version (1.4.2 I guess?). But as for M/LDPI Miui rom port you have to do it.
Sent from my GT-I5800 using Tapatalk 2 Beta-5
Nice Info for people who are Novice about MIUI Themes and Lockscreens.
Thanks for the great tut :good: You deserve more thanks.

[Guide/Reference] The Basic APK & Theming Thread... {15/11/15}

Hi there.
The greatest thing about Android is that you can change just about every element of the U.I, and if all you want to do is change a few images it's as simple as copying and pasting, but this guide will teach you how to...
[*]Use ADB Commands
[*]Deodex
[*]Decompile
[*]Recompile
[*]Sign
[*]Zipalign
...in an easy to follow manner that will have you theming your own apks in no time. There are many many GUI programs which I'll link to below that automate the following process but experience has taught me that it's important to know the basic process for when those programs don't work, are no longer maintained or you just don't like them for whatever reason etc, and to be honest command line editing for me is just as quick, and I personally prefer the ability to have everything in one folder. So lets begin.
Some Requirements:
A Rooted Phone.
A BACKUP OF YOUR PHONE!
Java - Do this first if you don't have it installed already.
Notepad++ - An essential program for xml editing!
Photoshop or Gimp - You'll need one of these for image editing.
7-Zip or WinRar - Required for apk editing.
Patience. :silly:
Use Linux or a Mac? See the following threads for more information on using apktool on other Operating Systems...
[WIN/LINUX][Decompile/Compile] Quick Mod Tool 4.0 [decompile and compile with speed]
APK Manager for Mac OS X
[Linux][UTILITY][TOOL] APK Multi-Tool
[tutorial] decompiling,recompiling and signing in linux (27-01-2013)
How to install and use Apktool with Ubuntu
​
Quick Tips;
.apk files are applications on your Phone, but when they''re on your computer you can browse them exactly like you would a .zip file, so set your default zip program as the default program for handling apks which will makes things much easier when working with them.
Download themes for your Phone, for other Phones too even and compare the res folders and screen shots of the theme as that will give you a good idea of what image you need to look for when modding your own apks.
If all you want to do is change images then you don't even necessarily need to decompile, you can just drag and drop images in to an apk to replace a stock image so long as they have the same file name.
For more complex mods like changing text colors and layouts (.xml files) and editing .9 png images then you will have to decompile.
​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Most of us will have Java already installed, but if you don't then get it installed before doing anything else. To save you the time and hassle of figuring out what else you need to download etc I've made a zip for you to download which contains Apktool and ADB.
Download APKTool_CMD.zip to a location of your choice, preferably the C:\ drive which will give you a folder to work from. This is how mine currently looks...
Once your folder is setup, java and other tools installed, you're going to want to get any apks you want to theme off your Phone and there are numerous different ways to this, but we're going to use adb commands to pull files to your computer so we need to open a command prompt window in your Apktool folder. To do this simply hold the shift key then right click your mouse in the Apktool folder and select "open command window here", or just click on the included command prompt.bat.
I like to pull the whole system as soon as I'm rooted as it gives me a backup of stock files which I can then copy and deodex to be themed.
The command to pull your whole system is...
Code:
[B]adb pull /system/ Z1C_368[/B]
...you can choose something other than Z1C_368 as your folder name but it will create that folder in your Aktool folder. Alternatively you can just download individual folders, the commands are as follows...
Code:
[B]adb pull /system/app/ Z1C_368 app
adb pull /system/priv-app/ Z1C_368 priv-app
adb pull /system/framework/ Z1C_368 framework[/B]
...or pull individual files...
Code:
[B]adb pull /system/framework/framework-res.apk[/B]
...so now you should have a APKTool_CMD folder with another folder within it and at least your app, priv-app and framework folders in that, which we can use for the next step.
The tool I use is this - [Tool/Utility] JoelDroid Lollipop Batch Deodexer. While I will deodex all the files I've pulled to my computer experience and battery life has taught me to only deodex the apps I've themed on the phone, rather than run a fully deodexed ROM.
Before you can do anything else you need to install your framework-res.apk and SemcGenericUxpRes.apk/twframework.apk, which will put two apks at C:\Users\YourPCName\apktool\framework which are the resources apktool uses to work its magic. The two commands to install your two resource apks are...
Code:
apktool if framework-res.apk
apktool if SemcGenericUxpRes.apk
The command for decompiling is...
Code:
[B][U]apktool[/U] [U]d[/U][/B] framework-res.apk
...which will create a folder named like for like except for the .apk extension, and in this folder is where you'll find a couple of folders, the main one always being the res folder as it's in this folder that you'll find your images and xmls to edit. First glance of a decompiled res folder can be overwhelming, 596 folders in my frameworks, but we only need to focus on a handful in the majority of apks, and they are...
drawable
drawable-xhdpi-v4 (drawable-xxhdpi-v4 depending on your device)
layout
values
...you may need to delve into others sometimes but it's very rare that I've had to.
Once you've finished making your mods you need to recompile your apk using the following command...
Code:
[B][U]apktool[/U] [U]b[/U][/B] framework-res
...notice you only use the folder name here. If you get any errors here due to a bad edit apktool will usually tell you, in a roundabout way, you just need to read the code it throws up then retrace your steps, correct any bad edit and try again. If all goes smoothly you'll now have a new folder called dist, which contains your newly modified apk, but you can't use that just yet.
This is where 7-Zip or WinRar comes in to play. We need to extract from the original apk the Android.Manifest.xml and META-INF folder, into the dist folder, then from the new apk extract the resources.arsc also into the dist folder, then drag and drop all three files back into the new apk, but NOTE, it's important that you choose store as the compression method, any other will break the apk, and if you replace a broken framework-res.apk you will bootloop.
And signing is as simple as that. Alternatively you can use the following command...
Code:
[B]java -jar signapk.jar testkey.x509.pem testkey.pk8[/B] framework-res.apk.apk framework-resS.apk
...notice the extra "S", the output name has to differ from the input name otherwise it will give an error, if done right it will create a new apk called framework-resS.apk, just remember to rename it back to the original before using it on your Phone.
[TOOL] pySignare - Quickly Sign APKs [Windows]
Signing For The Play Store
If you plan on Publishing a Theme or any other app/apk to the Play Store then using the above method to sign your apks just wont work because you need to give it an individual signature that is unique to you, thankfully @AndroidGraphix has written a great guide that will show you how, it's a bit more fidgety than the above method but simple enough to follow...
AndroidGraphix said:
Click to expand...
Click to collapse
- Noobs guide to signing an APK with a Private Key​
DISADVANTAGES OF UNALIGNED APKs
Quite understandably, situation would be reserved for unaligned application packages. Resource reading would be slow and memory usage would be on the higher end of the spectrum. It would also depend on how many unaligned applications are present. For example, if less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain.
Click to expand...
Click to collapse
- SOURCE
Move your new signed apk into your APKTool_CMD folder, you can overwrite your original if you want, and use the following command...
Code:
[B][U]zipalign -v 4[/U][/B] framework-res.apk ZAframework-res.apk
...notice the ZA, zipaligning creates a new apk which has to be named different from the original, but use what you want, it'll need renaming again before you use it.
So now we need to transfer your apk back to your Phone, you can do it by copying to your SD, then to your system, change permissions, then copy to the right folder, but that's not only time consuming but highly tedious too, so a simpler method is to use adb using the push command as this allows us to push straight to the system overwriting the original with the correct permissions too. To use this method you'll need you'll need an unsecure kernel and/or Chainfires adbd Insecure app. Try the app first but if you still can't mount and push files read this thread - [HOW TO]Make your favorite kernel adbd insecure to run ADB as root on /system and try again.
Rename your zipaligned apk to it's original name, then we need to mount the system before we can push direct to the the system, and the command for that is...
Code:
adb remount
...then we need to make sure we're pushing our apk to the right folder on the Phone, so for the framework-res it's...
Code:
[B][U]adb push[/U][/B] D:\Xperia\Z1C_368\APKTOOL\framework-res.apk /system/framework
...yet for the SystemUI it's...
Code:
adb push D:\Xperia\Z1C_368\APKTOOL\SystemUI.apk[B][U] /system/priv-app/[/U][/B]SystemUI
...if it's any one of those two then generally you need to reboot, so just type...
Code:
adb reboot
...your Phone will restart and if you've done everything right your new mods should be displayed, happy days. So that's it for how to use command prompt for modifying apks.
So now you know how to prepare an apk for editing your going to want to theme it obviously, and the following links will help you with that.
XML 101 - XML Modding Made Easy!
How To Edit Resources
The Ultimate Android Themeing Guide
[GUIDE] Smali coding guide for beginners
[Reference] Interactive Phone Modification [GUIDE]
[TOOL] Android Drawable Resizer Tool
[GUIDE] Want to learn how to theme?
[Guide] demystifying build.prop [Valid entries]
General Questions about Themes GO HERE!!!!!
[INFO] Custom framework-res.apk resources.arsc using vendor overlays
[Tutorial][NICS Themer] Create Your Own Themed apk & Become a Themer
​
U.I Modding
Tutorial :- Changing App Icons
[TUTORIAL]How to Theme Your MMS
[How-to] Edit the "About Phone" display
[Tutorial][VIDEO] Add/integrate apps into Settings app!
[TUTORIAL] Where to find the colors for making a theme
[MOD][GUIDE]LockScreen Clock with seconds[ANY ROM]
[TUTORIAL] How to add various framework/Settings mods
[TUT][JB] HOW TO THEME SystemUI.apk for TOTALLY newbie!
[HOWTO] Integrating/Adding applications to the settings menu
[TUTORIAL][ICS][GB][JB]How to change Android's black background
[GUIDE][Ultimate]Theme Apps To Dark Theme | Theme Whole System | Newbies Here! 12/11
​
Text...
Text Color Guide
[GUIDE] Tips for themers
[GUIDE][REF]Changing System Text Settings
​
Statusbar...
[MOD][TUT] Merge The WiFi And Signal Icons
[GUIDE][MOD][SYSTEMUI] How to add 0.00KB/s meter on statusbar GB/ICS/JB
[TUT] How To Center The Clock On The Statusbar..And Move Other Icons As Well!
[How-To]Removing Battery Percentage, Adding Toggles,Battery Circles to Statusbar
[GUIDE][Mods][All Devices]How to add/ Change Clocks to Analog/ Digital with Seconds
​
The three best/most popular GUI programs are...
@Diamondbacks - Virtuous Ten Studio
@Ticklefishs - [TOOL] Tickle My Android
@BDFreaks - [Tool]Advanced ApkTool
...there are others but these are I what I tend to see referred to the most.
TIP:
Restoring modified files if you mess up is easier and quicker with a CWM.zip, especially if you're modifying any framework apks! Just because an apk might build with no errors doesn't mean it won't give you any when installed to the Phone.
I hope after reading this explanation you're left wondering what all the fuss is about, as it really is quite simple. I'll use the following two images, btn_default_pressed_holo.9 & status_bar_close_off.9 to illustrate the basic point of the borders...
Decompiled .9pngs:
Recompiled .9pngs:
Those borders control which part of the image is stretched (Left & Top) and where on the image content will be displayed (Right & Bottom). We'll use Draw 9-patch which is for editing the borders of decompiled .9pngs and lets you see how the image, when stretched, will be displayed on the Phone. Notice that the borders are different sizes, well that's because I only want/need a certain part of the image to stretch to get the desired look on the Phone.
...in the image below the left side shows the stretched image and desired effect should look on the Phone and the right side shows how it would look if I had edited the borders incorrectly or used none at all...
You can get away by not using a border but you would need to edit your image to specific dimensions to accommodate for the stretching, for example it might look fine for a simple OK button but it might not look right if you used the same .9png for a screen press which stretches the whole length of the screen, so you're better off just using them to begin with, plus you'll more than likely get errors down the line while decompiling or recompiling your apk.
The use of the border is made even more clear when you add text to an image. For my status_bar_close_off.9 I've filled all four sides of the image (except for an empty pixel in all four corners as that is the max amount of border you can use) as I need it to stretch the image just how I've edited it...
...but if I used the same sized left side border as the btn_default_pressed_holo.9 then this is how it would look on the Phone...
...which is obviously not the look I'm trying to achieve, as the left side border is causing the image to stretch incorrectly.
So that's basically it, depending on the image you're editing you can usually leave the borders alone but if you create one from scratch then you might need to play about with them if your images doesn't look quite right when used on the Phone. Here's a few links that will assist you further, especially the batch editing...
How to edit .9.pngs
[TUTO] Create your 9.png !
[UTILITY][TOOL] 9patchPngSuite [Windows&Linux]
How to draw NinePatch images with Photoshop - .9.PNG
[TOOL][Multi-Platform][.9.png][ALL DPIs] Android Resizer Tool
[Tutorial][Commentary] How To Batch Edit .9PNG/PNG Images
[tool] 9compiler - batch process for themers android
ClockworkMod Recovery zips are used for flashing individual files to whole ROMS and can be a life saver if you push a badly edited apk to your Phone that results in a bootloop. There's also a few programs that can assist you with that too, but if all you're doing is replacing a few files all you really need is a template, then it's just a matter of creating the Phones folder setup in the zip which is simply creating folders: system\app - system\media\audio etc then dragging and dropping your files into it. A basic understanding of the updater script is essential, a ROM.zip will more than likely wipe your Phone whereas a Theme.zip may just replace files but it might delete some also.[/QUOTE]
See below for a CWM.zip Template but first some helpful links...
[Tool]easy flasher v4 (ur own update.zip)
[Tool][Windows/Linux] Android Flashable Zip Creator
[Utility-Tool][DEVandThemers]CWMflashpack.zipCreatorV1{TheCollective}w/EdifyScripting
ERRORS encountered in CWM Recovery
[TUT] [for NOOB] editing updater-script for noobs!
[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation
​
This is my Restore_zip which is set up so you can add your own files to the framework and apps folders in the main system location, but you can easily add other folders to it if you want to add things like fonts, tones or anything else, just remember to add folders within folders if that's where the files you want to include are such as tones, media\audio\alarms for example.
If you navigate to META-INF\com\google\android you will find the updater-script which controls how the zip works and the text you see when you run it in CWM. As this zip is just for basically over writing files you don't need to edit anything except for a few lines...
...this is how I've edited it for my theme...
...so just edit it using Notepad++ to your liking.
When adding files to your zip add them using Normal as the Compression Method...
...Remember to remove the text files I've added otherwise they will be flashed to your folders too.
And that's pretty much it, the only way you're really going to learn is by reading then putting into practice what you've read and picking stuff up along the way, fortunately there are numerous guides for numerous mods and tools to help with a variety of tasks.
Notable credits and thanks to @iBotPeaches and @Brut.all for making it possible with - Apktool
Useful Suff...
rovo89 said:
In this thread, I'm presenting a framework which gives you the possibility to modify your ROM - without modifying any APK (developers) or flashing (users)!
...
Advantages:
No need to modify any APKs. This means:
No need to decompile, change things in smali, compile, sign, ...
It will work for odexed and deodexed ROMs.
Your mod is not bound to a specific version of the ROM. Unless there is a major change in the methods called for a certain functionality, your mod will continue to work even when you upgrade your ROM. Hell, it will probably even work with different ROMs.
Multiple mods can be installed at the same time, even if they change the same package. So you can use these battery icons and those quick toggles. Even hooking the same method twice is possible. Of course, this only works properly if the mods are not trying to do incompatible things.
It does its magic at runtime. That means you can implement options to let the user decide if they prefer the bikeshed to be painted in red or blue. Or you can have some extra logic for certain ROMs without building different mod versions.
It can be disabled easily without having to reflash.
It's open source.
Click to expand...
Click to collapse
- [FRAMEWORK ONLY!] Xposed - ROM modding without modifying APKs
Annex1 said:
CM10.1-THEME_BOOK
Theme book was created by Annex and Ebs512. I've been asked alot of questions from how to get started? what do I need to get started? to What Graphics program do I use? etc. We made a real simple theme guide to help get you started. This is in Layman Terms.. Nothing fancy.
ONLY THING FANCY IS MY FLASH BOOK
YOU MUST HAVE A FLASH PLAYER INSTALLED TO VIEW THIS!!!
Click to expand...
Click to collapse
- [GUIDE] HOW TO THEME CM10.1 - Animated Book
[Guide] Porting XTheme themes
[How to] XMLGenerator.jar + batch script v2.0
[Guide] Xposed Framework/TabletUI (Noob-Friendly)
[Tool] Drawable XML generator for CM7 theme chooser
[Guide] How to port themes to T-Mobile Theme Chooser
[Tool] [Theme Creator] [CM/Avatar] Theme creator tool
[INDEX][WiP] List of APPs & MODs that use XPOSED Module
[Tool] nhnt11's XML Generator Revived V2+Extended UPDATED!
[DEV/GUIDE]Creating APKs for use with TMobile Theme engine
[Tool][PortCx] Port CM Themes to Xtheme Engine in One Click!
Theme-Porter [v1.0] [Any Firmware / Rom Compatible] [WINDOWS]
[GUIDE] T-mobile theme engine for the faint at heart (non-linux users)
[1/30/2013] Mega 4.2.1 BlackBean Theme Template [XXHDPI/XHDPI/HDPI/TVDPI]
[MOD][XPOSED][4.0+] XThemeEngine beta5 - Theme engine for any rooted phone
[APK][Xposed] ResXploit : Theming your android the easiest way! No decompiling APKs!
-·=»‡«=·-[JB][CM10] Theme Engine Template Updated To V4 [8-7-12][XHDPI/HDPI]-·=»‡«=·-
Hi Guys, I tried to do a small tweak to my ROM like just a color change to signal bars, as mentioned in the XDA university, but once the apk is pushed to system/app and restarted, it went to bootloop. I just changed the color of a image file using GIMP (as mentioned), then dint work, so just tried decompiling SystemUI.apk and then recompiling then folder without any changes and push to system folder, even that dint work, then i saw this thread, i tried the replacing the resources.arsc from old apk (opened using winrar, and dragged to my folder), the opened my new recompiled SystemUI.apk with winrar and added this resources.arsc file which i extracted with compression option as Store, then pushed it bcak to /system/app folder , every time i pushed i connected the phone in recovery mode. But still in bootloop, the moment i replace the apk with original one, it works, can some one pls point out what am I doing wrong ?
Hardware - I9100 - galaxy S2
ROM - JellyBAM 3.3
Kernel - Siyah 5.1+
thanks,
merin
merin_83 said:
Hi Guys, I tried to do a small tweak to my ROM like just a color change to signal bars, as mentioned in the XDA university, but once the apk is pushed to system/app and restarted, it went to bootloop. I just changed the color of a image file using GIMP (as mentioned), then dint work, so just tried decompiling SystemUI.apk and then recompiling then folder without any changes and push to system folder, even that dint work, then i saw this thread, i tried the replacing the resources.arsc from old apk (opened using winrar, and dragged to my folder), the opened my new recompiled SystemUI.apk with winrar and added this resources.arsc file which i extracted with compression option as Store, then pushed it bcak to /system/app folder , every time i pushed i connected the phone in recovery mode. But still in bootloop, the moment i replace the apk with original one, it works, can some one pls point out what am I doing wrong ?
Hardware - I9100 - galaxy S2
ROM - JellyBAM 3.3
Kernel - Siyah 5.1+
thanks,
merin
Click to expand...
Click to collapse
Hi There
Try using 7zip to update the apk instead of winrar. if that doesn't work, post your logcats,
Thanks
trevd said:
Hi There
Try using 7zip to update the apk instead of winrar. if that doesn't work, post your logcats,
Thanks
Click to expand...
Click to collapse
I will try that when i get back home today, and is there any option i need to set when using 7zip like store mode ?
thanks,
merin
hi, I tried with 7zip, 1st i just opened the recompiled zip with 7zip and dragged and dropped the resources file from original apk to this archive, and pushed to phone , still boot looping, and then tried to right click on the resource file from original apk, and selected add to 7zip archive, and changed the archive format to .zip/compression mode to Store and saved, then pushed to phone, still boot looping. So here i have attached the logcat, hope that is correct how i have done it, after rebooting the phone, i typed in consle logcat > log.txt and it was waiting for device, once in boot loop i did ctrl + c, then it exited. Please let me know if you need more info, do i need to attach my original SystemUI.apk and framework-res.apk ??
Happy New Year !!!
thanks,
merin
Nice tuts I will try at home :thumbup:
Sent from my ST18i using xda premium
merin_83 said:
then i saw this thread, i tried the replacing the resources.arsc from old apk (opened using winrar, and dragged to my folder), the opened my new recompiled SystemUI.apk with winrar and added this resources.arsc file which i extracted with compression option as Store, then pushed it bcak to /system/app folder , every time i pushed i connected the phone in recovery mode. But still in bootloop, the moment i replace the apk with original one, it works, can some one pls point out what am I doing wrong ?
Click to expand...
Click to collapse
Hi.
Are you copying the AndroidManifest.xml and META-INF folder from the original to the new apk too?
Actually i did the exact thing you said yesterday, when i found in the youtube, and it worked thank you!, but dint copy the resource file (but had some fc's when opening camera 1st time), may thats the reason,,, so i should copy AndroidManifest.xml and META-INF and resource file ?, and is this a standard procedure when we do a recompile every time ? or it varies with situation ?
thanks,
merin
Hey hi guys....can any 1 tell me how to set boot image which i want hmmmmm
Sent from my HTC Desire HD using xda app-developers app
merin_83 said:
so i should copy AndroidManifest.xml and META-INF and resource file ?, and is this a standard procedure when we do a recompile every time ? or it varies with situation ?
Click to expand...
Click to collapse
It's how I do it every time and never have an issue (unless I've screwed up somewhere), so yes.
sagar4all007 said:
Hey hi guys....can any 1 tell me how to set boot image which i want hmmmmm
Click to expand...
Click to collapse
oh okey thank you XperienceD, does it make a difference if we just use apktool or Androidsuite for decompiling and building ?
thanks,
merin
merin_83 said:
oh okey thank you XperienceD, does it make a difference if we just use apktool or Androidsuite for decompiling and building ?
thanks,
merin
Click to expand...
Click to collapse
I think androidsuite uses apktool for its decompiling and build it just uses it through a ui as apktool is command line so its more a preference of use for you
Sent from my GT-N7000 using XDA Premium HD app
ttibbetts83 said:
I think androidsuite uses apktool for its decompiling and build it just uses it through a ui as apktool is command line so its more a preference of use for you
Click to expand...
Click to collapse
What he said. I've set this up for when such programs don't always work.
How about some links for how to guide for Ubuntu user and some links on .XML file editing I was doing .apk mods on windows then started messing around with Ubuntu and find its I little more work to get it setup but all an all it to me is a better environment for android then windows IMOA
Sent from my GT-N7000 using XDA Premium HD app
ttibbetts83 said:
How about some links for how to guide for Ubuntu user
Click to expand...
Click to collapse
After a quick search for android theming ubuntu there doesn't seem to be a lot of information for it, and this post...
Nikkopt said:
What and where have you heard about Ubuntu helping on theming? It depends on personal taste and choice. You also have much more tools to help you graphically on windows and mac os.
Click to expand...
Click to collapse
from this thread - Which version of Ubuntu is recommended for theming? suggests why.
here are some links for ubuntu installs that will help with .apk modding on ubuntu for those who want it
how to setup apktool on ubuntu
http://my.opera.com/ubuntunerd1/blog/2012/08/20/how-to-apktool-with-ubuntu-under-construction
ubuntu version of paint.net
http://pinta-project.com/
xaraxtreme looks to be a good program from what i have read but i have not tryed it out yet
http://www.xaraxtreme.org/download.html
gimp is avalable through ubuntu software center and for .xml ubuntu has built in editer software just by right click and open with text editer
hex color website http://www.procato.com/rgbfind/
Nice guide my friend :good:
if anyone get apktool doesn't work on apk JB 4.2.2 ROM you can use this Latest apktool http://d-h.st/cze
Rizal Lovins said:
Nice guide my friend :good:
if anyone get apktool doesn't work on apk JB 4.2.2 ROM you can use this Latest apktool http://d-h.st/cze
Click to expand...
Click to collapse
Thanks Rizal.

Categories

Resources