First, decrypt the simplest apk program. The apk interface is as follows:
This apk is simple and easier to use. Enter the content in the input box and click "verify". If the serial number is correct, "lisence correct!" is displayed in the input box !"
The entered serial number is incorrect. The input box displays "lisence uncorrect !"
Click the Clear button to enter the content in the condition input box.
Our goal is to find the correct serial number.
Decryption process: 1.1. apktool decompile the apk File
After decompression, the folder crackme_constantstring.apk with the same name is displayed:
1.2 understand the meaning of the Code in LisenceCheck $1. smali and get the excerpt of the serial number code :... // Obtain the content in EditText and save it in v0. 1 iget-object v0, p0, Lcom/mstar/test/LisenceCheck $1;-> this $0: lcom/mstar/test/LisenceCheck; 2 3 iget-object v0, v0, Lcom/mstar/test/LisenceCheck;-> medittext: Landroid/widget/EditText; 4 5 invoke-virtual {v0}, Landroid/widget/EditText;-> getText () Landroid/text/Editable; 6 7 move-result-object v0 8 9 invoke-interface {v0}, Landroid/text/Editable;-> toString () Ljava/lang/String; 1 0 11 move-result-object v0 www.2cto.com/add a regular string of youwinin to v1, 1 const-String v1, "youwin" 2 3 invoke-virtual {v0, v1}, Ljava/lang/string; -> equals (Ljava/lang/Object;) Z 4 5 move-result v0 // compare v0 and v1. if not, jump to the cond_0 position 1 if-eqz v0 ,: cond_0 // We have estimated that youwin is the serial number, and then look down at cond_0 to verify our ideas... // Starts at cond_0. The unequal result is "listence uncorrect !" 1: cond_0 2 3 iget-object v0, p0, Lcom/mstar/test/LisenceCheck $1;-> this $0: Lcom/mstar/test/LisenceCheck; 4 5 iget-object v0, v0, Lcom/mstar/test/LisenceCheck;-> medittext: Landroid/widget/EditText; 6 7 const-string v1, "lisence uncorrect! "8 9 invoke-virtual {v0, v1}, Landroid/widget/EditText;-> setText (Ljava/lang/CharSequence;) V 10 11 goto: goto_0 jump here, lisence uncorrect is displayed in EditText !, Youwin is the serial number we are looking. Here, we have completed the first crackme, simple constant string cracking. If the apk is stored in my shared resources, the address will not be pasted. Thank you.