- Gender
- Male
- Device
- Galaxy S9
- Country
- Chile
Hi Guys
First, I must make it clear that this is not an advanced tutorial for modifying an application. This post is the result of a knowledge I gained yesterday that I would like to share with you. However, I still have many doubts, and always try to post them here in the forum, as in:
Mod a Game x Mod a App: Is the same process?
How to modify an application and make it Premium?
Although I don't get an answer most of the time, I'm not upset and I will never be upset about it.
I also have to make it clear that this method does not work for all applications as it is a basic mod method. Now let's get down to business.
Requirements:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1°) After downloading and installing all the necessary files, copy the apk file you want to mod to C:\apktool. Rename the app to something shorter for convenience. Ex: ISS Detector v1.2.3 apksite to = issdetector.
2°) Open a CMD window in the same folder where apktool and the app you want to mod are, and then use the following command:
In this case we have:
3° Use the Windows Explorer search engine (or use a form that suits you best) and search for "Inventory". We are looking for Inventory.smali.
4° Once you find the file, open it with Notepad ++ that you previously downloaded. Just right-click on the file, and then click "Edit With Notepad ++".
5° Now that we have the file, we can look at a few things:
mPurchaseMap<String:
This field is referring to in-app purchases that can be made by the user. We are in luck.
If you found mPurchaseMap<String, chances are you will also find:
hasPurchase(Ljava/lang/String) Z.
This field is responsible for verifying if the user made the purchase, in the case of ISSDetector, we have:
Now, we'll see what happens if this purchase check always gives true. Delete everything between "locals1" and "return p1" and replace it with the:
Now, see what we have:
Remember to press the space key to keep a space between the keys. Also check if the alignment is correct. Notepad ++ helps with this step.
See:
WRONG:
RIGHT:
Save the File. (CTRL + S). Close it.
6° Return to the main folder (c:\apktool), open CMD in the folder and type the following command:
In our example, the folder name is simply issdetector.
So:
7° Copy the generated application (It is in: folder -> dist -> your application here.)
8° Move the app to your phone's internal memory. (I recommend that you move to the Download folder.)
9° Open apksigner, click the "pencil" icon, go to "Download" folder and click the app we just generated, and then click "Save".
10° When the process is done, open the folder (Download in this case) where you pasted the app generated by apktool. You will see two files, but one will be different. It will be named: GeneratedApplicationName.signed.apk. You must install this. Open.
In place of the app purchases button, you can see: Free, Already Purchased, Buy (press the Buy button in this case to work.) Or even nothing (in which case, the app simply approved our purchase, so at this point, you already have premium features or something.)
11° You did it.
Some questions:
1. I'm having an recompiling error, what can I do?
R: Try using the following command instead of: apktool d nameofyourapp.apk
This will prevent the decompile of resources.
First, I must make it clear that this is not an advanced tutorial for modifying an application. This post is the result of a knowledge I gained yesterday that I would like to share with you. However, I still have many doubts, and always try to post them here in the forum, as in:
Mod a Game x Mod a App: Is the same process?
How to modify an application and make it Premium?
Although I don't get an answer most of the time, I'm not upset and I will never be upset about it.
I also have to make it clear that this method does not work for all applications as it is a basic mod method. Now let's get down to business.
Requirements:
- An app you want to mod (Preferably a simple app. We're still in the beginning, and if you're here, it's probably because you have the same amount of knowledge as me. We will evolve together.) As an example, we will use the ISS Detector application.
- Apktool
- Notepad++
- ApkSigner
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1°) After downloading and installing all the necessary files, copy the apk file you want to mod to C:\apktool. Rename the app to something shorter for convenience. Ex: ISS Detector v1.2.3 apksite to = issdetector.
2°) Open a CMD window in the same folder where apktool and the app you want to mod are, and then use the following command:
Code:
apktool d nameofyourapp.apk
Code:
apktool d issdetector.apk
4° Once you find the file, open it with Notepad ++ that you previously downloaded. Just right-click on the file, and then click "Edit With Notepad ++".
5° Now that we have the file, we can look at a few things:
mPurchaseMap<String:
This field is referring to in-app purchases that can be made by the user. We are in luck.
If you found mPurchaseMap<String, chances are you will also find:
hasPurchase(Ljava/lang/String) Z.
This field is responsible for verifying if the user made the purchase, in the case of ISSDetector, we have:
Code:
.method public hasPurchase(Ljava/lang/String;)Z
.locals 1
.line 1
iget-object v0, p0, Lcom/runar/issdetector/util/Inventory;->mPurchaseMap:Ljava/util/Map;
invoke-interface {v0, p1}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z
move-result p1
return p1
.end method
Code:
const p1, 0x1
Code:
.method public hasPurchase(Ljava/lang/String;)Z
.locals 1
const p1, 0x1
return p1
.end method
See:
WRONG:
Code:
.method public hasPurchase(Ljava/lang/String;)Z
.locals 1
const p1, 0x1
return p1
.end method
Code:
.method public hasPurchase(Ljava/lang/String;)Z
.locals 1
const p1, 0x1
return p1
.end method
6° Return to the main folder (c:\apktool), open CMD in the folder and type the following command:
Code:
apktool b foldername
So:
Code:
apktool b issdetector
8° Move the app to your phone's internal memory. (I recommend that you move to the Download folder.)
9° Open apksigner, click the "pencil" icon, go to "Download" folder and click the app we just generated, and then click "Save".
10° When the process is done, open the folder (Download in this case) where you pasted the app generated by apktool. You will see two files, but one will be different. It will be named: GeneratedApplicationName.signed.apk. You must install this. Open.
In place of the app purchases button, you can see: Free, Already Purchased, Buy (press the Buy button in this case to work.) Or even nothing (in which case, the app simply approved our purchase, so at this point, you already have premium features or something.)
11° You did it.
Some questions:
1. I'm having an recompiling error, what can I do?
R: Try using the following command instead of: apktool d nameofyourapp.apk
Code:
apktool -r d nameyourapp.apk
Last edited: