How to interpret the stack trace of an obfuscated app

45 Views Asked by At

When an error occurred in my app, I used the Catcher package to have a stack trace sent to my email when an error occurred.

Can I decode it through the following stack trace and files generated during build? Or is there another way?

Since the app has been obfuscated, the stack trace is as follows:

Stack trace:

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 32152, tid: 32194, name 1.ui
os: android arch: arm64 comp: yes sim: no
build_id: '5640f66f3376a52a4067e2635b138a17'
isolate_dso_base: 7bd32da000, vm_dso_base: 7bd32da000
isolate_instructions: 7bd3429440, vm_instructions: 7bd3422000
#00 abs 0000007bd34fd0f3 virt 00000000002230f3 _kDartIsolateSnapshotInstructions+0xd3cb3
#01 abs 0000007bd37704af virt 00000000004964af _kDartIsolateSnapshotInstructions+0x34706f
#02 abs 0000007bd3447f0b virt 000000000016df0b _kDartIsolateSnapshotInstructions+0x1eacb
#03 abs 0000007bd3448287 virt 000000000016e287 _kDartIsolateSnapshotInstructions+0x1ee47
#04 abs 0000007bd37706eb virt 00000000004966eb _kDartIsolateSnapshotInstructions+0x3472ab
#05 abs 0000007bd3446f3b virt 000000000016cf3b _kDartIsolateSnapshotInstructions+0x1dafb
#06 abs 0000007bd3446a63 virt 000000000016ca63 _kDartIsolateSnapshotInstructions+0x1d623
#07 abs 0000007bd34469cf virt 000000000016c9cf _kDartIsolateSnapshotInstructions+0x1d58f
#08 abs 0000007bd3770c13 virt 0000000000496c13 _kDartIsolateSnapshotInstructions+0x3477d3
#09 abs 0000007bd344842b virt 000000000016e42b _kDartIsolateSnapshotInstructions+0x1efeb
#10 abs 0000007bd3704813 virt 000000000042a813 _kDartIsolateSnapshotInstructions+0x2db3d3
#11 abs 0000007bd37aed23 virt 00000000004d4d23 _kDartIsolateSnapshotInstructions+0x3858e3
#12 abs 0000007bd37046c7 virt 000000000042a6c7 _kDartIsolateSnapshotInstructions+0x2db287
#13 abs 0000007bd3446643 virt 000000000016c643 _kDartIsolateSnapshotInstructions+0x1d203
#14 abs 0000007bd376f813 virt 0000000000495813 _kDartIsolateSnapshotInstructions+0x3463d3
#15 abs 0000007bd34465b3 virt 000000000016c5b3 _kDartIsolateSnapshotInstructions+0x1d173

When building your app with obfuscation, use the following command from the command line: flutter build appbundle --release --obfuscate --split-debug-info=#debug_symbol --extra-gen-snapshot-options=--save-obfuscation-map=#debug_map

I got two clues: #debug_symbol and #debug_map in the above command.

According to the flutter documentation, #debug_symbol should have a stack trace file, but I don't know what that is. At least I don't think I can send it by email from the device where the error occurred.

In the case of #debug_map, when I open it, the original method name and the obfuscated method name are listed as follows.

["","","_startInteraction@147231897","_VUb@147231897","_pointerSignalEventDelta@252211710","_QSb@252211710","_initialLifecycleStateAccessed@15065589","_QVa@15065589","untransformedEndPosition","Axd","getLibraries","ZKd","ScrollViewKeyboardDismissBehavior","oea","_onIncrease","_jmd","cidOneByteString=","cidOneByteString=","_CupertinoTextThemeDefaults","_kw","effectiveLinkedOffset","GBe","_isAlphabeticCharacter","_NAa","_previousFloatingActionButtonLocation","_BPb","__pushOffset$Method$FfiNative$Ptr","_lcb","lowSurrogate","eEd","SemanticsAction","Lp","_Content@617086758","_kla@617086758", ...

I wrote code that intentionally caused an error in my app, and tried to find the original method name in #debug_map by comparing the stack trace from the obfuscated app with the stack trace from the original app, but failed.

Error occurred in debug mode:

#0      _AboutDialogContent.sadasopdjlwklqdasd (package:simple_word/ui/about_dialog.dart:77:5)
#1      _AboutDialogContent.loaskldnasdklasdnaskldMEthod (package:simple_word/ui/about_dialog.dart:73:5)
#2      _AboutDialogContent.method1 (package:simple_word/ui/about_dialog.dart:69:5)
#3      _AboutDialogContent.starrtttttbug (package:simple_word/ui/about_dialog.dart:65:5)
#4      _AboutDialogContent.build.<anonymous closure>.<anonymous closure> (package:simple_word/ui/about_dialog.dart:41:46)

Error encountered in obfuscated release mode:

#00 abs 0000007bd34fd0f3 virt 00000000002230f3 _kDartIsolateSnapshotInstructions+0xd3cb3
#01 abs 0000007bd37704af virt 00000000004964af _kDartIsolateSnapshotInstructions+0x34706f
#02 abs 0000007bd3447f0b virt 000000000016df0b _kDartIsolateSnapshotInstructions+0x1eacb
#03 abs 0000007bd3448287 virt 000000000016e287 _kDartIsolateSnapshotInstructions+0x1ee47
#04 abs 0000007bd37706eb virt 00000000004966eb _kDartIsolateSnapshotInstructions+0x3472ab
#05 abs 0000007bd3446f3b virt 000000000016cf3b _kDartIsolateSnapshotInstructions+0x1dafb
#06 abs 0000007bd3446a63 virt 000000000016ca63 _kDartIsolateSnapshotInstructions+0x1d623
#07 abs 0000007bd34469cf virt 000000000016c9cf _kDartIsolateSnapshotInstructions+0x1d58f
#08 abs 0000007bd3770c13 virt 0000000000496c13 _kDartIsolateSnapshotInstructions+0x3477d3
#09 abs 0000007bd344842b virt 000000000016e42b _kDartIsolateSnapshotInstructions+0x1efeb
#10 abs 0000007bd3704813 virt 000000000042a813 _kDartIsolateSnapshotInstructions+0x2db3d3
#11 abs 0000007bd37aed23 virt 00000000004d4d23 _kDartIsolateSnapshotInstructions+0x3858e3
#12 abs 0000007bd37046c7 virt 000000000042a6c7 _kDartIsolateSnapshotInstructions+0x2db287
#13 abs 0000007bd3446643 virt 000000000016c643 _kDartIsolateSnapshotInstructions+0x1d203
#14 abs 0000007bd376f813 virt 0000000000495813 _kDartIsolateSnapshotInstructions+0x3463d3
#15 abs 0000007bd34465b3 virt 000000000016c5b3 _kDartIsolateSnapshotInstructions+0x1d173

Debug mode has 5 lines, but release mode has 16 lines. So I found the names of the top 5 methods in debug mode in #debug_map and compared them with the addresses of the top 5 methods in release mode (the string after _kDartIsolateSnapshotInstructions+), but I couldn't find any correlation.

0xd3cb3 uVd
0x34706f tVd
0x1eacb sVd
0x1ee47 rVd
0

There are 0 best solutions below