Android reverse learning (1) vscode performs reverse modification and repackaging of android

Android reverse learning (1) vscode performs reverse modification and repackaging of android

write in front

In fact, I don’t know if this article can be written. In fact, I have opened a lot of pits but have not filled them in. Now that the patent has been issued, I have started to fill them in. The main content of this pit is about android reverse engineering, the main tutorial. The source comes from the master course of the 52 Crack Forum, but that is the Windows version. I like to use Linux, so this is a learning tutorial with relatively large changes, but I am sure you can also run it on Windows, let's go.

1. Software preparation

As mentioned above, I am a linux user, so I use the same substitute under linux (I feel that the software under linux is better to use)

1. Simulator

The simulator I use is called xdroid. I think this is better than that of android studio (of course when analyzing it), because the native code used by many software is under the arm architecture, and the simulator under android studio is mainly x86 Architecture, many software cannot be analyzed. Of course, if you need to turn off security boot when installing xdroid, you need to turn it off in the bios.

Then we download the xdroid installation package and run it directly with ./. Remember not to use sudo ./ or it will prompt you that it is not possible.

The software we also need to install include development assistant and NP manager. These two are mainly used for reverse analysis, and this one is already rooted. We can also use adb directly for debugging. Pay attention to the android 7 in the upper right corner. Change to android 9, otherwise some of my favorite software cannot be installed.

e37fb64ed46ed0c27dbe1508fa5999e97163022138e29438d1625e8128ff2355

adb command

adb devices
adb -s xxxx root
adb -s xxxx shell

20230902234342

2. Software used in reverse

The NP manager and development assistant are used in the tutorial. Of course, I feel that it is not very elegant to use the NP manager directly. After all, it is better to modify it directly on the computer in reverse. This will make us look more professional, so I use The software is vscode and apktool. I won’t talk about apktool. I have introduced this in my previous blog.

For VScode, I use the APKLab extension, which makes it easier to use apktool and other decompilation software. It is also very convenient to package apk and so on.

My vscode plugins are mainly:

smalise: Used to view smali code, it is apklab's pre-software

apklab: The main plug-in is a very powerful plug-in that can integrate various tools such as apktool and can be operated directly using the keyboard.

luna paint: This is a software used to edit pictures. It can be used to modify pictures better. Of course, you can do this without downloading it. This will not affect

smali2java: This is a very useful decompilation plug-in, which can convert the code into Java code and view the logic of the code more clearly.

Software configuration process

The only software we mainly configure is apklab

20230902223813

The first three are the paths of your tools. You don’t need to touch this one. This one will be downloaded automatically.

The Keyalias behind is your android development signature. Each apk package must have a signature before it can be installed. Since it has been decompiled and modified, you have to find a key to re-sign. The way to generate this is to use android Studio generates it. I won’t explain the details. Just check it directly.

2. Modify and repackage the android text

Now comes the first task that I love, which is to modify the image text. Let’s do this. First press (Ctrl+Shift+P) to select open apk, and then you can open your installation package. This is the structure after we reversed it.

20230902224541

Then we need to use the development assistant to check which activity our current activity is. Open the development assistant, and then click on the current activity. You can see the class name displayed on the page. Then we run the software that needs to be cracked and you can see the current activity. activity

20230902224814

Then this thing will be displayed

20230902225347

We look for the related resources of this activity in the vscode installation package.

We found the first sentence in the smali code

20230902225627

Just modify it

20230902230559

We can find the layout in res, which is the layout file, and there is also a text here, which can be modified.

20230902230824

Then there are pictures in mipmap-xxxhdpi, so replace them with them.

20230902230940

Then based on the previous layout file, we found that the copy inside was in @string, so we should check the values ​​to find string.xml, modify tip1 and first_tv, and sure enough we found relevant things

20230902231540

20230902231614

We will still make changes

After the modification is completed, don’t forget to save it. Then we right-click apktool.yml to package and install it. The packaged file is in your dist file. Please note that this is a bit buggy. Let me explain it to you slowly.

20230902232442

  1. You need to open one of the software before your adb can find the simulator, so remember to open the development assistant or other software to let the simulator run before you install it.
  2. There is no such icon after installation. This is a bug in the simulator. It can be opened through the development assistant, so it will be fine. As long as the output console shows no problems.

So the way we open the application after installation is to view it in Manifest -> software name -> click on the upper right corner to open the application, and then after opening the application we can see the modified file (this installation package can be installed on a real machine, I tried pass)

Then we saw the pictures of Brother Hu and Wannian

20230902233721

Guess you like

Origin blog.csdn.net/qq_52380836/article/details/132644313