Skip to content

Commit 90db9ff

Browse files
Wcisangmarandaneto
andauthored
Include and set ProGuard uuid in Flutter Options (#1312)
Co-authored-by: Manoel Aranda Neto <[email protected]>
1 parent b49bf00 commit 90db9ff

File tree

7 files changed

+17
-3
lines changed

7 files changed

+17
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- Add proguard_uui property to SentryFlutterOptions to set proguard information at runtime ([#1312](https://github.com/getsentry/sentry-dart/pull/1312))
8+
59
### Fixes
610

711
- Change podspec `EXCLUDED_ARCHS` value to allow podfiles to add more excluded architetures ([#1303](https://github.com/getsentry/sentry-dart/pull/1303))

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
145145
args.getIfNotNull<Boolean>("anrEnabled") { options.isAnrEnabled = it }
146146
args.getIfNotNull<Boolean>("sendDefaultPii") { options.isSendDefaultPii = it }
147147
args.getIfNotNull<Boolean>("enableNdkScopeSync") { options.isEnableScopeSync = it }
148+
args.getIfNotNull<String>("proguardUuid") { options.proguardUuid = it }
148149

149150
val nativeCrashHandling = (args["enableNativeCrashHandling"] as? Boolean) ?: true
150151
// nativeCrashHandling has priority over anrEnabled

flutter/config/detekt-bl.xml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<ManuallySuppressedIssues></ManuallySuppressedIssues>
44
<CurrentIssues>
55
<ID>ComplexMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$override fun onMethodCall(call: MethodCall, result: Result)</ID>
6+
<ID>LongMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$private fun initNativeSdk(call: MethodCall, result: Result)</ID>
67
<ID>MagicNumber:MainActivity.kt$MainActivity$6_000</ID>
78
<ID>TooGenericExceptionCaught:MainActivity.kt$MainActivity$e: Exception</ID>
89
<ID>TooGenericExceptionThrown:MainActivity.kt$MainActivity$throw Exception("Catch this java exception thrown from Kotlin thread!")</ID>

flutter/lib/src/integrations/native_sdk_integration.dart

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ class NativeSdkIntegration extends Integration<SentryFlutterOptions> {
4444
'enableNdkScopeSync': options.enableNdkScopeSync,
4545
'enableAutoPerformanceTracking': options.enableAutoPerformanceTracking,
4646
'sendClientReports': options.sendClientReports,
47+
'proguardUuid': options.proguardUuid,
4748
});
4849

4950
options.sdk.addIntegration('nativeSdkIntegration');

flutter/lib/src/sentry_flutter_options.dart

+3
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@ class SentryFlutterOptions extends SentryOptions {
202202
/// runApp(SentryUserInteractionWidget(child: App()));
203203
bool enableUserInteractionTracing = false;
204204

205+
/// Sets the Proguard uuid for Android platform.
206+
String? proguardUuid;
207+
205208
@internal
206209
late RendererWrapper rendererWrapper = RendererWrapper();
207210

flutter/test/integrations/init_native_sdk_integration_test.dart

+6-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ void main() {
5555
'enableOutOfMemoryTracking': true,
5656
'enableNdkScopeSync': false,
5757
'enableAutoPerformanceTracking': true,
58-
'sendClientReports': true
58+
'sendClientReports': true,
59+
'proguardUuid': null
5960
});
6061
});
6162

@@ -88,7 +89,8 @@ void main() {
8889
..enableOutOfMemoryTracking = false
8990
..enableNdkScopeSync = true
9091
..enableAutoPerformanceTracking = false
91-
..sendClientReports = false;
92+
..sendClientReports = false
93+
..proguardUuid = fakeProguardUuid;
9294

9395
options.sdk.addIntegration('foo');
9496
options.sdk.addPackage('bar', '1');
@@ -124,7 +126,8 @@ void main() {
124126
'enableOutOfMemoryTracking': false,
125127
'enableNdkScopeSync': true,
126128
'enableAutoPerformanceTracking': false,
127-
'sendClientReports': false
129+
'sendClientReports': false,
130+
'proguardUuid': fakeProguardUuid
128131
});
129132
});
130133

flutter/test/mocks.dart

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import 'mocks.mocks.dart';
1717
import 'no_such_method_provider.dart';
1818

1919
const fakeDsn = 'https://[email protected]/1234567';
20+
const fakeProguardUuid = '3457d982-65ef-576d-a6ad-65b5f30f49a5';
2021

2122
// https://github.com/dart-lang/mockito/blob/master/NULL_SAFETY_README.md#fallback-generators
2223
ISentrySpan startTransactionShim(

0 commit comments

Comments
 (0)