How to Theme Apps
First off, I'd like to give my biggest thanks to Team Blackout, who have basically teached me how to do all this. Without them, I'd still be stuck at decompiling apks. They have their own guide using apktool, which can be found here. My tutorial will be with VTS, a very noob friendly program by DiamondBack. You can download it here. Hopefully I can answer more questions, as this has been written based on my countless failures.
Though I have come a long way, I still regard myself as a novice. I'd be happy to help any user who needs it as a thanks for those who helped me. If you have any questions, PM me at asdfasdfvful. |
Setting up VTS
After downloading, unzipping, and opening the program, you will see this.
As we are editing apps, I suggest you press "search results" (bottom left), press the pin button (left of the close button), and drag it to the right side
Next, we must import an apk. Here is algeo calculator, which I'll be using in this guide if you want to follow along exactly. Download the apk, go to VTS and press File (top left), then new project. In path, browse to your apk. You can edit the Location and Name as you wish (don't touch Binary)
Press okay and wait. One thing I love about VTS is that it automatically installs Framework for you (it's in your user folder under apktool). If there are errors, message me. After it is done, you can make a backup if you want (right click main folder and press backup or go to backup tab). Afterwards, try compiling the apk without any changes to know that all goes well. Ready? Now it's time to theme.
Changing the Hex Colors
After going into res/values/colors.xml, you can already see that VTS makes it easy by giving you the colors on the left side. You can click on it and change the colors.
As algeo is not a very big app, you can see that there are not many colors. It is also quite obvious what each of them are (abs_background_holo_dark) is the background color for Holo.Dark themes). You can edit them as is, but I generally like to make my own colors to make it simpler for me. Add
<color name="background">#ff000000</color>
<color name="backgroundd">#ff1c1c1c</color>
<color name="backgrounddd">#ff333333</color>
<color name="text">#ffffffff</color>
<color name="textt">#ffdfdfdf</color>
<color name="texttt">#ffb6b6b6</color>
right above resources. Do note that I am blacking out this app, so the hex color is your choice. But this way, we can easily tell that there are 3 background colors and 3 text colors.
You can also see that there are lines like
<item type="color" name="abs__bright_foreground_inverse_holo_light">@color/abs__bright_foreground_holo_dark</item>
Where it is linked with another color rather than hex. To change that, you can rewrite it as
<color name="abs__bright_foreground_inverse_holo_light">#ff000000</color>
Now, lets search the decompiled app for all the colors in color.xml. Press ctrl + f, find
Now that we see everything, open up the first one and look at the files. You can ignore colors.xml, public.xml and all the smali files. The first we have to edit is in the colors folder. From here, we can replace both @color/abs__bright_foreground_disabled_holo_light and @color/abs__bright_foreground_disabled_holo_light with @color/text as it is foreground. Note that we can do this with all files, so look at my screenshot below. Also watch out and make sure you didn't copy a space at the end of the "replace with". You will be asked to reload documents. Say yes to all. You can do the same with all the other colors. Be careful to select from "android:color" at least to "/>". You don't want to edit anything else. There is no need to select <item android:state, but that was just a precaution for the first edit. Also feel free to use textt or texttt to add different shadings. Also note that you should only change things with android:color or @color. Don't change drawables!
Once you are done this, do a search for android:textColor, android:background, @*android:color, and >#, and ="#. For all the ones that refer to @color and a hex value, change them accordingly. For backgrounds, do note that #00000000 is transparent, which normally doesn't need to be changed. For the other hexes (there are a lot of hex for buttons), I generally replace them with @color/backgroundd or something. Once this is all done, you'll probably want to build the app to see if everything is going alright. You might also want to install it on your phone to see if everything was correctly signed. First, open your new apk. Go to the binary folder (right side in home tab) and open the app with winrar. Do NOT extract. Next, open your original algeo apk and copy the jsr305 and the manifest out. Copy that into the themed apk with store mode, resign it (I use zipsigner for android) and install it onto your phone. You'll need to uninstall the original app first though. Note that you will need to do this EACH TIME you make a new version.