Skip to content

Commit

Permalink
refactor: update ProGuard rules for Firebase integration
Browse files Browse the repository at this point in the history
  • Loading branch information
sharjeelyunus committed Jan 3, 2025
1 parent afadc49 commit ab29a7b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions starter/scripts/constants.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const authProguardRules = '''
# Keep Google Play Services Auth classes
const firebaseProguardRules = '''
# Keep Google Play Services classes
-keep class com.google.android.gms.** { *; }
-keep interface com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**
Expand Down
3 changes: 3 additions & 0 deletions starter/scripts/firebase_performance.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'dart:io';

import 'utils.dart';
import 'utils/firebase_utils.dart';
import 'utils/proguard_utils.dart';
import 'constants.dart';

// Adds the Firebase Performance SDK to the project
void main(List<String> arguments) {
Expand All @@ -11,6 +13,7 @@ void main(List<String> arguments) {
addDependency('firebase_performance', '^0.10.0+11');

if (platforms.contains('android')) {
createProguardRules(firebaseProguardRules);
addClasspathDependency(
"classpath 'com.google.firebase:perf-plugin:1.4.2'");
addPluginDependency("apply plugin: 'com.google.firebase.firebase-perf'");
Expand Down
2 changes: 1 addition & 1 deletion starter/scripts/modules/enable_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ ensemble_auth:
updateAuthConfig(iOSClientId, androidClientId, webClientId, serverClientId);
updateFirebaseConfig(platforms, arguments);
if (platforms.contains('android')) {
createProguardRules(authProguardRules);
createProguardRules(firebaseProguardRules);
addClasspathDependency(
"classpath 'com.google.gms:google-services:4.3.15'");
addPluginDependency("apply plugin: 'com.google.gms.google-services'");
Expand Down

0 comments on commit ab29a7b

Please sign in to comment.