Exploring the android APK decryption Project (1) -- a simple example

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.