[Guide:] The Definitive APK Modding and Theming Thread... - Android General

First of all, you don't actually need to be a "developer" as such to be able to theme and you don't need to know or have to learn lots of code either.
Secondly, EVERYTHING you need to know and need to use to modify an .apk is in this thread!
{
"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"
}
The greatest thing about Android is that you can change just about every element of the U.I and it’s really easy to do too. I wrote this guide to share the experience and knowledge I've gained since joining xda to debrand my SonyEricsson XPERIA X10i that was running Gingerbread. In 2017 there are a few different ways you can theme a ROM.
Apktool, which can decompile an .apk allowing you to modify your own .xmls and .9png images, which is what this thread will focus on.
RRO, Xposed essentially overlay themes or mods.
There is a variety of programs that use a GUI to do the work of Apktool for you, some good, some bad but at the end of the day they all ultimately do what you can easily do yourself in a faster, cleaner and more efficient manner in my opinion.
Overlaying doesn't cover every element so falls short of a one stop solution for being able to fully theme a ROM and is a bit more complex and/or restrictive in it's approach.
Tools you're going to need:
Java - Do this first if you don't have it installed already.
Apktool - The main tool for decompiling and recompiling apks.
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 working with apks.
We also need the ADB files from the SDK Platform and a sign.jar but to simplify this as much as possible I've made a zip for you to download which contains Apktool and everything else you need that you haven't got from the list above.
Download APKTool_2.2.4.zip to a location of your choice, preferably the C:\ drive which will give you a folder to work from. To keep the folder updated you can download the updated files from the retrospective thread/sites and simply replace them in the folder.​
This thread will cover the following in an easy to follow and straight forward manner that will have you theming your own apks in no time.
Getting apks from a ROM
Deodexing
.apk De-compiling
.apk Recompiling
.apk Signing
.apk Zipaligning
Pushing Files to your Phone
.9 images
Vector Drawable
.xmls
+More
Quick Tips;
.apk files can be browsed like .zip files so set your zip program as the default for handling apks which will makes things much easier.
If all you want to do is edit images then you don't 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.
Restoring files if you mess up is easier and quicker with a CWM.zip, especially if you're modifying 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.
​
Getting apks from a ROM:
Once your Apktool folder is setup you need to get the apks you want to theme out of a ROM or off of your Phone and there are a couple of ways to do this.
1. The simplest method is to extract your phones whole system from an unofficial update file from xda, whatever format that may be in depends on your device. I extract the whole system with every new update before doing anything because it gives me a backup of stock files which I can also copy and deodex to be themed.
2. Use adb commands to pull files to your computer, to do that we need to open a command prompt window (hold the shift key then right click your mouse in the Apktool folder and select "open command window here").
The command to pull your whole system is...
Code:
[B]adb pull /system/ XC_206[/B]
...you can choose something other than XC_206 as your folder name but it will create that folder in your Apktool folder. Alternatively, you can just download individual folders and the commands to do that are…
Code:
[B]adb pull /system/app/ XC_206 app
adb pull /system/priv-app/ XC_206 priv-app
adb pull /system/framework/ XC_206 framework[/B]
...or to pull individual files...
Code:
[B]adb pull /system/framework/framework-res.apk[/B]
3. Use a root explorer on your phone to copy files to your SD and then to your PC.​
Depending on your method you should now have a ApkTool_2.2.4 folder with another folder named 206_system for example in it. The only folders we need at this point are app, priv-app and framework which we need for the next step.
Deodexing:
“Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.” – What Is Odex And Deodex In Android​The tool I use is this - [Tool/Utility] JoelDroid Lollipop Batch Deodexer. To save a lot of time I only deodex the apps I'm going to use because it removes the process of having to mess about with smali and baksmali, plus YOU DON'T NEED TO DEODEX YOUR WHOLE FW!, depending on the apk and/or the mod you want to make you don't even need to deodex.
So now you should have a folder named system full of deodexed apks that are ready for playing with.
Decompiling:
Decompiling is the process of deconstructing an apk which gives us workable source code so to speak and we need to do this to be able to edit xmls in Notepad++ or .9 images in an image editor. As said above if you don't want or need to decompile because you just want to change an image here or there you can just drag and drop your res folder out of the apk, find the image I wanted to replace or modify, drag and drop it back in to the apk and push it back to your phone.
Before proceeding you need to install your framework-res.apk and depending on your FW possibly another apk if there is one in the framework folder, which will put one (or two) apks at C:\Users\your-pc-name\AppData\Local\apktool\framework The two commands to install your apks are...
Code:
[b]apktool if framework-res.apk
apktool if SemcGenericUxpRes.apk[/b]
The command for decompiling always begins the same, apktool d then simply change it for the name of the next apk you want to modify. To decompile the framework-res.apk the command is...
Code:
[B][U]apktool[/U] [U]d[/U][/B] framework-res.apk
...this will create a folder named framework-res and it’s at this stage that you can now begin to modify .9 images and xmls to create the desired look or mod you’re after. In this folder you'll find a couple of folders but the one we want is the res folder. First glance of a decompiled res folder can be overwhelming, 1541 folders in my framework but we only need to focus on a handful and it's generally the same in every apk...
drawable
drawable-xhdpi-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.
Quick Tip;
Once you've entered a few commands so long as you leave the cmd window open you can quickly scroll back through them using your arrow keys.
Recompiling:
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.
Signing:
To sign stock system .apks 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.
For 3rd party apps you can use the following command...
Code:
[B]java -jar signapk.jar testkey.x509.pem testkey.pk8[/B] Chrome.apk ChromeS.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 ChromeS.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:
What you'll need to sign an APK.
Click to expand...
Click to collapse
- Noobs guide to signing an APK with a Private Key​
Zipaligning:
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. - SOURCE​Move your new signed apk into your APKTool folder, you can overwrite your original if you want, and use the following command...
Code:
[B][U]zipalign -f -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 back to the original again before you use it.
Pushing Files to your Phone:
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 to the SD Card then install it to the system overwriting the original with the correct permissions too. If you do this with the framework-res or SystemUI apks you will need to reboot but generally all other apps will just refresh with the changes applied. The command to push to the SD Card is...
Code:
[b]adb push SystemUI.apk /sdcard/SystemUI.apk
[/b]​...then we need to mount the system before we can install our modified apk and the commands for that are...
Code:
[b]adb shell
[/b]​
Code:
[b]su
[/b]​The prefix will then change to the $ sign
Code:
[b]mount -o rw,remount /system
[/b]​...then to install your apk...
Code:
[b]dd if=/sdcard/SystemUI.apk of=/system/priv-app/SystemUI/SystemUI.apk
[/b]​If any of that fails you could try 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.
.9 pngs:
I hope after reading this explanation you're not still 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
9compiler - batch process for themers android
Vector Drawable:
A VectorDrawable is a vector graphic defined in an XML file as a set of points, lines, and curves along with its associated color information. The major advantage of using a vector drawable is image scalability. It can be scaled without loss of display quality, which means the same file is resized for different screen densities without loss of image quality. This results in smaller APK files and less developer maintenance. You can also use vector images for animation by using multiple XML files instead of multiple images for each display resolution.​- developer.android.com/guide/topics/graphics/vector-drawable-resources
Vector drawables obviously serve a purpose but are a pita imo for themers as they are a lot more difficult to edit and achieve the look you want.
Using my power menu to illustrate the issue, Power off, Restart and Take screenshot icons are vector drawables but the Record screen icon is a png...
...as you can see the Record screen icon is significantly bigger and ruins the look of my power menu, to over come this I have two options.
1. Learn how to edit vector drawables and create a new icon.
2. Replace the vector drawables and use pngs.
The latter to me is preferable because I already have images that I've been using for the last few years and want to continue using, to do so I need to replace the code in the relevant xmls to point at images...
framework-res/drawable/ic_lock_power_off.xml
Vector drawable code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<vector android:tint="?colorControlNormal" android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ff000000" android:pathData="M13.0,3.0l-2.0,0.0l0.0,10.0l2.0,0.0L13.0,3.0zm4.83,2.17l-1.42,1.42C17.99,7.86 19.0,9.81 19.0,12.0c0.0,3.87 -3.13,7.0 -7.0,7.0s-7.0,-3.13 -7.0,-7.0c0.0,-2.19 1.01,-4.14 2.58,-5.42L6.17,5.17C4.23,6.82 3.0,9.26 3.0,12.0c0.0,4.97 4.03,9.0 9.0,9.0s9.0,-4.03 9.0,-9.0c0.0,-2.74 -1.23,-5.18 -3.17,-6.83z" />
</vector>
My edited code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/ic_lock_power_off_alpha"
xmlns:android="http://schemas.android.com/apk/res/android" />
framework-res/drawable/ic_restart.xml
Vector drawable code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<vector android:tint="?colorControlNormal" android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#ff000000" android:pathData="M12.0,4.0L12.0,1.0L8.0,5.0l4.0,4.0L12.0,6.0c3.9,0.0 7.0,3.1 7.0,7.0c0.0,3.9 -3.1,7.0 -7.0,7.0l0.0,2.0c5.0,0.0 9.0,-4.0 9.0,-9.0C21.0,8.0 17.0,4.0 12.0,4.0z" />
<path android:fillColor="#ff000000" android:pathData="M5.0,12.9C5.0,11.0 5.8,9.2 7.2,7.9L5.8,6.4C4.0,8.1 3.0,10.5 3.0,12.9c0.0,4.0 2.7,7.6 6.5,8.7l0.5,-1.9C7.1,18.8 5.0,16.1 5.0,12.9z" />
</vector>
My edited code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/ic_lock_restart"
xmlns:android="http://schemas.android.com/apk/res/android" />
framework-res/drawable/ic_semc_ic_dialog_screenshot.xml
Vector drawable code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<vector android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0"
xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#8a000000" android:pathData="M5,5l4,0l0,-2l-4,0l-2,0l0,2l0,4l2,0l0,-4z" />
<path android:fillColor="#8a000000" android:pathData="M19,3l-4,0l0,2l4,0l0,4l2,0l0,-4l0,-2l-2,0z" />
<path android:fillColor="#8a000000" android:pathData="M5,15l-2,0l0,4l0,2l2,0l4,0l0,-2l-4,0l0,-4z" />
<path android:fillColor="#8a000000" android:pathData="M19,19l-4,0l0,2l4,0l2,0l0,-2l0,-4l-2,0l0,4z" />
<path android:fillColor="#8a000000" android:pathData="M16,13l0,-2l-3,0l0,-3l-2,0l0,3l-3,0l0,2l3,0l0,3l2,0l0,-3l3,0z" />
</vector>
My edited code...
Code:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/semc_ic_dialog_screenshot"
xmlns:android="http://schemas.android.com/apk/res/android" />
...and the result as you can see here provides a much more unified look...
...and finally my desired end result...
.xmls:
Modifying .xmls is easy and pretty simply to understand, a massive clue in finding the ones you need to edit is the file names. You're not going to find a better guide than the one by Ticklefish so I'll just post a snippet here and you can head over and give the main thread a read and and a thanks.
Ticklefish said:
XML 101 - XML Modding Made Easy!
If you're modding Android, eventually you're going to have to edit some XML.
Want to center the clock in your statusbar? Rearrange the icons in your navbar? Change the layout of your notification screen? Get rid of a carrier label? Change the colour of some text?
Then you need to edit some XML files.
And you might not have any idea how...
Well, don't worry. The purpose of this thread is to show you just easy XML-editing can be. Once you've read it, you'll be one step closer to being an XML expert!
This guide is meant for noobs, experienced modders and everyone in between. Hopefully everybody can learn something..
Here's what this thread has to offer so far:
- Introduction (This Post)
- How To Delete A Line (Yes, Really)
- Some Useful Codes To Know
- How To Change The Colour Of The Status Bar Clock
- How To Put An Invisible Softkey In The Status Bar
- How To Center The Clock In The Status Bar...Part 1
- How To Center The Clock In The Status Bar...Part 2
- Centering The Clock In Xperia KitKat
- android:layout_gravity, android:gravity AND android:layout_weight
- Do NOT Edit "public.xml"!!​I also encourage others to post guides as well:
- How To Remove "am/pm" From The Clock On Pre-4.2 Roms (by @KronicSkillz)
- How To Swap The Notification And Status Bar Icons (by @Anmol0022)
- How To Hide A Centered Status Bar Clock When A Lollipop Device Is Locked (by @S0bes)​
Click to expand...
Click to collapse
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)
​
The following programs are some of the better programs you can use to automate Apktool for you...
@Diamondbacks - Virtuous Ten Studio
@Ticklefishs - Tickle My Android
@BDFreaks - Advanced ApkTool
@mDroidds - StudioAndroid # Automize everything!
...there are many others but these are a couple of what I've tried, still use or are popular on xda.
Quick Tip; Use VTS to edit certain xmls because it gives you a preview of any hex colour code and has a built in editor too which makes finding and changing colours a breeze.
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. I've posted a few links to different tutorials in the next post that you can use as a reference to theme your own phone, while the versions of Android change the methods and code are pretty consistent but you will have to adapt from time to time, but that's how you learn, refine your skills and become able to pass on your knowledge back to the xda community in the form of guides themes and mods.​
Notable credits and thanks to @iBotPeaches, @Brut.all, @jairomeo, @manup456, @armyranger251, @Stericson, @brandenk, @beagz

