21 lines
731 B
Dart
21 lines
731 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
test('release builds keep the plugin code called through JNI', () {
|
|
// Without these rules R8 strips shared_preferences' JNI targets and a
|
|
// release phone loses every saved setting, sign-in and draft.
|
|
final gradle = File('android/app/build.gradle.kts').readAsStringSync();
|
|
final rules = File('android/app/proguard-rules.pro').readAsStringSync();
|
|
expect(gradle, contains('"proguard-rules.pro"'));
|
|
for (final rule in [
|
|
'-keep class io.flutter.plugins.** { *; }',
|
|
'-keep class com.github.dart_lang.jni.** { *; }',
|
|
'-keep class kotlin.** { *; }',
|
|
]) {
|
|
expect(rules, contains(rule));
|
|
}
|
|
});
|
|
}
|