Skip to content

Commit

Permalink
Include and set ProGuard uuid in Flutter Options (#1312)
Browse files Browse the repository at this point in the history
Co-authored-by: Manoel Aranda Neto <marandaneto@gmail.com>
  • Loading branch information
Wcisang and marandaneto committed Mar 6, 2023
1 parent b49bf00 commit 90db9ff
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Features

- Add proguard_uui property to SentryFlutterOptions to set proguard information at runtime ([#1312](https://github.com/getsentry/sentry-dart/pull/1312))

### Fixes

- Change podspec `EXCLUDED_ARCHS` value to allow podfiles to add more excluded architetures ([#1303](https://github.com/getsentry/sentry-dart/pull/1303))
Expand Down
Expand Up @@ -145,6 +145,7 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
args.getIfNotNull<Boolean>("anrEnabled") { options.isAnrEnabled = it }
args.getIfNotNull<Boolean>("sendDefaultPii") { options.isSendDefaultPii = it }
args.getIfNotNull<Boolean>("enableNdkScopeSync") { options.isEnableScopeSync = it }
args.getIfNotNull<String>("proguardUuid") { options.proguardUuid = it }

val nativeCrashHandling = (args["enableNativeCrashHandling"] as? Boolean) ?: true
// nativeCrashHandling has priority over anrEnabled
Expand Down
1 change: 1 addition & 0 deletions flutter/config/detekt-bl.xml
Expand Up @@ -3,6 +3,7 @@
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues>
<ID>ComplexMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$override fun onMethodCall(call: MethodCall, result: Result)</ID>
<ID>LongMethod:SentryFlutterPlugin.kt$SentryFlutterPlugin$private fun initNativeSdk(call: MethodCall, result: Result)</ID>
<ID>MagicNumber:MainActivity.kt$MainActivity$6_000</ID>
<ID>TooGenericExceptionCaught:MainActivity.kt$MainActivity$e: Exception</ID>
<ID>TooGenericExceptionThrown:MainActivity.kt$MainActivity$throw Exception("Catch this java exception thrown from Kotlin thread!")</ID>
Expand Down
1 change: 1 addition & 0 deletions flutter/lib/src/integrations/native_sdk_integration.dart
Expand Up @@ -44,6 +44,7 @@ class NativeSdkIntegration extends Integration<SentryFlutterOptions> {
'enableNdkScopeSync': options.enableNdkScopeSync,
'enableAutoPerformanceTracking': options.enableAutoPerformanceTracking,
'sendClientReports': options.sendClientReports,
'proguardUuid': options.proguardUuid,
});

options.sdk.addIntegration('nativeSdkIntegration');
Expand Down
3 changes: 3 additions & 0 deletions flutter/lib/src/sentry_flutter_options.dart
Expand Up @@ -202,6 +202,9 @@ class SentryFlutterOptions extends SentryOptions {
/// runApp(SentryUserInteractionWidget(child: App()));
bool enableUserInteractionTracing = false;

/// Sets the Proguard uuid for Android platform.
String? proguardUuid;

@internal
late RendererWrapper rendererWrapper = RendererWrapper();

Expand Down
Expand Up @@ -55,7 +55,8 @@ void main() {
'enableOutOfMemoryTracking': true,
'enableNdkScopeSync': false,
'enableAutoPerformanceTracking': true,
'sendClientReports': true
'sendClientReports': true,
'proguardUuid': null
});
});

Expand Down Expand Up @@ -88,7 +89,8 @@ void main() {
..enableOutOfMemoryTracking = false
..enableNdkScopeSync = true
..enableAutoPerformanceTracking = false
..sendClientReports = false;
..sendClientReports = false
..proguardUuid = fakeProguardUuid;

options.sdk.addIntegration('foo');
options.sdk.addPackage('bar', '1');
Expand Down Expand Up @@ -124,7 +126,8 @@ void main() {
'enableOutOfMemoryTracking': false,
'enableNdkScopeSync': true,
'enableAutoPerformanceTracking': false,
'sendClientReports': false
'sendClientReports': false,
'proguardUuid': fakeProguardUuid
});
});

Expand Down
1 change: 1 addition & 0 deletions flutter/test/mocks.dart
Expand Up @@ -17,6 +17,7 @@ import 'mocks.mocks.dart';
import 'no_such_method_provider.dart';

const fakeDsn = 'https://abc@def.ingest.sentry.io/1234567';
const fakeProguardUuid = '3457d982-65ef-576d-a6ad-65b5f30f49a5';

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

0 comments on commit 90db9ff

Please sign in to comment.