ClockworkMod Recovery:
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.​
ERRORS encountered in CWM Recovery
[Tool]easy flasher v4 (ur own update.zip)
[Tool][Windows/Linux] Android Flashable Zip Creator
How to edit updater-script and make recovery flashable zips and updates
[TUTORIAL] Making Flashable ZIPs, EDIFY Script, ZIP Signing & Key Creation
[Utility-Tool][DEVandThemers]CWMflashpack.zipCreatorV1{TheCollective}w/EdifyScripting
In the Apktool_2.4.4.zip is my CWM_backup.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. When adding files to your zip add them using Normal as the Compression Method and remember to remove any example files I've added otherwise they will be flashed to your phone too.
Links:
The following liks are what I've bookmarked over the years and posted them here for you to use as a reference, some of these may not apply for your device directly but that doesn't mean you can't learn from or adapt them to.
Locating hidden values, random dialogs and hardcodes
Theme Apps To Dark Theme | Theme Whole System | Newbies Here!
Theming 3rd Party Apps
Interactive Phone Modification
Theme Debugger - Test your themes
Rom Porter / System Extractor
9-Patch-Resizer
Android Drawable Resizer Tool
HOW TO THEME SystemUI.apk for TOTALLY newbie!
How to theme Lollipop and Marshmallow ROMs!
Theming Lollipop w/ Picture References
How to theme TW SystemUI
Where to find the colors for making a theme
Create Your Own Themed apk & Become a Themer
Power menu light><dark
Rom Logo In Settings/About
Theming Settings Heavily
Integrating/Adding applications to the settings menu
Quick Panel with Lidroid Toggles & Volume Sliders
Add Quickpanel Button In Statusbar To Switch Layouts
Increase QuickSettings Maximum number
How to add 0.00k/s meter on statusbar ICS/JB
How to add/ Change Clocks to Analog/ Digital with Seconds
Centre clock and icon switch. Update: bottom power control widget!

Xposed:
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. Many modules work for a wide range of ROMs from different vendors.
Multiple mods can be installed at the same time, even if they modify the same app. 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.
Click to expand...
Click to collapse
- Xposed
Porting XTheme themes
CM Theme to XThemeEngine Converter / Porter
Port CM Themes to Xtheme Engine in One Click!
List of APPs & MODs that use XPOSED Module
Xposed Framework/TabletUI (Noob-Friendly)
XThemeEngine beta5 - Theme engine for any rooted phone
ResXploit : Theming your android the easiest way! No decompiling APKs!

