Skip to content

Commit a4fa7ef

Browse files
authored
fix(crashlytics, ios): fix Crashlytics obfuscation for iOS on the Flutter side (#10566)
1 parent 8bdd2c0 commit a4fa7ef

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

packages/firebase_crashlytics/firebase_crashlytics/lib/src/utils.dart

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,13 @@ List<Map<String, String>> getStackTraceElements(StackTrace stackTrace) {
2020
// Crashlytics Console groups issues with same stack trace.
2121
// Obfuscated stack traces contains abs address, virt address
2222
// and symbol name + offset. abs addresses are different across
23-
// sessions, so same error can create different issues in Console.
24-
// We replace abs address with '0' so that Crashlytics Console can
25-
// group same exceptions. Also we don't need abs addresses for
26-
// deobfuscating, if we have virt address or symbol name + offset.
27-
final String method = frame.member.replaceFirstMapped(
28-
_obfuscatedStackTraceLineRegExp,
29-
(match) => '${match.group(1)}0${match.group(3)}');
23+
// sessions, Crashlytics is smart enough to group exceptions
24+
// in the same issue. For iOS we use abs address for symbolication
25+
// and for Android we use virt address.
3026
elements.add(<String, String>{
3127
'file': '',
3228
'line': '0',
33-
'method': method,
29+
'method': frame.member,
3430
});
3531
}
3632
} else {

packages/firebase_crashlytics/firebase_crashlytics/test/firebase_crashlytics_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ void main() {
266266
expect(elements.length, 1);
267267
expect(elements.first, <String, String>{
268268
'method':
269-
' #00 abs 0 virt 00000000001af27b _kDartIsolateSnapshotInstructions+0x1a127b',
269+
' #00 abs 000075f17833027b virt 00000000001af27b _kDartIsolateSnapshotInstructions+0x1a127b',
270270
'file': '',
271271
'line': '0',
272272
});
@@ -286,7 +286,8 @@ void main() {
286286
final List<Map<String, String>> elements = getStackTraceElements(trace);
287287
expect(elements.length, 1);
288288
expect(elements.first, <String, String>{
289-
'method': ' #00 abs 0 _kDartIsolateSnapshotInstructions+0x1a127b',
289+
'method':
290+
' #00 abs 000075f17833027b _kDartIsolateSnapshotInstructions+0x1a127b',
290291
'file': '',
291292
'line': '0',
292293
});

0 commit comments

Comments
 (0)