Skip to content

Commit

Permalink
fix(crashlytics, ios): fix Crashlytics obfuscation for iOS on the Flu…
Browse files Browse the repository at this point in the history
…tter side (#10566)
  • Loading branch information
themiswang committed Mar 7, 2023
1 parent 8bdd2c0 commit a4fa7ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Expand Up @@ -20,17 +20,13 @@ List<Map<String, String>> getStackTraceElements(StackTrace stackTrace) {
// Crashlytics Console groups issues with same stack trace.
// Obfuscated stack traces contains abs address, virt address
// and symbol name + offset. abs addresses are different across
// sessions, so same error can create different issues in Console.
// We replace abs address with '0' so that Crashlytics Console can
// group same exceptions. Also we don't need abs addresses for
// deobfuscating, if we have virt address or symbol name + offset.
final String method = frame.member.replaceFirstMapped(
_obfuscatedStackTraceLineRegExp,
(match) => '${match.group(1)}0${match.group(3)}');
// sessions, Crashlytics is smart enough to group exceptions
// in the same issue. For iOS we use abs address for symbolication
// and for Android we use virt address.
elements.add(<String, String>{
'file': '',
'line': '0',
'method': method,
'method': frame.member,
});
}
} else {
Expand Down
Expand Up @@ -266,7 +266,7 @@ void main() {
expect(elements.length, 1);
expect(elements.first, <String, String>{
'method':
' #00 abs 0 virt 00000000001af27b _kDartIsolateSnapshotInstructions+0x1a127b',
' #00 abs 000075f17833027b virt 00000000001af27b _kDartIsolateSnapshotInstructions+0x1a127b',
'file': '',
'line': '0',
});
Expand All @@ -286,7 +286,8 @@ void main() {
final List<Map<String, String>> elements = getStackTraceElements(trace);
expect(elements.length, 1);
expect(elements.first, <String, String>{
'method': ' #00 abs 0 _kDartIsolateSnapshotInstructions+0x1a127b',
'method':
' #00 abs 000075f17833027b _kDartIsolateSnapshotInstructions+0x1a127b',
'file': '',
'line': '0',
});
Expand Down

0 comments on commit a4fa7ef

Please sign in to comment.