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 obtain the serial number.
Code excerpt:
...
// 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;
10
11 move-result-object V0
// Save the constant string youwin in 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 cond_0
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 !" Write back to edittext
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, and 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.