hello XperienceD,
first i want to say thank you, finally i can make some modifiaction of my rom, i am managed to get 3-wa-power on my stock rom, show full option in developer setting, change color and icon, etc (still far from my target though).
for now im trying to make my phone running holo dark themes (default is light), at first it looks fine, background change from light to dark, text black to white.
but now i found some color problem, can you help me locate color setting for this :
and for setting color, i want to change text color to holo_blue
for now, i am doing bruteforce, line per line, hope can fix this tonight, but if anyone know the where should i change the color setting, i am more than happy to accept it
thanks,
jacknb1ack

jacknb1ack said:
but now i found some color problem, can you help me locate color setting for this :
Click to expand...
Click to collapse
Check the links above "where to find colors" and "changing system text".

great, i think i've clicked all the link in ur post ... but looks like i've missde some link xD ...
thanks again.

jacknb1ack said:
great, i think i've clicked all the link in ur post ... but looks like i've missde some link xD
Click to expand...
Click to collapse
Did you find it in the end?

nice tutorial

XperienceD said:
Did you find it in the end?
Click to expand...
Click to collapse
yes .. thanks to you and all developers and themer here, i can finish my own customizing rom xD
and lately i've found that its need to resign all system apps to do better in what i want, and here is my last work xD
https://picasaweb.google.com/117267626749690688218/Halo2?authuser=0&feat=directlink

jacknb1ack said:
yes .. thanks to you and all developers and themer here, i can finish my own customizing rom xD
Click to expand...
Click to collapse
Nice 1.
jacknb1ack said:
https://picasaweb.google.com/117267626749690688218/Halo2?authuser=0&feat=directlink
Click to expand...
Click to collapse
Colourful.

Thread updated.

Awesome job on this man!

ssojyeti2 said:
Awesome job on this man!
Click to expand...
Click to collapse
Thank You, just trying to do my bit.

Can we get a linux version?
</end_troll>

thanks for the guide. really appreciated it. sharing knowledge is priceless.
im trying to re compile a APK which i have edited. but always it gives error. even if i de compile it and without touching anyting and try to re compile same result.
apk is a keyboard. i was trying to edit the layout. so is there any other way to do to modify 3rd party apks??
i do without any issue with systemui's framework etc
thanks again
EDIT - is that cos i have installed framework ????

Thank you for the post.
One thing that i have been trying to do is make a theme for "Floating Notifications" i was able to edit the apk and the xml files. everything works great on the phone and everything.
my issue is once if edited an app for theming how do i sign it so i can upload my theme to the playstore?
when i upload it to the dev console it says that my apk is not signed correctly or something like that.
can you please show me how to sign an apk after editing it for the playstore
thank you

That's exactly what i was looking for! Great post mate! Thank you!

Holy [email protected] dude this is monstrous! Thanks for your dedicated work!
Man I have seen tutorials but none as comprehensive as this. I mostly know all of whats here, but you have some invaluable links to all sorts of resources. This would have taken you a long time, I hope XDA members are appreciative!

Jarmezrocks said:
Holy [email protected] dude this is monstrous! Thanks for your dedicated work!
Man I have seen tutorials but none as comprehensive as this. I mostly know all of whats here, but you have some invaluable links to all sorts of resources. This would have taken you a long time, I hope XDA members are appreciative!
Click to expand...
Click to collapse
Thanks for your comments.
Sent from my C6603 using xda premium

Roladriz said:
Can we get a linux version?
Click to expand...
Click to collapse
These links should help...
XperienceD said:
Use Linux or a Mac?
See the following threads for more information on using apktool on other Operating Systems...
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
Click to expand...
Click to collapse
Dilesh Perera said:
EDIT - is that cos i have installed framework ????
Click to expand...
Click to collapse
I don't think it will be, it is either a protected apk or from a brand of Phone that isn't that common would be my guess, but you'd need to list the error logs?
amadovi43 said:
can you please show me how to sign an apk after editing it for the playstore
Click to expand...
Click to collapse
This is the only link I have bookmarked in regards to this - Noobs guide to signing an APK with a Private Key which is the one I used for my IceGreen theme.

Related

Apk Manager 4.9 - Makes Modifying Ur Apk A Breeze (Windows/Linux)

So i have written a simple script to ease the process of editing apks. Got a lot of downloads so thought its in demand
Whether you're doing basic image editing or editing the smali or xml files, on average u have to use (Brut.all or JF's smali/baksmali) awesome tool to extract the apk, edit it, then sign the apk and then adb push/install it. This process is quite tiresome if you are testing a method that needs fine tweaking.
This script should make the process a LOT smoother.
Theres an option of compiling/signing/installing all in one step
Thanks:
Goes to Brut.all for his awesome tool.
Goes to JF for ofcourse, smali/baksmali
Goes to farmatito for porting this script to linux
Features:
- Extract, Zip apk's.
- Optimize pngs (ignores .9.pngs)
- Zipalign apks
- Sign apks
- Push to specific location on phone
- Incorporates brut.all's apktool
- Pull apk from phone into modding environment.
- Batch optimize apk (Zipalign,optipng,or both)
- Quick sign an apk (Batch mode supported)
- Batch Ogg optimization
- Compression level selector (monitor status above menu)
- Batch install apk from script (option 16)
- Logging on/off has been removed. Instead a log.txt is created which logs the activities of the script organized using time/date headers
- User can change the max java heap size (only use if certain large apks get stuck when decompiling/compiling apks) (Option 19)
- Improved syntax of questions/answers
- Error detection. Checks if error occured anytime u perform a task, and reports it
- Read log (Option 20)
- U can now set this script as ur default application for apks. When u do, if u double click any apk it will install it for u.
- Supports batch installation, so if u drag multiple apks into the script (not while its running) it will install them all for u. U can ofcourse drag a single apk as well
- Added framework dependent decompiling (For non propietary rom apks). (Option 10). Checks whether the dependee apk u selected is correct.
- Allows multiple projects to be modified, switch to and from.
- Allows to modify system apk's using apktool but ensures maximum compatibility in terms of signature / manifest.xml
- Stuff i forgot i guess
Instructions (Windows):
- Place apk in appropriate folder (Any filename will work, if running for first time folders will not be there, you must run and then the folders will be created)
- Run script
- Minimize the script
- Edit files inside the project folder
- Maximize the script
Instructions (Linux):
- Place apk in appropriate folder (Any filename will work, if running for first time folders will not be there, you must run and then the folders will be created)
- Open terminal and change-directory to apkmanager (Easiest way is to type "cd ")
- Chmod 755 Script.sh
- Chmod 755 all files apps inside other folder (thanks for the tip bkmo )
- Run script by typing ./Script.sh
- Minimize the script
- Edit files inside the out folder
- Maximize the script
Requirements:
Java
Adb
Future Improvements:
- Manage multiple simultaneous apk edits (choose which apk to extract/build)
- Option to optimize the apks
- Option to adb push to user defined location
- Other stuff i dont know yet
Got problems ?
1. Make sure your path has no spaces
2. Your filename has no wierd characters
3. Java/adb are in your path
4. It's not a proprietary rom's apk (aka Sense,Motorola,Samsung) (If u are, then use option 11 and drag the required framework, eg com.htc.resources, twframework-res...etc)
5. It's not a themed apk (if it is, expect .9 png errors, use as close to stock as possible)
6. Look at the log to know whats happening
7. If all else fails, post as much info as possible and we will try to assist you.
MOD EDIT:
New DL link from this post
http://apkmultitool.com
Nice
As you probably know, I want to add signing and installing functionality to apktool. But I don't plan to make any kind of GUI for it, so such wrapper is a very good thing for many users, thanks
What is "Option to optimize the apks"?
I was thinking of incorporating the script "apkopt" it was basically using optipng to optimize the png's and then used zip align on the apks. Thanks btw, this tool wudnt exist without ur awesome script
I just did this so ppl would stop asking questions like "How do i change this/that in an app"
Here this is wht im talking about Link
Very nice
Thanks dude...
once again you manage to make modding easier with your scripts!
Does your apkopt avoid .9.png files? Because those have been a pain in the behind.
Re: Apk Manager 1.0 - Makes Modifying Ur Apk A Breeze
my script currently does not optimize apks. it will be in the upcoming updates and yea prolly when ill implement itll avoid .9.pngs lol
I have already incorporated "adb push" into the script.
Aside from adding an option to optimize the apks, is there anything else you guys think would make this script easier to use ?
Im really targetting those ppl who overcomplicate the simple process of editing apks. Any tips would be appreciated.
I posted a video attached to the main post.
New version out, features added are
Zipalign apks
Optimize pngs, ignores .9.pngs
allows to adb push to phone through script.
Great script man, it works flawlessly. You may just wanna edit your post #1 rather than continuously bumping with new posts for every update. I'm sure a mod won't be too pleased with that
I'm getting the
'java' is not recognized as an internal or external command, operable program or batch file​message when I attempt to sign an apk. I tried switching the PATH in Environment Variables so that it's pointing to my Java bin folder, but then I just end up with
java.io.FileNotFoundException: ..\place-apk-here\repackaged-unsigned.apk <The system cannot find the file specified>
at java.util.zip.ZipFile.open<Native Method>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>
at java.util.zip.ZipFile.<init><Unknown Source>
at com.android.signapk.SignApk.main<SignApk.java:320>
Could Not Find C:\ApkManager2.0\place-apk-here\../place-apk-here/repackaged-unsigned.apk​Help? :]
What app are you trying to edit ? also are you editing pngs only or code editing ?
Hop on Here im helping someone out so ill help u 2
There's a lot of things in /system that benefit from the optimized .pngs. Vending.apk, for instance, shrunk to half the size and runs a bit quicker and smoother now. Even framework-res.apk enjoyed the optimization. Paid apps, on the other hand, don't seem to fare so well; perhaps they check the md5sum of the app or something.
Yea png optimization works for almost all apks, zipalign on the other hand as i recall doesnt work on certain system apks such as settings.apk. Im prolly gonna incorporate apkopt's script into this which would allow to optimize a folder full of apks. As for paid apps not being optimized, a lot of dev already do their part on making the apk as small as possible, so perhaps thats the case.
hmm, after trying a couple of unpaid apps, it seems that perhaps the testkeys aren't compatible with my build. For any signed app, I get an error "Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]"
Yes when u modify a non system apk, they need to be resigned, and you cannot resign it with same key as dev cuz u dont know it hence anytime u modify an app, u must uninstall it, install the modded version, and from then on any change u make u dont have to uninstall as the keys will match
ahhh thanks. My mistake was just removing the package rather than uninstalling it.
Getting this on a zipalign. The file is there but it is repackaged-unsigned.apk and throws this error:
Please make your decision: 5
Unable to open 'E:\ApkManager\place-apk-here\repackaged-signed.apk' as zip archi
ve
Could Not Find E:\ApkManager\place-apk-here\repackaged-signed.apk
The system cannot find the file specified.
Nevermind....looks like it is by design that it tries both signed and unsigned and throws the error on the file that does not exist. It's just I did not see any zipalign output
having an issue that when I go to resign an apk the file deletes after running the script.. am I missing something here?

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

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

