Android decompile and decompile

Posted by TheTechChik on Tue, 25 Jan 2022 23:45:36 +0100

Ideally, take a Demo with login function as an example to introduce decompilation tools and processes, smali and package modification, re signature and back compilation, and other functions
 
Tool usage:
Combined tool:
Android Killer,Jadx-Gui
 
Safety test tools:
Drozer, download address: https://labs.mwrinfosecurity.com/tools/drozer/
Shelling tools:
Xposed framework, VirtualXposed framework, FDex2, dumpDex
Hook Classloader, export real dex
so debugging tools:
010 Editor and IDA
https://www.jianshu.com/p/52b91733fec1
====================================================================================
Change apk to zip and directly unzip the file directory
debug version
 
release version
 
<1> Assets Directory: keep the assets directory in the project, and the assets in the jar package under other projects will also be merged into this directory
<2> lib Directory: since the jar files have been merged into the main project when compiling, there will be no jar files in the lib directory, but all so files in the lib package will keep the original path
<3> META-INF Directory: information description, signature and other purposes. Delete the original certificate file (three files * * *. RSA, * * *. SF and * * *. MF in META-INF folder) for re signing
<4> Res Directory: the resource files of the project, mainly the main project, and other files (jar packages) will be merged into this directory; However, the values file will not appear in this directory because it has been compiled into resource In ArsC file; raw files keep their original contents and will not be compiled
<5> Androidmanifest file: configuration manifest.
<6> classes. DEX file: the file executed by the virtual machine.
<7> resources. ArsC: resource file index.
<8> Freemaker and ftl files: template engine, which is used to generate template code or files.
 
 
The directly decompressed configuration files are garbled and cannot be viewed directly
 
Use of dex2jar and JD GUI:
Change the apk into a compressed file, unzip it, get the virtual machine file, and then put it in the dex2 jar directory. Of course, you can also use other directories
D:\WorkForLlaria\AndroidHack\OriginHackTools\dex2jar-2.0\dex2jar-2.0\d2j-dex2jar --force D:\WorkForLlaria\AndroidHack\OriginHackTools\dex2jar-2.0\dex2jar-2.0\classes3.dex
 
After successful compilation, generate a jar package, and then drag it into JD GUI
 
However, this will be troublesome. You can use the tool jadx GUI:
You can directly compile the whole apk or part of the dex file
The above is a routine operation, which is only used to look at the code, but it is not easy to read after confusion.
 
smali file is the key to package change and can be regarded as the assembly language of Android virtual machine
1.apk file
This is the file format of the Android application installation package. In essence, it is a compressed package. You can change the suffix to zip and decompress it directly. After decompressing, you will get dex files, resource files, so files, etc
2.dex file
dalvik executable file, obtained through apktool or direct decompression.
3.jar file
Is an archive file, built in zip format, containing java and some element and resource files
4.smali file
dalvik bytecode file, an intermediate language, is equivalent to the assembly language of dalvik virtual machine
5.class file
Executable file of java virtual machine
 
Use of ApkTool:
 
The jar package version can be specified in the. bat file
The main function is decompilation and repackaging.
apktool d D:\WorkForLlaria\AndroidHack\OriginHackTools\SignInAppForShowDebug.apk D:\WorkForLlaria\AndroidHack\HackOutput\SignAppForShow
-o used to specify the output directory. If it is not specified, an error will be reported
This means that the decompilation is successful. At this time, the dex file has become an smali file
At this time, the configuration list file and layout file can be opened directly. Of course, if you just want to see the configuration list, you can drag the apk package directly to the AS.
 
 
 
Smali syntax:
https://www.cnblogs.com/chenxibobo/p/14109077.html
Judgment statement
If EQ equals
If ne is not equal to
If LT if less than
If Le if less than or equal to
If GT if greater than
If Ge is greater than or equal to
If EqZ if equal to zero
If Nez is not equal to 0
If ltz if less than zero
If lez if less than or equal to zero
If GTZ if greater than zero
If Gez if greater than or equal to zero
 
