IL2CPP does not package libunity.so and other symbol tables (Symbols) correctly

As mentioned earlier, using symbol tables can parse the call stack of so libraries such as libunity, but for the IL2CPP official package that enables engine code tailoring, the Build Id of symbol tables is inconsistent with the so library in apk.

Example

The following is the CRASH log of a Unity game. It can be seen that its packaged version is Unity 2020.3.12f1 (b3b2c6512326), an official package, and a 32-bit il2cpp package.

 CRASH   : Version '2020.3.12f1 (b3b2c6512326)',  Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a' 01 pc 002dacc8  /data/app/com.azimiao.xxx==/lib/arm/libunity.so (BuildId: eaba752843d3dbc96e38e5fbc58237203d2015e0)

It can be seen that the Build Id of libunity.so in the package is eaba752843d3dbc96e38e5fbc58237203d2015e0

Go to the Editor folder of the same version and view the Build Id of the so library and the corresponding symbol table:

The library Build Id under the discovery editor is 53fa0bec678169de9c334e6263766d77b39e30f0 , which is different from the so library ID in Apk.

Therefore, it is not feasible to directly debug the symbol package in the Editor folder.

reason

After engine code clipping is enabled, the so library will be clipped when il2cpp is packaged.

resolvent

1. When packaging with UnityEditor

When packaging next time, in the Unity Build menu, select symbol table generation:

After packaging, there will be a corresponding symbol table zip package in the peer directory.

2. When exporting the project and packaging it with Android Studio Gradle

If the engine code clipping is enabled, do not close the Unity Editor after exporting the project, and obtain the symbol table from Temp:

 #When engine code clipping is enabled: libunity:`/Temp/StagingArea/symbols/`

The libmain symbol table is still in the old place, namely PlaybackEngines in the Editor installation directory.

When Gradle is packaged, the symbol table of libil2cpp will be placed in unityLibrary/symbols/ Next.

If code clipping is not enabled, the symbol tables of libunity and libmain are in the same place, that is, PlaybackEngines in the editor installation directory.

Zimiao haunting blog (azimiao. com) All rights reserved. Please note the link when reprinting: https://www.azimiao.com/8781.html
Welcome to the Zimiao haunting blog exchange group: three hundred and thirteen million seven hundred and thirty-two thousand

Comment

*

*

Comment area

  1. Mr. wu 04-02 18:00 reply

    There is no place to leave the website? 😈 😡

    • WeiCN 04-13 17:47 reply

      Most of the comments have been swallowed and need to be released manually :mrgreen:

      • hare 04-13 23:38 reply

        No way. Last year, IDC almost warned that "the content of xxxx page violates the regulations, please rectify within x hours, otherwise the IP port is blocked and the record is revoked".

  2. mario 04-20 16:01 reply

    thank.
    CI compilation can be adjusted to EditorUserBuildSettings.androidCreateSymbolsZip=true;