- How to mod APKs and Create your own Modded APK Hacks for Games and other Apps
- Step 1:
- Step 2:
- Step 3:
- Step 4:
- Tutorial BASICS ABOUT ANDROID APK MODDING IN GENERAL | LEARN MODDING TODAY FOR FREE!
- G-Bo ッ
- Модификация Android приложения от новичка и для новичков
- Для начало немного истории.
- Набор инструментов
- Приступим
- Изучаем код
- PROFIT?
How to mod APKs and Create your own Modded APK Hacks for Games and other Apps
Alright. Due to popular demand, there is my tutorial on how to create your own modded APKs, game mods and game hacks using APK decompiling, editing/modifying and recompilation. – Be warned, if you want to make mods that are more than just visual, you will have to have engineer level knowledge of java and ideally other programming languages.
Requirements:
- Any old APK Decompile/Compile Tool
- Windows PC / Mac
- Ideally, you know Java on an Engineer level
What you are going to want to do is to get the APK of the game or app you want to mod, decompile it (unpack it into all the contained resources and scripts), then modify the scripts and resources and recompile the app. After that you go to testing and using of the hacked app.
- Get the APK you want to mod
Getting the APK file can be done by simply downloading it off the internet or using a file manager to copy it from your apps directory on your Android device and putting it on the SD card to extract it. Should not be any kind of problem at all.
- Decompile the APK
Decompiling and extracting of the java compiled scripts can be done using different tools and the ideal way of doing it changes every few months, but here is an in-depth guide on how to do it that I found of Stackoerverlfow and really, I could not put it into better words myself.
Step 1:
- Make a new folder and copy over the .apk file that you want to decode.
- Now rename the extension of this .apk file to .zip (e.g. rename from filename.apk to filename.zip) and save it. Now you can access the classes.dex files, etc. At this stage you are able to see drawables but not xml and java files, so continue.
Step 2:
- Now extract this .zip file in the same folder (or NEW FOLDER).
- Download dex2jarand extract it to the same folder (or NEW FOLDER).
- Move the classes.dex file into the dex2jar folder.
- Now open command prompt and change directory to that folder (or NEW FOLDER). Then writed2j-dex2jar classes.dex(for mac terminal or ubuntu write./d2j-dex2jar.sh classes.dex) and press enter. You now have the classes.dex.dex2jar file in the same folder.
- Download java decompiler, double click on jd-gui, click on open file, and open classes.dex.dex2jar file from that folder: now you get class files.
- Save all of these class files (In jd-gui, click File -> Save All Sources) by src name. At this stage you get the java source but the .xml files are still unreadable, so continue.
Step 3:
Now open another new folder
- Put in the .apk file which you want to decode
- Download the latest version of apktool ANDapktool install window (both can be downloaded from the same link) and place them in the same folder
- Open a command window
- Now run command likeapktool if framework-res.apkand next
- apktool d myApp.apk(where myApp.apk denotes the filename that you want to decode)
now you get a file folder in that folder and can easily read the apk’s xml files.
Step 4:
It’s not any step just copy contents of both folder(in this case both new folder)to the single one
If you are simply looking to modify very basic resources, templates, names ect, then you will not have to do any more than simply decompiling the APK file using any decompiler or .zip unpacking tool available on the internet.
- Modify the Resources (Visual Hacks/Mods)
This is what most of the people reading this will be able to do and it entails navigating in your decompiled APK folder and editing some simple image and xml files:
First off, in the root folder of your decompiled app you can find the ‘manifest’ fie that defines the app name, permissions requested and other foundational definitions.
The ‘res’ or ‘resources’ folder, where you will find the very basic visual building blocks that the game / app is made of. The ‘minimap’ folders is where you can change start icons of the app, the drawable folder will include back grounds, you may also find other images, such as sprites, loading screens, game characters ect here in the case of games.
Images can be modded by simply opening them in any image editor or photoshop to edit them.
XML files are templates that structure screens, menus, that include formatting and sometimes text that can be modded as well.
- Modify the Java Code
So far in 2018 it is not possible to get the exact source code out of an APK as far as I am aware. You will always get an inlined, compiled version that is different from the original source code no matter what tools you use.
While you need to be able to modify scripts if you want to create game hacks or game mods that actually do something, you will have to at the very least know Java in order to have any shot at success of implementing cheats into an Android Game APK.
For most of us, this is where the APK Modding journey ends. Java is extremely complex and reverse-engineering and reassembling Java code from a decompiled APK is beyond what 99% of the people that will read this article will ever be able to do. If you are one of the few that has enough experience and knows Java well enough and has the time and energy to do it, then go nuts.
Depending on the game/app, modifying the Java code can give you anything from unlimited possibilities, in terms of games we are talking god modes, unlimited gems, unlimited money ect. Is the app/game online based however, even modifying the code will not be able to give you too powerful cheats. However, we are still hoping for the emergence of Aimbots and Wallhacks on Android, which is certainly a possibility.
- Recompile, Test and Enjoy
Good, you just modified your APK. It is now time to use your favorite APK decompiler/decompiler tool to recompile the APK, fire up any emulator and test the thing to see if the modifications you made sticked or if you have to go back in and work some more.
Tips for Beginners looking to create Modded APKs for Android Games
How can you modify something that you have never built? That is really what you have to ask yourself if you are looking to learn APK modding. — The best way to get started into modding Android games it to create Android games.
You will learn Java, how to create Games in Android Studio and using other tools to create game resources and make them work together. And frankly, if you don’t know how a game works, you will never be able to mod it successfully.
Also learn how to reassemble source code from APKs. Pretend to lose your source and then try to reassemble it, that will teach you a lot about reverse-engineering compiled Java and you having programmed the code will make it easier for you to reassemble it, since you understand all the functions and code involved.
Источник
Tutorial BASICS ABOUT ANDROID APK MODDING IN GENERAL | LEARN MODDING TODAY FOR FREE!
G-Bo ッ
Administrator
I think you read this cause you would like to start learning modding. Well, we have all tutorials you need here but I can imagine that all this tutorials confusing you and you don’t know how to start. Well, let me help you a bit sorting out the things.
Let’s start with the very basics.
1. What is an APK?
An .apk file is the android installing file which you can compare to .exe file on Windows. You need this file to install an App/Game on your Android device.
2. How I can open an APK file on my computer?
First you need to get the APK of the game of your choice. The best place to download APKs to your computer without any tools is apkcombo.com
Once downloaded you can see simply whats inside the APK by open it with Winrar/Winzip/7zip. Just rename the file ending from .apk to .zip.
Later when you are more then basic modder, you will need sometimes to decompile the APK to get the smali files. You will know what I mean at time. You can use the tool for that I will post under the «what means signed» part. Decompiling means its taking the APK completely in pieces since some files like the classes.dex file are nothing else then another zipped bunch of many files.
3. What means signed and unsigned?
Well, to get the game as developer on the Google Playstore the game will get a unique signature. Its important to be an officially APP on the playstore. The signature is like a security jacket. If you want to mod the APK, you need to open the jacket and you can never close it again, only google can. So you need to take a new jacket and put it over it. We modder use the google testkey which can be used freely. Its made normally to test the APPs before you publish them but its working perfectly to run the mods too.
In the case we use a new signature after we mod the file, the APK will be «signed» and can run on non-rooted devices. But you need to remove the original game and cannot install it over it, cause the original game have the original signature while your mod don’t. The only problem on this is, google playstore don’t accept the test key. That means you will not be able to login to Google+ with that modded APK.
«Unsigned» means, that you left the opened jacket open. You changed the APK and modified it, but you left the opened original Key inside, you do not sign it with the test key. Android devices cannot handle that by default. But if you root your device and enable and LuckyPatcher patch you will be able to tell the device «the jacket is closed, install it». In this way you are able to update the original playstore game with a mod and will be able to login with the Google+ account. You simply lying to your device.
3. I want to learn modding, but I don’t understand what to do. What means DLL and .so or .NET and IDA?
Here we come to the main reason you came here.
Well, there are mainly but not in total 3 types of file systems the Developers use to publish the games.
DLL running game
If the game is running DLLs you will need to mod this DLLs. For this case you need programs like .NET Reflector.
If you wanna know how to identify this games, please open the APK as written above and brows to \assets\bin\Data\Managed folder. If you find DLLs inside, this game is running DLLs! It will look like this:
.so file running game (IDA)
If the game don’t have DLLs, its mainly running .so files. One is IDA and one is il2cpp. Let’s talk first about IDA. To identify those games, you need to brows to the /lib/armeabi-v7a/ folder in the APK. If there is no libil2cpp.so inside but another much bigger .so file then the other .so files, you will need IDA to mod this game. It will look like this:
.so file running game (il2cpp)
Well, lets come to the last important filesystem, il2cpp. Its mainly a game which is designed like a DLL running game but its converted to .so file system to make it harder to mod it. You will need to dump the il2cpp offsets and mod it with HxD editor. To identify you just need to do same steps like on IDA, but you will find an libil2cpp.so file inside the folder. I will look like this:
4. I found out the game is DLL running but when I try to open the DLLs with .NET reflector I got errors. What happened?
The DLL file will be protected against modding. This is wide more then basic. We have the tutorials to encrypt here, but you should start with unprotected games until you know all basics perfectly before you try to bypass protections.
5. Some extra advice
Some of you starting modding to mod games they cannot find on places like this. This is NOT the way to start. You have a 90% chance its not modded cause its simply crazy hard to do! It will destroy your motivation totally. Do exactly the opposite. Start with games which are modded already and not VIP (those are too hard too), then you know its possible and you know which features are possible. Don’t give up cause you cannot make the same mod, small goals will motivate you until you good enough for the big guns =)
Check this for a list of useful tutorials: LIST OF PLATINMODS MODDING TUTORIALS
Credits:
1. G-Bo (Me) — www.platinmods.com — Gamehacks & more!
2. All who posted tools / tutorials listed
Note: Tutorial is free to share but please set the correct credits. Time we spend to teach people should be respected.
Источник
Модификация Android приложения от новичка и для новичков
Для начало немного истории.
Как только я получил свой первый китайфон, решил попробовать разные прошивки и в результате остановился на Lewa. Но глаза постоянно мозолил один ее недочет — список контактов, а точнее быстрая навигация на английском.
Информации о данной проблеме немного, поэтому начал копать сам.
Набор инструментов
Первое что нам надо — научиться распаковывать программы. Для этого нам понадобится:
- установить Java
- APKTOOLS для распаковки *.apk
- Прочитать данный пост
- Получить объект исследования. Если вы пользуетесь Lewa то надо из архива с прошивкой или прямо с телефона нужно вытянуть /system/app/PIM.apk и все apk из папки /system/framework/ обычно это framework-res.apk, lewa-res.apk и
mediatek-res.apk. Если вы хотите просто потренироваться то могу дать свои
Приступим
Итак, первое что нам надо это разобрать наше приложение, для этого все apk надо скопировать в папку с apktools. Все apk которые лежали в /system/framework/ надо выделить, подцепить мышью и перенести на apktool-if.cmd тем самым открыв их с помощью этого bat’ника. PIM.apk таким же образом надо открыть с помощью apktool-d.cmd. В результате получаем папку с распакованным приложением.
Изучаем код
Первое что нам необходимо понять — что и где править. Так как мой список контактов изобилует русскими именами, а в быстротой навигации одни английские буквы резонно предположить, что буквы просто жестко забиты где то в коде, а не генерируются динамически исходя из того какие имена у вас в контактах. Обычно такие данные хранятся в папке res, а точнее в res\values\arrays.xml но в нашем случае там ничего похожего нет.
Думаем дальше — раз нет там, значит есть где то в коде. Весь код находится в папе smali, по сути там не исходный код а так называемый Байт-код, и его там много. Так где же искать? Я поступил так, в папке res\layout\ хранятся все «окошки» нашего приложения, то что нам надо находится где-то в списке контактов, поэтому я наобум открыл contact_list_content.xml и начал изучать.
Там меня заинтересовала строчка
. Что это за индексер такой?? Смотрим
Тут и так все понятно, меняем буквы на русские, и так как русских букв больше придется добавить несколько строк типа
const/16 v1, 0x1b это порядковый номер буквы он тоже будет с каждой новой буквой расти. Так же в начале вы могли заметить стоку
Это размер всего массива, так как мы добавили несколько букв ее нам тоже надо поменять. Я добавил 3 буквы по этому в моем случае ее надо поменять на
В итоге у меня получился следующий код:
«\u042f» — это «юникоды» наших букв, так надежней)
После этого можно попробовать собрать риложение перетянув папку PIM на apktool-b.cmd, через некоторое время появится PIM\dist\PIM.apk
Теперь можно заменить им PIM.apk своего телефона, как это сделать выходит за рамки данной статьи. Могу лишь скзать что можно прошится моим патчем, предварительно заменив в нем PIM.apk на свой.
PROFIT?
Не совсем… Да, буквы русские но поиск то не работает!
Изучаем дальше декомпилированный AlphabetFastIndexer.smali
тут больше ничего интересного кроме
Хотя по идее он к нашей проблеме не относится я все же решил посмотреть что это такое. public static abstract говорит о том, что этот интерфейс реализован где то в другом файле. Ищем поиском и находим пару файлов где встречается OnTouchingLetterChangedListener:
PIM\smali\com\lewa\PIM\contacts\list\ContactEntryListFragment.smali
PIM\smali\com\lewa\PIM\mms\choiceContacts\MmsChoicePhoneNumbersContacts.smali
Они достаточно длинные поэтому приведу только то что нас интересует
Как и откуда вызывается это функция я не понял но факт — она собирает первые буквы контактов и все что не относится к английским буквам приравневает к # И поэтому у нас ничего не работает… конкретно эта функция находится в «подфайле» PIM\smali\com\lewa\PIM\contacts\list\ContactEntryListFragment$3.smali
Там нужно найти участок
0x41 и 0x5a это буквы ‘A’ и ‘Z’ их надо поменять на русские:
После чего найти
0x61 — ‘a’
0x7a — ‘z’
Меняем
В файле MmsChoicePhoneNumbersContacts.smali примерно такая же история
Собираем это дело обратно и запихиваем а телефон. Вот теперь работает!
Спасибо всем за внимание!
Источник