Data type:
B---byte
C---char
D---double
F---float
I---int
J---long
S---short
V---void
Z---boolean
[XXX---array
Lxxx/yyy---object
The array is represented by adding "[" before the basic type. For example, int array and float array are represented as: [I, [F] respectively. The object representation starts with L and the format is LpackageName/objectName; (note that there must be a semicolon followed by the last) For example, the String object in smali is Ljava/lang/String;, Where java/lang corresponds to Java Lang package, String is an object defined in the package.
LpackageName/objectName$subObjectName;. That is, add the "$" symbol before the inner class
 
The Android virtual machine is register based
Local registers are represented by symbols beginning with v and ending with numbers, such as v0, v1, v2 Parameter registers are represented by symbols beginning with p and ending with numbers, such as p0, p1, p2 In particular, p0 is not necessarily the first parameter in the function. In non static functions, p0 refers to "this", p1 represents the first parameter of the function, p2 represents the second parameter in the function... While in static functions, p0 corresponds to the first parameter (because there is no this method in Java's static method).
Static fields and instance fields are member variables in the format: Field public / private [static] [final] Varname: < type >. However, there is a difference between static fields and instance fields. Of course, the difference is obvious, that is, static fields are static, while instance is not. According to this difference, there are different instructions to obtain these different member variables. Generally speaking, the acquired instructions include iget, sget, iget Boolean, sget Boolean, iget object, sget object, etc. the operating instructions include iput, sput, iput Boolean, sput Boolean, iput object, sput object, etc. The member variable object without "- object" suffix indicates that the operation is the basic data type, and the member variable with "- object" indicates that the operation is the object type. In particular, the boolean type uses the instruction operation with "- Boolean"
The direct method is the private function, and the other public and protected functions belong to the virtual method
Invoke static: as the name suggests, it calls the static function
Invoke super: the instruction used to call the parent method
Invoke direct: the method of calling the private function
Invoke virtual: used to call protected or public functions
Move result (return basic data type) and move result object (return object)
 
annotation
# annotations
.annotation [ Annotation Properties ] < Annotation class name>
    [ Annotation field =  value]
.end annotation
Private method
# direct methods / / comments added
.method <Access rights> [ Modifier keyword] < Method prototype>
    <.locals>                   //Specifies the number of local variables to use
 [.parameter]                   //Specifies the parameters of the method
 [.prologue]                    //The beginning of the code is specified, and the confused code may remove the instruction
 [.line]                    //Specifies the line number of the instruction in the source code
<Code body>
.end method
example
# instance fields
.field < Access rights> [ Modifier keyword] < Field name>:< Field type>
package/name/ObjectName;->methodName(III)Z
package/name/ObjectName:A class 
methodName: Method name 
III: Parameter type 
Z: Return value

What you can do:

1. Skip login by modifying smali

2. Get the token in the code

3. Sinicization

This can be done by modifying the language in the values folder or directly replacing the Unicode code in smali.

4. Go advertising

Skip the ad page or set the ad layout to 0dp

package com.jxd.pangolinadtest;
 
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.LinearLayout;
 
import androidx.annotation.MainThread;
import androidx.appcompat.app.AppCompatActivity;
 
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTAdSdk;
import com.bytedance.sdk.openadsdk.TTSplashAd;
 
/**
 * Open screen advertising
 */
public class SplashActivity extends AppCompatActivity {
    private LinearLayout mSplashContainer = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
 
        initViews();
 
        initData();
    }
 
    private void initViews() {
        mSplashContainer = findViewById(R.id.splash_container);
    }
 
    private void initData() {
        //To create a TTAdNative object, createadnative (context) context needs to pass in an Activity object
        TTAdNative mTTAdNative = TTAdSdk.getAdManager().createAdNative(this);
        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
        AdSlot adSlot = new AdSlot.Builder()
                .setCodeId("887446435")
                .setImageAcceptedSize(displayMetrics.widthPixels, displayMetrics.heightPixels)
                .build();
 
        mTTAdNative.loadSplashAd(adSlot, new TTAdNative.SplashAdListener() {
            //Failed to request advertisement
            @Override
            @MainThread
            public void onError(int code, String message) {
                //The developer handles the logic of jumping to the APP main page
                gotoMain();
            }
 
            //Request advertisement timeout
            @Override
            @MainThread
            public void onTimeout() {
                //The developer handles the logic of jumping to the APP main page
                gotoMain();
            }
 
            //Ad request succeeded
            @Override
            @MainThread
            public void onSplashAdLoad(TTSplashAd ad) {
                if (ad == null) {
                    return;
                }
                ad.setSplashInteractionListener(new TTSplashAd.AdInteractionListener() {
 
                    //Click callback
                    @Override
                    public void onAdClicked(View view, int type) {
 
                    }
 
                    //Show callback
                    @Override
                    public void onAdShow(View view, int type) {
 
                    }
 
                    //skip callback
                    @Override
                    public void onAdSkip() {
                        //The developer handles the logic of jumping to the APP main page
                        gotoMain();
                    }
 
                    //Timeout countdown end
                    @Override
                    public void onAdTimeOver() {
                        //The developer handles the logic of jumping to the APP main page
                        gotoMain();
                    }
                });
                //Get SplashView
                View view = ad.getSplashView();
                if (view != null && mSplashContainer != null && !SplashActivity.this.isFinishing()) {
                    mSplashContainer.removeAllViews();
                    //Add SplashView to the ViewGroup, and note that the open screen advertisement view: width = screen width; Height > = 75% screen height
                    mSplashContainer.addView(view);
                    //Set not to turn on the countdown function of open screen advertising and not to display the skip button. If so, you need to customize the countdown logic
                    //ad.setNotAllowSdkCountdown();
                }else {
                    //The developer handles the logic of jumping to the APP main page
                    gotoMain();
                }
            }
        }, 4000);
 
 
    }
 
    private void gotoMain() {
        startActivity(new Intent(SplashActivity.this,MainActivity.class));
    }
}

=============================================================================================

Take the login page as an example:

You can see that after clicking the login button, if the password is wrong, you will be prompted that the login fails. The corresponding Unicode code is \ u767b\u5f55\u5931\u8d25,

Search in the project to find the corresponding code

 

//essential information
.class public Lsun/sundy/signinapp/LoginActivity;
.super Landroidx/appcompat/app/AppCompatActivity;
.source "LoginActivity.java"

//static const 
# static fields
.field private static final TAG:Ljava/lang/String; = "LoginActivity"


# instance fields
.field btnRegisterLogin:Landroid/widget/Button;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f090057
    .end annotation
.end field

.field cbTeacherOrStudent:Landroidx/appcompat/widget/AppCompatCheckBox;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f09005c
    .end annotation
.end field

.field etPassword:Landroid/widget/EditText;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f09009e
    .end annotation
.end field

.field etPasswordSecond:Landroid/widget/EditText;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f09009f
    .end annotation
.end field

.field etUserName:Landroid/widget/EditText;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0900a0
    .end annotation
.end field

.field private isLogin:Z

.field llUserName:Landroid/widget/LinearLayout;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0900d4
    .end annotation
.end field

.field llUserPassword:Landroid/widget/LinearLayout;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0900d5
    .end annotation
.end field

.field llUserPasswordSecond:Landroid/widget/LinearLayout;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0900d6
    .end annotation
.end field

.field private studentOrTeacherEntityDao:Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao;

.field tvPassword:Landroid/widget/TextView;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901a0
    .end annotation
.end field

.field tvPasswordSecond:Landroid/widget/TextView;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901a1
    .end annotation
.end field

.field tvRegisterOrLogin:Landroid/widget/TextView;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901a2
    .end annotation
.end field

.field tvTitle:Landroid/widget/TextView;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901a4
    .end annotation
.end field

.field tvUserName:Landroid/widget/TextView;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901a5
    .end annotation
.end field

.field viewDividerOne:Landroid/view/View;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901ab
    .end annotation
.end field

.field viewDividerThree:Landroid/view/View;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901ac
    .end annotation
.end field

.field viewDividerTwo:Landroid/view/View;
    .annotation runtime Lbutterknife/BindView;
        value = 0x7f0901ad
    .end annotation
.end field


# direct methods
.method public constructor <init>()V
    .locals 1

    .line 29
    invoke-direct {p0}, Landroidx/appcompat/app/AppCompatActivity;-><init>()V

    .line 64
    const/4 v0, 0x1

    iput-boolean v0, p0, Lsun/sundy/signinapp/LoginActivity;->isLogin:Z

    return-void
.end method

.method static synthetic access$000(Lsun/sundy/signinapp/LoginActivity;)Z
    .locals 1
    .param p0, "x0"    # Lsun/sundy/signinapp/LoginActivity;

    .line 29
    iget-boolean v0, p0, Lsun/sundy/signinapp/LoginActivity;->isLogin:Z

    return v0
.end method

.method static synthetic access$002(Lsun/sundy/signinapp/LoginActivity;Z)Z
    .locals 0
    .param p0, "x0"    # Lsun/sundy/signinapp/LoginActivity;
    .param p1, "x1"    # Z

    .line 29
    iput-boolean p1, p0, Lsun/sundy/signinapp/LoginActivity;->isLogin:Z

    return p1
.end method

.method static synthetic access$100(Lsun/sundy/signinapp/LoginActivity;)V
    .locals 0
    .param p0, "x0"    # Lsun/sundy/signinapp/LoginActivity;

    .line 29
    invoke-direct {p0}, Lsun/sundy/signinapp/LoginActivity;->submitRegister()V

    return-void
.end method

.method static synthetic access$200(Lsun/sundy/signinapp/LoginActivity;)V
    .locals 0
    .param p0, "x0"    # Lsun/sundy/signinapp/LoginActivity;

    .line 29
    invoke-direct {p0}, Lsun/sundy/signinapp/LoginActivity;->submitLogin()V

    return-void
.end method

.method private initData()V
    .locals 3

    .line 158
    nop

    .line 159
    invoke-static {p0}, Lkr/co/namee/permissiongen/PermissionGen;->with(Landroid/app/Activity;)Lkr/co/namee/permissiongen/PermissionGen;

    move-result-object v0

    .line 160
    const/16 v1, 0x13

    invoke-virtual {v0, v1}, Lkr/co/namee/permissiongen/PermissionGen;->addRequestCode(I)Lkr/co/namee/permissiongen/PermissionGen;

    move-result-object v0

    const-string v1, "android.permission.WRITE_EXTERNAL_STORAGE"

    const-string v2, "android.permission.READ_EXTERNAL_STORAGE"

    filled-new-array {v1, v2}, [Ljava/lang/String;

    move-result-object v1

    .line 161
    invoke-virtual {v0, v1}, Lkr/co/namee/permissiongen/PermissionGen;->permissions([Ljava/lang/String;)Lkr/co/namee/permissiongen/PermissionGen;

    move-result-object v0

    .line 165
    invoke-virtual {v0}, Lkr/co/namee/permissiongen/PermissionGen;->request()V

    .line 166
    invoke-static {}, Lsun/sundy/signinapp/database/utils/BizDaoManager;->getInstance()Lsun/sundy/signinapp/database/utils/BizDaoManager;

    move-result-object v0

    invoke-virtual {v0}, Lsun/sundy/signinapp/database/utils/BizDaoManager;->getDaoSession()Lsun/sundy/signinapp/database/gen/DaoSession;

    move-result-object v0

    invoke-virtual {v0}, Lsun/sundy/signinapp/database/gen/DaoSession;->getStudentOrTeacherEntityDao()Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao;

    move-result-object v0

    iput-object v0, p0, Lsun/sundy/signinapp/LoginActivity;->studentOrTeacherEntityDao:Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao;

    .line 167
    return-void
.end method

.method private initListener()V
    .locals 2

    .line 84
    iget-object v0, p0, Lsun/sundy/signinapp/LoginActivity;->tvRegisterOrLogin:Landroid/widget/TextView;

    new-instance v1, Lsun/sundy/signinapp/LoginActivity$1;

    invoke-direct {v1, p0}, Lsun/sundy/signinapp/LoginActivity$1;-><init>(Lsun/sundy/signinapp/LoginActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 104
    iget-object v0, p0, Lsun/sundy/signinapp/LoginActivity;->btnRegisterLogin:Landroid/widget/Button;

    new-instance v1, Lsun/sundy/signinapp/LoginActivity$2;

    invoke-direct {v1, p0}, Lsun/sundy/signinapp/LoginActivity$2;-><init>(Lsun/sundy/signinapp/LoginActivity;)V

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 131
    return-void
.end method
//Take this as an example
.method private initView()V
    .locals 2

    .line 79
    iget-object v0, p0, Lsun/sundy/signinapp/LoginActivity;->llUserPasswordSecond:Landroid/widget/LinearLayout;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setVisibility(I)V

    .line 80
    iget-object v0, p0, Lsun/sundy/signinapp/LoginActivity;->cbTeacherOrStudent:Landroidx/appcompat/widget/AppCompatCheckBox;

    invoke-virtual {v0, v1}, Landroidx/appcompat/widget/AppCompatCheckBox;->setVisibility(I)V

    .line 81
    return-void
.end method
//Take this as an example
.method private submitLogin()V
    .locals 5

    .line 134
    iget-object v0, p0, Lsun/sundy/signinapp/LoginActivity;->studentOrTeacherEntityDao:Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao;

    invoke-virtual {v0}, Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao;->queryBuilder()Lorg/greenrobot/greendao/query/QueryBuilder;

    move-result-object v0

    .line 135
    .local v0, "queryBuilder":Lorg/greenrobot/greendao/query/QueryBuilder;, "Lorg/greenrobot/greendao/query/QueryBuilder<Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;>;"
    sget-object v1, Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao$Properties;->Name:Lorg/greenrobot/greendao/Property;

    iget-object v2, p0, Lsun/sundy/signinapp/LoginActivity;->etUserName:Landroid/widget/EditText;

    invoke-virtual {v2}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lorg/greenrobot/greendao/Property;->eq(Ljava/lang/Object;)Lorg/greenrobot/greendao/query/WhereCondition;

    move-result-object v1

    const/4 v2, 0x1

    new-array v2, v2, [Lorg/greenrobot/greendao/query/WhereCondition;

    sget-object v3, Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao$Properties;->Password:Lorg/greenrobot/greendao/Property;

    iget-object v4, p0, Lsun/sundy/signinapp/LoginActivity;->etPassword:Landroid/widget/EditText;

    .line 136
    invoke-virtual {v4}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Lorg/greenrobot/greendao/Property;->eq(Ljava/lang/Object;)Lorg/greenrobot/greendao/query/WhereCondition;

    move-result-object v3

    const/4 v4, 0x0

    aput-object v3, v2, v4

    .line 135
    invoke-virtual {v0, v1, v2}, Lorg/greenrobot/greendao/query/QueryBuilder;->where(Lorg/greenrobot/greendao/query/WhereCondition;[Lorg/greenrobot/greendao/query/WhereCondition;)Lorg/greenrobot/greendao/query/QueryBuilder;

    .line 137
    invoke-virtual {v0}, Lorg/greenrobot/greendao/query/QueryBuilder;->build()Lorg/greenrobot/greendao/query/Query;

    move-result-object v1

    invoke-virtual {v1}, Lorg/greenrobot/greendao/query/Query;->unique()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;

    .line 138
    .local v1, "entity":Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;
    if-eqz v1, :cond_0

    .line 139
    new-instance v2, Landroid/content/Intent;

    const-class v3, Lsun/sundy/signinapp/MainActivity;

    invoke-direct {v2, p0, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 140
    .local v2, "intent":Landroid/content/Intent;
    invoke-virtual {v1}, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "loginName"

    invoke-virtual {v2, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 141
    invoke-virtual {v1}, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;->getIsTeacher()I

    move-result v3

    const-string v4, "isTeacher"

    invoke-virtual {v2, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 142
    invoke-virtual {p0, v2}, Lsun/sundy/signinapp/LoginActivity;->startActivity(Landroid/content/Intent;)V

    .line 143
    .end local v2    # "intent":Landroid/content/Intent;
    goto :goto_0

    .line 144
    :cond_0
    const-string v2, "\u767b\u5f55\u5931\u8d25\uff0c\u7528\u6237\u4e0d\u5b58\u5728\u6216\u5bc6\u7801\u9519\u8bef\uff01"

    invoke-static {v2}, Lsun/sundy/signinapp/utils/ToastUtils;->showToast(Ljava/lang/String;)V

    .line 146
    :goto_0
    return-void
.end method

.method private submitRegister()V
    .locals 2

    .line 149
    new-instance v0, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;

    invoke-direct {v0}, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;-><init>()V

    .line 150
    .local v0, "entity":Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;
    iget-object v1, p0, Lsun/sundy/signinapp/LoginActivity;->etUserName:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;->setName(Ljava/lang/String;)V

    .line 151
    iget-object v1, p0, Lsun/sundy/signinapp/LoginActivity;->etPassword:Landroid/widget/EditText;

    invoke-virtual {v1}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;->setPassword(Ljava/lang/String;)V

    .line 152
    iget-object v1, p0, Lsun/sundy/signinapp/LoginActivity;->cbTeacherOrStudent:Landroidx/appcompat/widget/AppCompatCheckBox;

    invoke-virtual {v1}, Landroidx/appcompat/widget/AppCompatCheckBox;->isChecked()Z

    move-result v1

    invoke-virtual {v0, v1}, Lsun/sundy/signinapp/entity/StudentOrTeacherEntity;->setIsTeacher(I)V

    .line 153
    iget-object v1, p0, Lsun/sundy/signinapp/LoginActivity;->studentOrTeacherEntityDao:Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao;

    invoke-virtual {v1, v0}, Lsun/sundy/signinapp/database/gen/StudentOrTeacherEntityDao;->insertOrReplace(Ljava/lang/Object;)J

    .line 154
    const-string v1, "\u6ce8\u518c\u6210\u529f\uff01"

    invoke-static {v1}, Lsun/sundy/signinapp/utils/ToastUtils;->showToast(Ljava/lang/String;)V

    .line 155
    return-void
.end method


# virtual methods
.method public doFailSomething()V
    .locals 2
    .annotation runtime Lkr/co/namee/permissiongen/PermissionFail;
        requestCode = 0x13
    .end annotation

    .line 179
    const-string v0, "LoginActivity"

    const-string v1, "doSomething: \u6743\u9650\u83b7\u53d6\u5931\u8d25"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 180
    invoke-virtual {p0}, Lsun/sundy/signinapp/LoginActivity;->finish()V

    .line 181
    return-void
.end method

.method public doSomething()V
    .locals 2
    .annotation runtime Lkr/co/namee/permissiongen/PermissionSuccess;
        requestCode = 0x13
    .end annotation

    .line 172
    const-string v0, "LoginActivity"

    const-string v1, "doSomething: \u6743\u9650\u83b7\u53d6\u6210\u529f"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 173
    invoke-static {}, Lsun/sundy/signinapp/database/utils/BizDaoManager;->getInstance()Lsun/sundy/signinapp/database/utils/BizDaoManager;

    move-result-object v0

    invoke-virtual {v0}, Lsun/sundy/signinapp/database/utils/BizDaoManager;->init()Lorg/greenrobot/greendao/database/Database;

    .line 174
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 1
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;
    .annotation system Ldalvik/annotation/MethodParameters;
        accessFlags = {
            0x0
        }
        names = {
            "savedInstanceState"
        }
    .end annotation

    .line 70
    invoke-super {p0, p1}, Landroidx/appcompat/app/AppCompatActivity;->onCreate(Landroid/os/Bundle;)V

    .line 71
    const v0, 0x7f0c001c

    invoke-virtual {p0, v0}, Lsun/sundy/signinapp/LoginActivity;->setContentView(I)V

    .line 72
    invoke-static {p0}, Lbutterknife/ButterKnife;->bind(Landroid/app/Activity;)Lbutterknife/Unbinder;

    .line 73
    invoke-direct {p0}, Lsun/sundy/signinapp/LoginActivity;->initView()V

    .line 74
    invoke-direct {p0}, Lsun/sundy/signinapp/LoginActivity;->initData()V

    .line 75
    invoke-direct {p0}, Lsun/sundy/signinapp/LoginActivity;->initListener()V

    .line 76
    return-void
.end method

Recompile package:

 apktool b D:\WorkForLlaria\AndroidHack\HackOutput\SignAppForShowDebug

Prompt error

apk cannot be installed at this time because of the signature problem.

Re sign with jarsigner in JDK tool:

jarsigner -keystore D:\WorkForLlaria\AndroidHack\HackOutput\SignAppForShowDebug\dist\debug.jks -signedjar D:\WorkForLlaria\AndroidHack\HackOutput\SignAppForShowDebug\dist\android_sign.apk D:\WorkForLlaria\AndroidHack\HackOutput\SignAppForShowDebug\dist\SignInAppForShowDebug.apk debugkey

In fact, many apk s will also be shelled and key code packaged into so

Shelling and so decompilation:

https://blog.csdn.net/xiangzhihong8/article/details/93738211

 
 
 
 
 
 
 

Topics: Android