How to decompile the aar package to view class files and use AndroidStudio to view mobile phone logs and package Unity's Export project into apk

1. How to decompile the aar package to view the class script files in the aar?

First download the "jd-gui" tool: GitHub - java-decompiler/jd-gui: A standalone Java Decompiler GUI

There are detailed usage methods in the "README.md" of the project. Just download any jar file in the picture below

After the download is complete, double-click to run the "jd-gui-1.6.6-min.jar" to open the decompiler software:

Click "File -> Open File" to open the aar file that needs to be decompiled

2. How to use AndroidStudio to view the log log of the mobile phone?

First download and install AndroidStudio: https://developer.android.com/studio

After the installation is complete, create a new Empty Activity project, open the project and click "Device Manager" in the menu bar "Tools":

Connect the mobile phone to the computer with a data cable, and you can view the device in Device Manager

Click "Logcat" at the bottom to view the log log of the mobile phone, and can adjust the display of "error", "info", "warning" and other categories of logs

3. How to use AndroidStudio to package the "export project" of the Unity Android platform into an apk?

1. First check "export project" in Unity's Player Setting, and use AndroidStudio to open the project after executing "Export".

Open AndroidStudio, select "File -> Open" to open the Export project:

Note: If the Android SDK path set in Unity is inconsistent with the AndroidStudio SDK path, then in order to avoid affecting the original settings of the "Export project", you can choose to "keep" the SDK location in Unity (this selection also means that the default AndroidStudio SDK path modification).

2. After opening the export project, AndroidStudio will make some configuration updates for the project, which can be viewed in the lower right corner:

Note: When importing an export project, the "Gradle: Build" in the lower right corner of AndroidStudio takes a long time, and sometimes even fails, it may be due to the address of the maven warehouse in the "build.gradle" of the export project.

Reason: The maven address in the build.gradle file of the export project may be reset back to Google maven

Solution: Replace the maven in build.gradle in the export project with the Alibaba Cloud maven mirror address

3. After the configuration is complete, click "Build -> Build Bundles -> Build APK" in the menu bar to package the apk:

PS: Select "Build Bundles" or "Generate Signed Bundle" according to whether the export project has a signature

Supongo que te gusta

Origin blog.csdn.net/m0_47975736/article/details/123599295
Recomendado
Clasificación