-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproguard.cfg
116 lines (91 loc) · 5.65 KB
/
proguard.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
-printconfiguration config_navigation.txt
-printseeds seeds.txt
-printusage usage.txt
#usage.txt - this file contains the code that was removed or unused code from the apk
#seeds.txt - this file has a list of classes and class members which were not removed according to your keep rules
#mappings.txt - this file provides the translation between the original and the obfuscated classes, methods, field names. Not applicable to xamarin, because we don't obfuscate. However required by Google Play see notes at end
# Added 20/06/2021 To upload a mapping.txt file
#Open the Play Console.
#Select an app.
#On the left menu, select Release > App bundle explorer.
#Select the Downloads tab, and scroll down to the 'Assets' section. Click the upload arrow for the mapping file or the debug symbols as applicable to upload the deobfuscation for the version of your app.
# Added these 3 13/01/2021
-printmapping mapping.txt
-keepattributes SourceFile
-keepattributes LineNumberTable
# remember to change back the build Action in the Properities Window to ProguardConfiguration if you ever exclude the proguard.cfg from the project,
# as it will come back as none if you do not which means this file wont be read.
#-keepattributes *Annotations*
-keep class androidx.appcompat.widget.FitWindowsLinearLayout
-keep class androidx.constraintlayout.widget.ConstraintLayout
# added these 4 after completing all the AppCompat.DialogFragments
-keep class androidx.appcompat.widget.FitWindowsFrameLayout
-keep class androidx.appcompat.widget.AlertDialogLayout
-keep class androidx.appcompat.widget.DialogTitle
-keep class androidx.appcompat.widget.ButtonBarLayout
# added this after changing to Android 10 (Q)
-keep class androidx.preference.internal.PreferenceImageView
# added after adding Connectivity.Monitor which optionally calls SnackBar
-keep class com.google.android.material.snackbar.Snackbar$SnackbarLayout
# Added the following for GoogleSignIn
-keep class com.google.firebase.provider.FirebaseInitProvider
# the line below fixed user.IsEmailVerified - this was the only way I found to fix this. I thought with this line then you wouldn't need the two above.
# What is so special about IsEmailVerified as compared to Email or DisplayName - string vs bool?
-keep class com.google.firebase.** { *; }
# didn't need this previously (yesterday 07/06/20) and now we do!!! Bloody proguard...
-keep class com.google.android.gms.common.SignInButton
-keep class com.google.android.gms.auth.api.signin.GoogleSignInOptions { *; }
-keep class com.google.android.gms.auth.api.signin.internal.SignInHubActivity {*; }
#test trying to resolve runtime exception in release build 1.23 13/01/2021 - Fixed in 1.24
-keep class com.google.android.gms.internal.** { *; }
#Crashed added this - fixed it. Tried to comment again and it was ok. So don't need this. Should have uninstalled, clean, build and deploy instead. All because I changed
#the hard coded string Google Sign In in the xml to @string/google_sign_-in. VS build is so flaky
#Went back to VS 16.6.2 and it crashed again so had to add it in again.
-keep class com.google.android.material.internal.BaselineLayout
# 18/11/2020 Added for Build 120 after completed billing
-keep class androidx.core.app.CoreComponentFactory
-keep class com.android.billingclient.api.ProxyBillingActivity
# 20/04/2022 Below was an attempt to fix java.lang.IllegalArgumentException: No @Navigator.Name annotation found for NavGraphNavigator. didn't help
#-keep class androidx.navigation.NavigatorProvider.Class.Name
#-keep class androidx.navigation.NavigatorProvider { *; }
# 26/04/2022 This fixed it #6928 xamarin.android github
# java.lang.IllegalArgumentException: No @Navigator.Name annotation found for NavGraphNavigator
-keepattributes RuntimeVisibleAnnotations
-keep class * extends androidx.navigation.Navigator
#-keep class androidx.navigation.fragment.NavHostFragment
#-keep class androidx.navigation.NavHostController
#-keep class androidx.fragment.app.FragmentContainerView
# attempt to solve the crash because of missing SubscriptionCancelSurveyResult ctor
#-keep class Google.Apis.AndroidPublisher.v3.Data.SubscriptionCancelSurveyResult - never going to work as it is C# code
# Issue 5304 test if we require
#-keepattributes SourceFile - already done above
#-keepattributes LineNumberTable
#When uploading a package to the Google Play Store users are seeing
#the following warning.
#This App Bundle contains Java/Kotlin code, which might be obfuscated.
#To fix this users need to provide a mapping.txt file which contains
#the Java class mappings from their plain versions to the ones which
#are obfuscated. By default we do not obfuscate the java code but the
#warning still shows.
#To fix this issue we have a new property $(AndroidProguardMappingFile)
#which defaults to $(OutputPath)mapping.txt. This file will be produced
#as part of the build process. In order for this mapping file to be
#generated the following lines needed to be added to the proguard_xamarin.cfg
#file.
#-keepattributes SourceFile
#-keepattributes LineNumberTable
# what is screwing up r8 .
#@NonNull
# static String getNameForNavigator(@NonNull Class<? extends Navigator> navigatorClass) {
# String name = sAnnotationNames.get(navigatorClass);
# if (name == null) {
# Navigator.Name annotation = navigatorClass.getAnnotation(Navigator.Name.class);
# name = annotation != null ? annotation.value() : null;
# if (!validateName(name)) {
# throw new IllegalArgumentException("No @Navigator.Name annotation found for "
# + navigatorClass.getSimpleName());
# }
# sAnnotationNames.put(navigatorClass, name);
# }
# return name;
# }