1. You will need an APK (One you know a lot of, to learn with this tutorial)
- We will call the APK "tetris.apk" to make the tutorial easier to understand.
2. Download Advanced APKTool
- Make a copy of the tetris.apk, and paste in APK manager folder "place here for modding"
- If the Name of the Apk is like this "brave frontier global.apk" rename it to "bravefrontierglobal.apk" (no Space between the letters otherwise the Tool wont find the Apk)
3. Open Advanced Apktool
- Now hit the following keys:
2 (To Decompile the APK) & Enter
The Number of the Apk you want to decompile Enter & Y (for Yes) Enter
1. Get Dex2Jar
- dex2jar - Tools to work with android .dex and java .class files - Google Project Hosting
- extract it.
2. Get tetris.apk , and make it a .zip
- Extract tetris.zip
- After Extracting Tetris.zip, copy the file "classes.dex" to the extracted folder of "dex2jar"
3. Drag classes.dex to the file named "dex2jar"
- A new file will have been created in that same folder.
1. Download JDgui (java decompiler) for Windows
( 1.1 Yet another fast Java decompiler ) <- only for the one, who want to know, what Java Decompiler and so on can do.
For other operating Systems
- extract it
2. the new file that was just created in STEP B , 3)
- get that file and drag it to the jdgui.exe
3. It will open.
- Now you can see everything about the game / the source (But we can't do anything to it or recompile it, there is no way)
1. With the file open in jdgui.exe , browse through the files
2. Whenever you find something useful that you want to change while in the jdgui.exe application, browse in the extracted tetris.apk file in STEP A
- in the Smali folder
3. Say you find in JDgui.exe , a file named "cash1234" and it says somewhere inside "cash = 500."
go to the same file location on the Smali folder... and look file "cash1234".. and for the hex equivalent to 500 , (which would be 1F4)
on gdui.exe things are much simpler than on .smali files, but you can still change them with careful looking.
4. In gdui.exe, files you have open, have easy to understand numbers, on .smali files the number are not.
- The numbers in .smali files are in HEX.
To know which number in .smali is what number, use this tool:
Hex to decimal: Click here.
Decimal to hex: Click here.
you can use "Calc-p" from the market.
1. After you have modified whatever you wanted in the .smali file, save the .smali file (do not change the name or extension)
2. open Advanced Apktool again and hit the following keys
3 to recompile
The Number for the apk you modified
2 for Recompile & Sign Enter & Yes Enter (sign is important, otherwise you may not be able to install the Apk on your Phone)
(Before installing an edited .apk, remember to uninstal the non-edited Apk that is in your phone).
( You do not need to uninstall apk(s) from your phone that you have signed with APK Manager).
- Play have fun.
- if Step E gave you an error, you edited something wrong, or couldnt be edited.
* IF a number on the .smali file has 2 digits, F8, and you change it to a number of more than 2 digits, 4B86, a lot of times the .apk file will not compile again.
* Every time you make 1 edit, save, and send the edited game to your phone to see if it compiles, and if it does not crash.
* mul = multiply
* sub = substract
* add = addition
* a number with a negative "-0x1" that is equal to -1 , "-0x7" that is equal to -7 , "-0x1f4" that is equal to -500
* Hex numbers do not have to be IN CAPS, can be either.