IN our Android App Reversing Using Android Phones Series we have discussed about its introduction and how to remove banner ads so far. In today’s article we will be discussing to remove trial expired pop-up i.e extending the trial period.
Now before we start with our Tut let’s go through few basic Dalvik Op-Codes which help us in to understand our decompile small code’s & reversing of our target’s
nop – No operation
const/4 vx,lit4 – Puts the 4 bit constant into vx
const/16 vx,lit16 – Puts the 16 bit constant into vx
const-string vx,string_id – Puts reference to a string constant identified by string id into vx.
Goto – Unconditional jump by short offset
If-eqz vx,target – Jumps to target if vx=0 vx is an integer value
If-nez vx,target – Checks vx and jumps if vx is nonzero.
If-lez vx,target – Checks vx and jumps if vx<=0
xor-int vx, vy, vz – Calculates vy XOR vz and puts the result into vx.
add-int vx,vy,vz – Calculates vy+vz and puts the result into vx.
sub-int vx,vy,vz – Calculates vy-vz and puts the result into vx.
mul-int vx, vy, vz – Multiplies vz with wy and puts the result int vx.
div-int vx,vy,vz – Divides vy with vz and puts the result into vx.
return-void – Return without a return value
NOTE:- vx,vv,vy,vz are integer vale to explain the use of code
I just cover here only important code that we are going to use while reversing & understanding the target for more reference of Dalvik Op-Code you can go to here:-
Remove Trial Expired Pop-up
TARGET: Medical Calculators
METHOD: Reversing Smali Codes
Note down & understand all restrictions
- Skip Verification Button visible only for 7day’s
- 7 day’s Trial End Pop-Ups
So let’s begin with removing first restriction i.e after expiry of 7 day’s “Skip Login Verification” Button will be removed from Screen so that we can’t access app offline until we login:
Start with decompile apk & one it’s done the go to smali\Pedcall\Calculator folder
Now we need to find the code which control our Skip Login Verification Button visibility in such manner that after expiry of 7 day’s it will removed from screen.
But question is how we can find that code in bunch of smali file’s? Let’s apply some logic, we know that this button appears on screen with login option & there we see some login related smali. So just open & search for “Skip” in one after another login related smali. Alternatively you can use “aGrep” app for this which we discussed next here.
And their You will find following code in “login.smali”
So we just need to change –
if-nez v23, :cond_0 to goto :cond_0
In order to make our Skip Verification button always visible even after expiry of 7 day’
Now we are going to remove 7 day’s trial expired Popup’s
So let’s search for the smali file which contain sting “Your trial period of 7 days has expired. Kindly login to continue using the app for free.” To do this we just fire up “aGrep” app & search for it.
Result of Our Search you get in to this window
So now we know where we are going to find this string ie. inside “MainActivity.smali”
Our conditional jump will land us at
Now why goto_2 & not cond_0 ?
Because If you see above code in continuation then you will going to find that there is two more condition (cond_7 & cond_8) between day’s & time calculation and both of this condition used to generate alert dialog for Number of Trial Day’s left.
Condition-7 Code view which lead us to Trial Message
Condition-8 Code view which lead us to Trial message.
Since we don’t want anymore pop-up we don’t use this two condition but end method of both this condition is important for us i.e both of this condition lead us to goto_2
So we just ignore cond_0 and go with the flow of code and here we land after this point everything is going good without any annoying pop-up.
Now just last pop-up remain which we are going to edit and not remove.
We repeat the process of searching the string and we find above strings inside “login$6.smali”
Now we are all done. Just Recompile, Zipalign and Sign the apk. Now you have unlimited access to the application.
In our next article we will be discussing about how to crack premium content of android application. To be updated about our post please allow notification and do like our facebook page