Learn how to create a theme

Learn how to create a theme for your Android device!

Way back in the old android days, people actually made their own themes in the form of a zip file. Crazy right!?! That meant you had to download the ROM, gapps (if needed) and another zip file for the theme you wanted. This also meant that when flashing, you had to flash all 3. Now keep in mind that zip themes were made primarily for stock OEM based ROMs. Your source based ROMs which were typically based off of CyanogenMod had the Theme Chooser, so zip themes weren’t needed.

So why make zip themes now? Well for the same reason they were made before. Not everyone wants to run a potentially buggy custom software. Some people would rather run their TouchWiz, Sense, LG stock or Moto Blur based stock software.(way back in the day it was Moto’s stock UI).  They preferred it simply for one reason, everything worked. You didn’t lose the functionality that made you buy the device in the first place which some times happens with custom roms.

So why are we reading this extremely long article? Well, I’m hoping that you’re reading this because you’re interested in making a zip theme. If you are, then please continue on. For this tutorial, we will be following how to get setup on Windows system.

There are some prerequisites to making a zip theme and here they are:

WinRAR – 32bit 
64bit 

7zip – 32bit 
64bit 

Apktool Files

Java JDK

Notepad++ 

Paint.NET (free image editing tool)

Download and install Java JDK 6 (make sure you get the right OS build and either 32bit or 64bit)
Download an install Winrar. After installing, your zip files will now have an icon that looks like a stack of books.
Download Apktool. After it downloads, right click the zip file and click on “Extract Files…” and extract the Apktool zip to your desktop.
Download and Install Notepad++
Download and install Paint.NET

Getting Started:

One of the first things you’re going to want to do, is take the framework-res.apk and the SystemUI.apk off your phone and put it on your computer. You can do this by various means such as a root file explorer and an sdcard.

For purposes of this guide, we are going to assume you’re editing the SystemUI.apk and the framework-res.apk because these are the 2 main files for making a theme for a ROM.

Now take whatever apks you are editing and move them to your PC.

Now let’s go back to the Apktool folder on your desktop. It should look like this:

apktool

And your folder directory should look like this;

folder directory

 

Now take the apks that you just took from your phone, and put them in the apktool folder like this:

added apks

 

Now go back to your desktop. Now we’re going to hold the “shift” key, and right click on the Apktool folder. On the menu that pops up, select “Open command window here” and you should see this:

 

commandprompt

 

Obviously, your path to Apktool will not be the same as mine, that’s irrelevant. (Note: Anything you type into the command prompt IS case sensitive! Make sure you type everything correctly, or just copy and paste the commands from here!)

In that command prompt window, type the following code:

apktool if framework-res.apk

What this code does, is install the framework-res.apk in case it’s needed to edit any other files (and it will be).

You will see a message in the command prompt that says installation of the framework was successful.

Now it’s time to decompile the SystemUI.apk for edits, for that you will use this command:

apktool d SystemUI.apk

What this command does is tell apktool to “d” or decompile, the SystemUI apk.

Your command prompt should now look like this:

 

Now go back to the Apktool folder on your desktop and you’ll notice there is now a folder in there named “SystemUI” this will be where you make your edits. A few tips: Most of the images you will edit will be in the /res/drawable-hdpi folder. DO NOT EDIT ANY XMLS OR IMAGES THAT END IN .9 THESE CAN CAUSE SERIOUS SYSTEM ISSUES! READ UP ON THEM BEFORE YOU START EDITING ANYTHING IN XML FILES OR .9 IMAGES. When editing images, make sure the image keeps the EXACT same file name. You cannot change the name of any icons, that will come later.

Ok so let’s say that you have now finished all of your image edits and you’re ready to see your own work! That’s the simple part (as long as you didn’t mess anything up lol).

So now after editing, go back to your command prompt window. If you don’t remember how to do it, hold down “shift” and right click on the Apktool folder, then select “Open command window here.”

If you closed the command prompt window earlier, you need to reinstall the framework-res.apk with “apktool if framework-res.apk”

Now in that same command window, type or copy/paste the following:

apktool b SystemUI

This command tells apktool to “b” or build what is in the SystemUI folder, DO NOT put “.apk” after SystemUI or you will get errors.

 

 

Now navigate to the apktool folder again and go the following directory /apktool/SystemUI/dist

Inside there is your newly built SystemUI.apk, however, you’re not going to use it lol. You’re only going to use parts of it.

Rename that new SystemUI.apk to something distinguishable, like “newSystemUI.apk.”

Now right click that new apk and hover over “7zip” and select the top option which is “Open Archive”

Now go back to the apktool folder and open the old SystemUI.apk the SAME WAY! Right click, hover over 7zip, select “Open Archive.”

The same kind of window will pop up.

Now here’s where things get a little tricky.

You’re going to need to put these 2 7zip windows side by side!!!

Now hold down “ctrl” and highlight the following items in the NEW apk window:

res folder

resources.arsc

Now drag and drop both of those items into the OLD apk window.

Close out all windows

Now take that OLD SystemUI.apk which has the new images in it, and place it back on your sdcard.

Use a Root File Explorer on your phone and move the SystemUI.apk to /system

Now press and hold on the file and select “Permissions”

Make sure the permissions look like this:

Now move that apk to /system/app (or priv-app, whichever folder you took it from earlier)

Now reboot

Your phone should boot backup normally and you will see the changes you made.

Now repeat this process for every apk you’re editing.

If your phone fails to boot, you messed something up, seriously you did lol.

A few more tips and notes:

SystemUI’s and framework-res.apk’s are NOT inter-changeable. You cannot take these files from other ROMs and place them in yours.
Again, DO NOT touch the XML files, or the 9 patch images (images that end in .9) until you have read up on them A LOT. There are tons of posts that talk about dealing with .9 images and XML edits.

If you have any questions, please post  comment and I will try my hardest to answer as many as I can. A little later I will write an article on making your own flashable zip file, to put your apks in that way you can flash your theme, instead of copy/paste.

NOW GET OUT THERE AND MAKE SOME THEMES!!!!!

 

WeakSauce2
T-Mobile's Latest Uncarrier Move: Data Stash!

Super Fans always leave a comment :-)

Leave a Comment

Loading Facebook Comments ...