[GUIDE](INTERACTIVE) HOW-TO Get Started Themeing/Modding [rev. 8/26/12]

*THIS HOPES TO SERVE AS A SLIPPERY STEPPING STONE FOR THOSE VENTURING INTO THE MODDING SCENE - AND FOR ANYONE TO POST THEIR QUESTIONS, ANSWERS, REQUESTS, AND COMMENTS ABOUT THEMES/MODS*
NOTE: This is still a WIP... I will clean it up, add/remove/replace as I, and others, see fit. Trying to make this a good resource for those wanting to journey into the rabbit hole..
I will try to make this as general as possible, but it is still mostly based off of Windows 7 OS. I will attempt to incorporate Linux (Ubuntu) as I can. Also, I urge other devs and users to please offer your advice or comments on how to make this thread as useful as possible, "I accept opinions, phone numbers, and the fact that not everyone wants smiles and eye contact" (sorry, homage to doseone - couldn't resist) - but PM's or posts are fine...
Finally, I have said it before about Android, and will say it again.. “there is more than one way to skin a cat...” meaning, that there are many, many ways to achieve the same outcome with different methods (but, I’m not sure who would want to skin a cat, and what for… but I guess I don’t even want to know where that phrase came from) - so, PLEASE SEARCH for more information, methods, tricks, and techniques - I can't fit everything under the sun into two posts - plus, I still got a lot to learn myself ...
Tools
Java JDK
Android SDK
7-zip (or similar file manager)
Notepad++ (or similar text editor – do not use windows notepad!)
GIMP (or similar image editor)
Sign+ (or similar zip-signing program)
Getting files from your phone
-Root browser: copy from original file location to sdcard
-adb pull (I will not go into an adb tutorial, but here’s an example):
Code:
adb pull /system/app/SystemUI.apk C:\Pulled
(I have two folders (“Pulled” and “Push”) in the root of my C:\ drive, where I do all my pulling and pushing)
-Take from a cwm backup (nandroid)
-Make a System Dump through adb (this is just something kind of fun, but not so necessary):
Code:
adb shell
su
busybox tar czvf /sdcard/systemdump.tgz /system
exit
exit
adb pull /sdcard/systemdump.tgz
You can delete it from your sdcard once it’s on your computer.
(for a Data Dump, just change the location to /data, and rename the tar file output..)
Edit png/jpeg images
-use 7-zip, winzip, (or stock File Roller on Ubuntu)
-GIMP or Photoshop (work best – but there are many other “tools” out there)
-open the apk (archive) with one of the above mentioned file managers and navigate to the appropriate /res/drawable folder (usually drawable-hdpi, but not only..). And, either copy the files you want to edit directly from there to your desktop or working folder, and make edits and/or drop your replacement files in the appropriate drawable folder in the apk with your file manager. Then move to your system to try it out.
GIMP Notes (it’s what I’m most familiar with, so, Photoshop users use your similar methods):
-Many times the images are in “Indexed” color mode. Go to Image>Mode and change it to RGB mode to avoid editing troubles.
-In GIMP 2.8.0, use the “Export..” feature to save your edited images (in older versions, use “Save as..”), and given quality options, I usually tend to the highest, and all boxes checked.
Decompiling/editing apks
Decompiling apks is necessary to edit .xml files and .9.png files.
See here for more information on the original apktool by brut.all: http://code.google.com/p/android-apktool/ <-- for ICS framework-res.apk, you need to decompile with v1.4.2, and compile with v1.4.3
See here for new version (v1.4.9) of apktool taken over by iBotPeaches: http://forum.xda-developers.com/showthread.php?t=1755243 <-- USE THIS ONE (it works for decompiling AND recompiling framework-res.apk on ICS)
More resources for decompiling/recompiling:
http://forum.xda-developers.com/showthread.php?t=1752201
http://forum.xda-developers.com/showthread.php?t=1466100
Some Tools:
APK Manager/APK Multi-Tool: http://apkmultitool.com/?q=node/5
APK Changer: http://forum.xda-developers.com/showthread.php?t=1189971
Studio Android: http://forum.xda-developers.com/showthread.php?t=1491689
Tickle My Android: http://forum.xda-developers.com/showthread.php?t=1633333
-use apktool alone (see above links for details)
-use an APK editing program (I still mostly use APK Manager v5.0.2 and switch out the apktool files)
-set the proper framework for apktool by placing framework-res.apk, moto-res.apk, blur-res.apk, and SystemUI.apk in the same folder as apktool.jar. Then, open the command prompt or terminal on that folder (need to hold shift and right-click maybe), and type the following, one at a time for each of the four apks listed above, hitting Enter after each entry (note that not all 4 apks are needed for all files, but it doesn’t hurt):
Code:
apktool if framework-res.apk
You should get a “Framework installed to:” message after each, showing you the location to which they were saved. Note on that: In all actuality, you could simply drop a copy of each in the \apktool\framework folder (my path is C:\Users\Owner\apktool\framework\), but rename them as following:
framework-res.apk --> 1.apk
moto-res.apk --> 2.apk
blur-res.apk --> 3.apk
SystemUI.apk --> 127.apk
Re-compiling apks
When compiling system apks, the trick is to save the original signatures (META-INF) folder, the AndroidManifest.xml (unless you are editing that but, that’s a whole different story depending on the apk), and not to compress the resources.arsc file (where all of the /values folders get hidden). Some apk tools do some of the work for you, but here’s few methods (they can be dependent on what was edited):
-after re-compiling your apk, copy your edited and compiled files back over to the original apk to preserve signatures and everything else you did not edit (do this with two 7-zip windows open). For edits to any xml in the /values folders, you need to copy over the resources.arsc also (see next note).
-after editing anything in the values folder, you need to re-insert the resources.arsc without compression. For example, rename your SystemUI.apk to SystemUI.zip, take out the newly compiled resources.arsc with your file manager and then “Add to archive..” that resources.arsc to the SystemUI.zip in “Store” mode (or “No compression”). Then rename the .zip back to .apk, and you should be good to go (you can check the compression directly in the 7-zip window – if the “Size” and “Packed size” values are different, then it’s compressed).
-you can also do it vice-versa, and copy the original META-INF, AndroidManifest.xml, etc., to your edited apk with 7-zip
-if you want to edit the AndroidManifest.xml, depending on the specific apk, be prepared to re-sign nearly all system and framework apps
Edit 9patch (.9.png) images
Do some research on what 9patch images are and how they work, but the most important point is to not disturb the 1-pixel black border around the image, unless you want to redraw it. You must decompile in order to edit 9patch images.
-use GIMP or Photoshop
-use draw9patch included in the android-sdk (fool-proof)
-with GIMP you can select the inner area, leaving the 1-pixel border unselected, and edit colors and such that way
-draw9patch is included in the /tools folder in the Android SDK, it only allows you to edit the 1-pixel border and only draws in #000000 (black) color. It will add one pixel to all sides if you are not careful, so you may need to resize it (down 2 pixels) with GIMP first
Baksmali/smali classes.dex (jar/apk files)
You need to have deodexed files to edit the classes.dex and the smali files within. See here for more info, downloads, and the definition of smali, baksmali, and dalvik: http://code.google.com/p/smali/
-decompiling the apk or jar with apktool will also disassemble (for editing) the smali files
-I used to use this baksmali/smali set with tutor (a good resource): http://forum.xda-developers.com/showthread.php?t=1136625
-or, as I typically do now, just remove the classes.dex from the apk/jar and just baksmali, edit, then smali that into a new-classes.dex. For example, I have a folder called smali_bak on my desktop containing baksmali.jar, smali.jar, and a .txt file with the commands shown below (I’m lazy to type it each time, so I copy and paste) – I put the classes.dex that I wish to edit in that same folder, then open the command prompt on that folder and type the following:
To disassemble (baksmali):
Code:
java -jar baksmali.jar -o classout/ classes.dex
To assemble (smali):
Code:
java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
Then, rename it to classes.dex and drop it in the original apk or jar file with a file manager (no need to worry about compression with the classes.dex, as far as I know)
Deodex and create new odex files
Deodexing is basically the process of converting your .odex files into classes.dex files, and inserting those into the apk/jar - basically. And, re-odexing is the opposite - basically.
See cogeary's excellent guide on deodexing for an excellent guide on deodexing.
-xUltimate v2.4+ works well for deodexing
-see also dsixda's Android Kitchen, and there are many other tools for deodexing..
-See here for manual deodex methods: http://forum.xda-developers.com/showthread.php?t=1208320
-See here for a tool/guide to create a new odex file: http://forum.xda-developers.com/showthread.php?t=1853523
This is the new bootclass path for us (and a bunch of other Motos) to use with ICS (taken from /init.rc, minus the jars that didn't exist in /system/framework):
Code:
/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar
Methods to move your modded files to your phone
-Create cwm recovery flash zips: Create a zip package (normal compression is fine) containing the proper folder structure (for example: /system/app/ and put your apk in the /app folder if that’s where it belongs). I have two folders on my desktop: /system and /META-INF, which I re-use basically for any flashable zip that I make (except ROM’s, of course). The /system folder has an /app folder or /framework folder usually, depending on what I was last working on (but it can obviously have different paths and many folders if need be), and in the /META-INF/com/google/android folder is an updater-script, and an update-binary file (just grab those from another update.zip mod package around here for now). The updater-script has the installation (or removal) info – meaning the location, permissions, and so on… After you create a zip package with those items and your modded files, then use a program like Sign+ to sign the package (or don’t but then you will need to toggle signature checks in recovery mode before installing). This will create three new files in the /META-INF folder (two CERT files and a MANIFEST).
-Use adb to push the files (don’t forget to set proper permissions!):
-Use Root Explorer (or similar) to move it (don’t forget to set proper permissions!):
NOTE: When experimenting with system files, please have a backup accessible just in case. Or, as I often do, make two zip packages - one with the modded files, and one with the original files to restore if necessary. And, as always, you are responsible for what you do to your device.
FURTHER READING:
Since I am obviously not the first to put something like this together, here are a few other general themeing guides:
Guide by theimpaler747: http://forum.xda-developers.com/showthread.php?t=916814
Guide by Nottach: http://forum.xda-developers.com/showthread.php?t=1186819
Interactive help thread by jeffsanace: http://forum.xda-developers.com/showthread.php?t=1605509
More (possibly out-dated) tips from Stericson: http://forum.xda-developers.com/showthread.php?p=3175518
See also this theming guide - did not read fully through it, but looks promising.
[HOW-TO] ADB/Change Moto Lockscreen to AOSP
BRIEF GUIDE TO USING ADB:
I will run through some example commands using adb - like pulling files from phone, pushing files to phone, deleting, setting permisisons, etc..
If you have adb set up in your environmental variables or .bashrc, then you can simply open a command prompt on the folder you would like to use adb from (right-click, or hold shift and right-click on the folder). Just always keep in mind your paths and folder structures.. Also, see HERE for more on adb.
Make sure you have adb and your device drivers installed and set up properly, then connect your usb..
Code:
#Terminates the adb server process (can help clear up adb issues):
adb kill-server
#Starts adb (or just use any adb command to start):
adb start-server
#List attached devices
adb devices
#Start logcat (Ctrl+C will terminate the current process)
adb logcat
#To pull files to the folder in your command prompt/terminal path
adb pull /system/framework/framework-res.apk
adb pull /system/etc/paranoid/preferences.conf
adb pull /cache/recovery/last_log
#To push files to our phone we need to first push them to the sdcard (also making a new directory on the sdcard called "newfolder")
adb push framework-res.apk /sdcard/
adb push SystemUI.apk /sdcard/
adb shell mkdir /sdcard/newfolder
adb push dexopt-wrapper /sdcard/newfolder
#To start a remote shell in the attached device and get superuser access
adb shell
su
#The following commands need to be run from shell..
#Mount /system re-writable
mount -o rw,remount -t ext3 /dev/block/system /system
#Copy files from sdcard to system
cp /sdcard/framework-res.apk /system/framework
cp /sdcard/SystemUI.apk /system/app
cp /sdcard/newfolder/dexopt-wrapper /system/bin
#Set proper permissions
chmod 0644 /system/framework/framework-res.apk
chmod 0644 /system/app/SystemUI.apk
chmod 0755 /system/bin/dexopt-wrapper
#Remove dalvik-cache and/or other files (note: on some ROMs, dalvik-cache is in /cache/dalvik-cache)
rm /data/dalvik-cache/[email protected]@[email protected]
rmdir /sdcard/newfolder
#Mount /system read-only (not necessary if rebooting right away)
mount -o ro,remount -t ext3 /dev/block/system /system
#Exit shell
exit
exit
#Reboot the device
adb reboot
Change Moto Lockscreen to stock AOSP (MultiwaveView)
(FYI - In GB it was a simple bools.xml edit to switch the Moto lock off.. and there's probably another way to do this - like by bypassing the zz_moto stuff entirely, but..)
If you have a custom locksceen already, then this probably doesn't apply or has already been done...
-decompile framework-res.apk
-open /res/layout/zz_moto_keyguard_unlock_widget.xml with Notepad++, Geany, or similar text editor
-delete all text there, and replace with this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.internal.widget.multiwaveview.MultiWaveView android:orientation="horizontal" android:id="@id/unlock_widget" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentBottom="true" android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera" android:directionDescriptions="@array/lockscreen_direction_descriptions" android:targetDrawables="@array/lockscreen_targets_with_camera" android:handleDrawable="@drawable/ic_lockscreen_handle" android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right" android:waveDrawable="@drawable/ic_lockscreen_outerring" android:outerRadius="@dimen/multiwaveview_target_placement_radius" android:hitRadius="@dimen/multiwaveview_hit_radius" android:vibrationDuration="20" android:snapMargin="@dimen/multiwaveview_snap_margin" android:feedbackCount="3" android:verticalOffset="0.0dip" android:horizontalOffset="0.0dip"
xmlns:android="http://schemas.android.com/apk/res/android" />
Stopping here and recompiling would give you something like this:
{
"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"
}
The above just changes the "widget" to the aosp multiwaveview and uses resources/drawables that we already have, which Moto decided to overlay with theirs (adding more bulk to the apks/jars)...
To edit the layout (remove/rearrange things in general), you need to edit keyguard_screentab_unlock.xml in the same folder - it's all there - the clock, date, sound toggle, horz. divider, charge (@id/status1) and alarm icons, unlock widget, music controls, etc... just play around with things..
To add the phone and text msg icons to the unlock widget, we need to edit the android.policy.jar and other xmls in framework-res.
More to come on that...
For Honeycomb style ripple lockscren mod, see here: http://forum.xda-developers.com/showpost.php?p=33854556&postcount=70
Change Clock Color in Status Bar (OUTDATED: FOR GB)
(This is a method I came up with myself)
-First, find a color that you want for your status bar clock.
-Now, find the hex code (combination of 6 letters and numbers) for that color --> see HERE, and/or HERE, and the Android Design guide for colors HERE. You may also use programs like GIMP and Photoshop to preview colors by hex code.
*For reference, 000000 is the absence of color (completely black), on the other end is ffffff (full on, all blinding color - completely white). Also, 33b5e5 is for ICS blue, 99cc00 is for android green (used below in the example).
-Decompile SystemUI.apk
-Open /res/layout/status_bar.xml (with a proper text editor like Notepad++)
-Look for the line that I highlighted in blue (from stock 2.3.6):
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.StatusBarView android:orientation="vertical" android:background="@drawable/statusbar_background" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout android:orientation="horizontal" android:id="@id/icons" android:layout_width="fill_parent" android:layout_height="fill_parent">
<TextView android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:textSize="16.0sp" android:textStyle="bold" android:gravity="left|center" android:id="@id/onsText" android:paddingLeft="6.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:maxLength="18" />
<com.android.systemui.statusbar.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:paddingLeft="6.0dip" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:layout_alignParentLeft="true" />
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true" />
[COLOR="Blue"]<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" android:gravity="left|center" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />[/COLOR]
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
-Add the code android:textColor="#ff33b5e5" to the line that starts with <com.android.systemui.statusbar.Clock as shown highlighted red below (NOTE: Insert your choice of hex code here - the 33b5e5 is just used as an example):
Code:
<com.android.systemui.statusbar.Clock android:textAppearance="@android:style/TextAppearance.StatusBar.Icon" [COLOR="Red"]android:textColor="#ff99cc00"[/COLOR] android:gravity="left|center" android:paddingRight="6.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
Again, insert your choice of color in the blanks> android:textColor="#ff------"
-Make sure your spaces are uniform and then save the xml.
-Compile the apk, and use your own method for copying signatures (I use APK Manager, it does it for you)
-Move to your phone by your own means... Enjoy! Please don't blame me if you mess something up!
Related:
There are a lot more mods with partial direction in individual posts throughout this thread.. read on, if interested. I will hopefully compose a location list or something for some of these other mods in the near future.. until then, good luck, and godspeed...
HOW-TO Remove Carrier Name from Status Bar
Bools.xml mods list
Very nice! A while ago I figured out a different way to do it, having to do with editing framework-res/res/values/styles.xml and changing a color code in there. But your way is a bit simpler .
Thanks for the guide! It would be awesome if this thread turned into something like this (see the 2nd and 3rd posts).
cogeary said:
Very nice! A while ago I figured out a different way to do it, having to do with editing framework-res/res/values/styles.xml and changing a color code in there. But your way is a bit simpler .
Click to expand...
Click to collapse
I've learned that there are definitely multiple ways to skin a cat, in terms of themeing android - I went the long way with inverting some apks in Romulus (I did not touch the AndroidManifest), and that forced me to learn how to read and understand this "extensible markup language" a bit better - and to correct my text color issues, I learned that you can just add the text colors if you find the right xml...
cogeary said:
Thanks for the guide! It would be awesome if this thread turned into something like this (see the 2nd and 3rd posts).
Click to expand...
Click to collapse
Oh boy, I should've reserved more posts for something like that! I would love to put something comprehensive together like Nottach did, but with ICS coming, I know a few things will change - so, I figure I'm better off waiting and learning that system first..
Not sure why but I couldnt find those exact lines you have in the exampme box. And whats with the crazy symbols? Sorry man...still a lil new as you know at messing with this type of stuff.
sorry the pics are so ****ty. Lo-light, laptops and cameras/phones dont mix well lol. Thanks in advance man.
Sent From MY DROID That DOES! Not YOUR APPLE That DIDN'T!
^
I think you just unzipped, did not decompile SystemUI.apk
DX2Trip said:
Not sure why but I couldnt find those exact lines you have in the exampme box. And whats with the crazy symbols? Sorry man...still a lil new as you know at messing with this type of stuff.
sorry the pics are so ****ty. Lo-light, laptops and cameras/phones dont mix well lol. Thanks in advance man.
Sent From MY DROID That DOES! Not YOUR APPLE That DIDN'T!
Click to expand...
Click to collapse
Did u decompile the apk ?? That's y u probably got the wired symbols
Sent from my MB865 using xda premium
You are going to need to decompile the apk to be able to read those xmls...
I use APK Manager 5.0.2 for Windows - see updated OP.
Then read up on some other threads about the process, also check the carrier name removal post I linked in OP#2... but yea, there is good literature on de/recompiling out there..
P.S. - for me, all of my codes in the op's are botched and have smiley faces on the xda app - I did use code tags..!? Reference them on a computer for easier reading...
Sent from my phone's mind
EDIT: edited.
I updated the heck out of this thread to give some guidance on using APK Manager for decompiling and compiling (at least they way I do it)... hope it helps a few people.
Man...seem to always run into an error. Any thoughts? Don't know why it shows up as status bar right before installing. It does say SystemUI.apk in the folder though...
Sent From My DROID That DOES Not My APPLE That DIDN'T.
Are you getting errors compiling the apk? How are you trying to install the apk on your phone? It looks like some sort of SystemUI is installed from your pic (since you still have a status bar showing)... But, the Status Bar process is the SystemUI.apk. So, I'm a little confused..
I need a bit more info on how you're doing things to try and help you better..
Are you getting errors compiling the apk? How are you trying to install the apk on your phone? It looks like some sort of SystemUI is installed from your pic (since you still have a status bar showing)... But, the Status Bar process is the SystemUI.apk. So, I'm a little confused..
I need a bit more info on how you're doing things to try and help you better..
Click to expand...
Click to collapse
My bad lol, should have explained better. No errors decompiling, editing, compiling or signing. Just trying to install right from the root folder I placed it on in my SD. Don't know if its because it wont install over the OG SystemUI.akp or what. Yeah the OG was still intact while I tried installing the edited one. In fact I tried just moving the edited one into my system apps n it kept forceclosing to the point where I had to reboot and when it started back up I had no status bar at all! lol no worries though, had a nandroid and have still been trying to figure it out...maybe signatures have somthing to do with it. Idk...
heres what it looks like on the SD card. But right when I press it, it turns into status bar...odd.
Sent From My DROID That DOES Not My APPLE That DIDN'T.
I followed the instructions to the letter worked great ur awesome. Got my status bar clock red yea buddy lol
Sent from my MB865 using xda premium
DX2Trip said:
My bad lol, should have explained better. No errors decompiling, editing, compiling or signing. Just trying to install right from the root folder I placed it on in my SD. Don't know if its because it wont install over the OG SystemUI.akp or what. Yeah the OG was still intact while I tried installing the edited one. In fact I tried just moving the edited one into my system apps n it kept forceclosing to the point where I had to reboot and when it started back up I had no status bar at all! lol no worries though, had a nandroid and have still been trying to figure it out...maybe signatures have somthing to do with it. Idk...
Sent From My DROID That DOES Not My APPLE That DIDN'T.
Click to expand...
Click to collapse
I used root explore to move my SystemUI.apk into system/app folder with permission set at rw-r-r override and replace old 1 reboot and should be fine
Sent from my MB865 using xda premium
DX2Trip said:
My bad lol, should have explained better. No errors decompiling, editing, compiling or signing. Just trying to install right from the root folder I placed it on in my SD. Don't know if its because it wont install over the OG SystemUI.akp or what. Yeah the OG was still intact while I tried installing the edited one. In fact I tried just moving the edited one into my system apps n it kept forceclosing to the point where I had to reboot and when it started back up I had no status bar at all! lol no worries though, had a nandroid and have still been trying to figure it out...maybe signatures have somthing to do with it. Idk...
Sent From My DROID That DOES Not My APPLE That DIDN'T.
Click to expand...
Click to collapse
Thank goodness for cwm on boot and fresh backups ..
Well, I can tell you right off the bat that your method of installation is giving you problems. Also, don't sign the SystemUI.apk, you want to retain the original signature.
It is possible to move it on your phone with root explorer, but I know some people are against this method.. but, here it goes anyway..
-First go and check the permissions of (and possibly make a copy of) the file that you want to replace. Go to the file location, mount R/W, and long-press the file and choose permissions - and remember them, or write it down. (Note: All apps and framework in /system are rw-r--r--)
- Next, copy the new file that you want to put on your phone from your sdcard.
- IMPORTANT: Paste it in another system folder besides the final destination and SET the proper PERMISSIONS and rename if necessary to match the file you are replacing (need to mount R/W first). For example, paste your edited SystemUI.apk in the /system folder (NOT directly in the app folder), and change the perms there..
- IMPORTANT: Long-press on the file you are moving and select "MOVE".
- Then paste it in the final destination folder (i.e. /system/app), and select ok to overwrite the existing.
- Don't try to do anything else except reboot. And, it would be nice to wipe dalvik and cache partition while you are rebooting, if you have the chance.
Please, if anyone tries this method, be cautious, use CWM on Boot, and have a fresh backup just in case.. also, I assume no responsibility for your actions.. I have done this multiple times with many different file types and locations..
Sent from my phone's mind
chrisn91 said:
I followed the instructions to the letter worked great ur awesome. Got my status bar clock red yea buddy lol
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
Very cool! Glad to hear it worked for you! You got a screenshot of the red?
Sent from my phone's mind
Yea..
Im reading on how to center my lockscreen clock and changing the color red as well
Sent from my MB865 using xda premium
chrisn91 said:
Yea..
Im reading on how to center my lockscreen clock and changing the color red as well
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
Nice. You make all the edits yourself or is that a custom rom? Either way, lookin good, man.. keep it up!
And, I was also just about to dig into a few things, lockscreen clock color happens to be one of them.. but, I got the old moto lockscreen (which has a centered clock), so I'm thinking those xmls might be in a different place than the new moto lockscreen stuff... we'll see..
Sent from my phone's mind
alteredlikeness said:
Nice. You make all the edits yourself or is that a custom rom? Either way, lookin good, man.. keep it up!
And, I was also just about to dig into a few things, lockscreen clock color happens to be one of them.. but, I got the old moto lockscreen (which has a centered clock), so I'm thinking those xmls might be in a different place than the new moto lockscreen stuff... we'll see..
Sent from my phone's mind
Click to expand...
Click to collapse
Its a little of both. I.did some theming to sv6 with some pngs from other roms although I've learned alot here creating a img from scratch is a hard thing for me to grasp lol. I've tried many times to change the status bar clock but it won't work I would get systemui force closures or no change at all but thanks to ur steps and how to guide I got it
Sent from my MB865 using xda premium
Well I couldn't figure it out for the old native AOSP jog tab lockscreen, but I managed to change the clock and date color on the new Moto sliding door lockscreen... also changed the font style of the clock to DroidSans (which is actually Ubuntu font on Romulus, the default system font - it was Chulho_Neue)..
But, as you can see, I didn't get the "charging" text color. Also didn't look at moving the position yet..
Oh, yea... it's in framework-res.apk/layout/zz_moto_sd_keyguard_screen_tab_unlock.xml - look for the lines with the ids "timeDisplay", "am_pm", and "date"...
But the zz_moto_keyguard_screen_unlock_portrait.xml threw me off, and may have something more to do with this...
I'll try to look into this and post something better 2moro..
Sent from my phone's mind
EDIT: I think I just found it for the native jog tab lock... in a very obvious place: keyguard_screen_tab_unlock.xml (without the zz_moto_sd part, obviously) - this may help to center the zz_moto_sildingdoor lockscreen text as well... get some ideas or lines of code from it, and copy it over to the zz_moto keyguard xml..

<<<GUIDE>>>theming 9.png's

Okay, is a pretty simple process to be honest, but time consuming, if you find a short-cut as you learn, please share. So, do you have:
adb installed,
winrar or similar application,
apktool installed,
and a photo editing program installed?
if your answer to all of these is yes, than follow these steps.
1.get your framework.apk
2.your com.resources.apk
put them in your apktool/framework folder, should be in your USER name folder, look for it,
Once there paste the .apk's in that folder, rename your framework.apk to 1,
and rename your com.resources.apk to 2
next create a folder in your desktop and name it MODS (this is what i use so this is what we will call it ) place all the .apk's which you are going to theme in there.
for this tutorial we are going to call it the rosie.apk
first thing is de-compiling the .apk, this will reveal the 9.png's to you
ok, open up command prompt and type:
cd desktop\MODS
press enter, next type:
apktool d rosie .apk
after this you should have a new folder in your MODS folder called rosie,
once in that folder go to the location of the 9.png's you are trying to theme,
open them in your photo editing program and you should now see some black lines along the edges of the 9.png images don't touch them (you can but i don't really have the knowledge to do it myself, so don't touch them )
if your photo editor has a selection tool go ahead and select everything but the first pixel where the black lines are located,
now erase whats inside your selection and theme away as long as you don't touch that first pixel, so to be safe use the selection tool!
after you are done theming it, save the image to replace the old one,
okay, remember that time consuming part..... well you must do this to each individual image as far as i know anyhow , so ONCE again if you find/know shortcuts please share and pass the knowledge along......
after you are done with the .apk, type this in command prompt:
apktool b rosie rosie-new.apk
this will compile your newly themed apk, along with your new 9.png's
REMEMBER, I'M USING rosie.apk AS AN EXAMPLE, SO INSTEAD OF rosie IT SHOUD BE THE NAME OF THE .apk YOU ARE BUILDING AT THAT TIME
that's it!
add the .apk to your theme, just remember to remove the -new part from the name, flash and enjoy
This Tutorial was made possible mainly 2 individuals:
tommytomatoe
mpitcher225
this guys where and are TREMENDOUS help to me!
Hope this helps!

Editing the framework.apk (Solved)

So I was wondering, is there anyway for me to edit the base and accent colours of the framework.apk in the system files so I can make my phone look different from others. I know this can be done using Cyanogenmod's theme engine but I'd prefer to stay on a stock version of android which is more stable and up to date.
I have android 7.1.1 beta with root and an unlocked bootloader, I have tried taking the framework.apk from other device to put on my own but it always causes a stuff up in the data partition (which is kind of expected) meaning that I need to factory reset my phone to get it working again.
Thank you in advance.
Images of some extreme examples are available below
Substratum legacy works on stock roms, but ypu need root from ive read! Ive never tried! Always make backup first
Jackio987 said:
So I was wondering, is there anyway for me to edit the base and accent colours of the framework.apk in the system files so I can make my phone look different from others. I know this can be done using Cyanogenmod's theme engine but I'd prefer to stay on a stock version of android which is more stable and up to date.
I have android 7.1.1 beta with root and an unlocked bootloader, I have tried taking the framework.apk from other device to put on my own but it always causes a stuff up in the data partition (which is kind of expected) meaning that I need to factory reset my phone to get it working again.
Thank you in advance.
Images of some extreme examples are available below
Click to expand...
Click to collapse
Yes it is possible. Decompile your framework-res.apk and change the accent colors in your res/values/colors . XML and your Systemui.apk and your Settings Google.apk for the switchbar background.
{
"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"
}
Tulsadiver said:
Yes it is possible. Decompile your framework-res.apk and change the accent colors in your res/values/colors . XML and your Systemui.apk and your Settings Google.apk for the switchbar background.
View attachment 3925511 View attachment 3925512 View attachment 3925513
Click to expand...
Click to collapse
So I have taken a look at the framework-res.apk/res/values/color folder and extracted a few of the .xml files to take a look at them. I opened the files using notepad++ but nothing comes up correctly and I can't find any number values to represent the colors. So I was wondering if there were any special programs that I have to open the .xml files in and if there is can you also point me to the .xml file that edits the colors of the quick settings.
I have also taken a look at Substratum and it says that android 7.1.1 is unstable for use with the application.
Jackio987 said:
So I have taken a look at the framework-res.apk/res/values/color folder and extracted a few of the .xml files to take a look at them. I opened the files using notepad++ but nothing comes up correctly and I can't find any number values to represent the colors. So I was wondering if there were any special programs that I have to open the .xml files in and if there is can you also point me to the .xml file that edits the colors of the quick settings.
I have also taken a look at Substratum and it says that android 7.1.1 is unstable for use with the application.
Click to expand...
Click to collapse
What are you using to decompile the apk? If you haven't already, try using apktool. Install apktool and then in a terminal use:
Code:
apktool decode framework-res.apk
That should spit out proper xml files.
screenshot:
[IMG]http://i.imgur.com/ap6auRM.png[/IMG]
Jackio987 said:
So I have taken a look at the framework-res.apk/res/values/color folder and extracted a few of the .xml files to take a look at them. I opened the files using notepad++ but nothing comes up correctly and I can't find any number values to represent the colors. So I was wondering if there were any special programs that I have to open the .xml files in and if there is can you also point me to the .xml file that edits the colors of the quick settings.
I have also taken a look at Substratum and it says that android 7.1.1 is unstable for use with the application.
Click to expand...
Click to collapse
Yes, you are looking at files that have not been decompiled Apktool is a great tool. Take a look at "tickle my android" if you want the best and easiest one around.
And, for the QS background, you will need to decompile Systemui.apk I believe it is in the layout folder, a XML file called qs_background_primary. XML change the solid color from ?android color primary to the hex code color of your choice
http://forum.xda-developers.com/showthread.php?t=1633333
synesthete said:
What are you using to decompile the apk? If you haven't already, try using apktool. Install apktool and then in a terminal use:
Code:
apktool decode framework-res.apk
That should spit out proper xml files.
screenshot:
[IMG]http://i.imgur.com/ap6auRM.png[/IMG]
Click to expand...
Click to collapse
Thank you for your help. Now I just want to make sure because this is my first time actually playing around with system apk's, Do I need to do anything special to package the apk back together and onto my device other than applying the right permissions?
Also the reason why the xml's weren't working at first was because I just used winrar to extract the files because that worked on iOS's IPA's when I used to work with them and my current guess would be that if I was to put the apk back onto my phone I would need to do more than package it as a .zip and rename it as an .apk.
I would test this on my Moto G first but it's super stuffed up at the moment.
Jackio987 said:
Thank you for your help. Now I just want to make sure because this is my first time actually playing around with system apk's, Do I need to do anything special to package the apk back together and onto my device other than applying the right permissions?
Also the reason why the xml's weren't working at first was because I just used winrar to extract the files because that worked on iOS's IPA's when I used to work with them and my current guess would be that if I was to put the apk back onto my phone I would need to do more than package it as a .zip and rename it as an .apk.
I would test this on my Moto G first but it's super stuffed up at the moment.
Click to expand...
Click to collapse
To recompile,
Code:
apktool b systemui
(or framework-res) You will want to replace the meta-inf and android manifest of your newly recompiled apk with the original ones.
First, before you do any decompiling you must install your framework
Code:
apktool if framework-res.apk
Tulsadiver said:
To recompile, Apktool b systemui (or framework-res) You will want to replace the meta-inf and android manifest of your newly recompiled apk with the original ones.
Click to expand...
Click to collapse
Thank you I'll try it now
Ok it worked. Thank you so much for your help. With this new found knowledge I probably won't do much but it's just something useful to know just in case I have a sudden urge to make my operating system's main colours yellow and brown. Also editing just the colour values in the framework edited the colours in the quick settings and the settings application because they all refer to the framework for that colour.
Things I have learned:
How to decompile apk's properly
How to edit system ui/ framework/ settings colours
How to recompile an apk
How to make sure that the apk works when your device boots up.
Thank you everyone I couldn't of done it with out you.
EDIT: Oops. Just saw that someone else replied (and with better info). You can disregard this post. I'm glad you got your answers.
Jackio987 said:
Thank you for your help. Now I just want to make sure because this is my first time actually playing around with system apk's, Do I need to do anything special to package the apk back together and onto my device other than applying the right permissions?
Also the reason why the xml's weren't working at first was because I just used winrar to extract the files because that worked on iOS's IPA's when I used to work with them and my current guess would be that if I was to put the apk back onto my phone I would need to do more than package it as a .zip and rename it as an .apk.
I would test this on my Moto G first but it's super stuffed up at the moment.
Click to expand...
Click to collapse
The apktool decode command will spit out a folder tree. After making your edits, you should be able to use the apktool build command to recompile to an apk file again. If you don't specify a specific output path, it will probably dump it in a "dist" subfolder within the decompiled apk folder. If you just type "apktool" in the terminal, it should give you more detailed instructions for its options. Once you have an apk, you might need to sign it. You should be able to do that easily on your android device with the app zipsigner: https://play.google.com/store/apps/details?id=kellinwood.zipsigner2
Once you have the signed apk you should be able to replace the original with the same permissions and group policy settings and reboot. I would recommend making a nandroid backup to revert to in case you get stuck in a bootloop. It has been a long time since I have done this, so I might have missed something. Maybe I will give it a try when I have some time later.
how to add pixel icons in system apk
hilla_killa said:
Substratum legacy works on stock roms, but ypu need root from ive read! Ive never tried! Always make backup first
Click to expand...
Click to collapse
Unfortunately Substratum isn't really working too well on the 7.1 DP and it will notifiy you when using the app that modifying anything may very well cause bootloop, which in my case was very true. Tried to install the Pixel Theme that worked flawlessly on 7.0, then bootlooped after the required reboot. However, you can still try it and revert back fairly easily. The dev created 2 .zips in the Substratum folder to fix the bootloop if it does happen (the legacy zip is what fixed mine).
A$h!$h said:
how to add pixel icons in system apk
Click to expand...
Click to collapse
Which icons are you referring to? Navbar or apps?
Jackio987 said:
So I was wondering, is there anyway for me to edit the base and accent colours of the framework.apk in the system files so I can make my phone look different from others. I know this can be done using Cyanogenmod's theme engine but I'd prefer to stay on a stock version of android which is more stable and up to date.
I have android 7.1.1 beta with root and an unlocked bootloader, I have tried taking the framework.apk from other device to put on my own but it always causes a stuff up in the data partition (which is kind of expected) meaning that I need to factory reset my phone to get it working again.
Thank you in advance.
Images of some extreme examples are available below
Click to expand...
Click to collapse
Hey Jackio987,
Yeah! that's true
Refer to my post for better customizations! That's here

Categories

Resources