[T-Mobile Samsung Galaxy S 4] The Sickness:
APK MODDING THE EASY WAY

Another Deviant Development Production
​

I have had several request on how to edit apks. So I figured I would write a guide for everyone to use, and for me to give

back to the XDA community. Please keep in mind that this is the tool that I use personally, and I will also do my best to

explain this guide in detail so you will have confidence in your adventure of modding apks.

In order to edit your apks there are a couple of more tools that we will need to get. Below you will find the download

links for the tools.

Set up requirements

Downloads

ApkManager

This is a zip file. Make sure that you extract it to the root of your

PC (C:drive)......

NotePad++

This will be use to edit xmls

7Zip

This will be used to extract certain files needed to compile successfully

Now, after you have downloaded the above tools please follow these steps or you will have

errors when you decompile/compile a apk.....

DECOMPILING

1. Open Apkmanger and look at the folders to get familiar with them. The first folder we will

deal with will be the "other" folder.

In the "other" folder you need to place these 3 apks...

Framework-res.apk

SystemUI.apk

Twframework-res.apk

Once you have placed these apks in the "other" folder you need to highlight (left click) it, then press shift/right click.

It will bring up a window....select "open command window here". Once that is done another screen will pop up which

is cmd....

In cmd type these commands....

apktool if framework-res.apk (hit enter on your keyboard) framework is now loaded

apktool if systemui.apk (hit enter on your keyboard) systemui is now loaded

apktool if twframework-res.apk (hit enter on your keyboard) twframework is loaded

2. Now open the "other" folder in a new window. Once its open you need to drag and drop the 3 apks (SystemUI,Framework,

Twframework)into the folder called "place-apk-here-for-modding". Close the "other" folder.

3. Now you will see "Script".....double click to open it up. Once its open, type 22. It will bring up the 3 apks that we loaded

thru cmd.....now choose the apk you wish to mod.

I will use framework-res.apk for a example. After you have chosen your apk the Script will go to its menu. Type 9 to decompile your apk. It will take it a few minutes. Once its done decompiling the files will be located in the "projects" folder.

Open the "projects" folder and you will find your decompiled apk.

Now lets say you wanted to edit a xml in framework.....navigate to res/values. Open it up.....there will be a list of the xml's.

Right click the xml to bring up a window, select "edit with NotePad++. Now you can edit the xml. (This is just examples

on the res folder).

RECOMPILING

4. Recompiling is where people have problems. Either from compiling errors or bootloops. I will show you how to compile

with no errors and no bootloops. I will start with framework-res.apk (as example)

Once you have done all of your edits in framework you will nedd to compile it. Open "Script" again, type 22, type 1, it will bring you to the main menu, type 11 for compile....it will take a few minutes.

At the bottom of the menu you you will be asked if this is a system app....type Y when it asks. It will then ask if you want to copy over additional files to reduce errors....type Y when it asks. It will then extract a bunch of files.

Once its done you will now see a "keep" folder. This folder is the original UNMODDED apk you have edited. Now in the "keep" folder you need to DELETE anything you modded. ie (you modded the clock,res/layout/statusbar.xml). You will go to res/layout/statusbar.xml and DELETE the xml.

Now since you edited a xml you will also have to delete resources.arsc file. This is where xml's are stored. Once you have

deleted your edits press ok in the "Script". Once its done compileing your new apk will be found in "place-apk-here-for-modding". It will say "unsignedframework-res.apk.

7ZIP

But we are not done yet. You will now need to open the ORIGINAL framework-res.apk with 7Zip. Once its open, extract the META-INF and the AndroidManifest. Now you need to open the unsignedframework-res.apk with 7Zip. Once open DELETE META-INF and AndroidManifest. Take the META-INF and AndroidManifest from the original apk and place them into the new one. Once thats done close 7Zip. Rename the apk to framework-res.apk. Your done.

Please note that you can mod any apk with this tool. You just load them in as above.

Smali/Dex Files

Part 2

Set Up Requirements:

Downloads

Smali

This tool will be used to extact classout files for editing

First thing is to download the above Smali. Its a rar file, so there is no need to extract to your C: drive.

Open it up and get familiar with some of the folders.

One of the easiest ways to get your dex file is with 7Zip. Which you should of downloaded from Part 1. Please

keep in mind this is dex files from a apk, not a jar. The smali tool works different for jars.

Extracting Dex Files

I will use SystemUI.apk as a example. Take your SystemUI.apk and open it with 7Zip. You will see your classes.dex file.

Drag and drop the classes.dex to the smali folder, just drop it on the bottom right under

testkey.x509.pem.

Now you need to double click on "Quick-Baksmali". A CMD window will pop up. When it is done you

will see a new folder called "classout". This folder contains the smali files. Navigate to the desired smali

you want to edit. Just use NotePad++ for your edits.

Compiling Classout back to classout.dex

Once you have completed your edits you will now need to "compile" the modded classout file back into

classout.dex. Double click on "Quick-Smali".....a CMD window will pop up. When its done running the

script you will see "new-classes.dex".....that is your new modded dex files.

Now open up your SysytemUI.apk with 7Zip......RENAME new-classes.dex to classes.dex....Now DELETE

the classes.dex in 7Zip. Drag and drop your new classes.dex into 7Zip. And now your SystemUI.apk

has freshly modded smali......

If you have any problems or questions please post them and I will help you out. But I will not do

the modding for you. Thats what this guide is for.