Skip to content

Commit a9b85e9

Browse files
authored
Merge pull request #173 from immutable/fix/android-proguard
[DX-2700] fix: android login and connect pkce not working if minify is enabled in sample app
2 parents 5dce7cf + 183b45d commit a9b85e9

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
-dontwarn com.immutable.**
2+
-keep class com.immutable.** { *; }
3+
-keep interface com.immutable.** { *; }
4+
5+
-dontwarn androidx.**
6+
-keep class androidx.** { *; }
7+
-keep interface androidx.** { *; }

sample/Assets/Plugins/Android/proguard-user.txt.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sample/Assets/Scripts/UnauthenticatedScript.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ public async void Login()
102102
{
103103
error = $"Login() error: {ex.Message}";
104104
// Restart everything
105+
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
105106
await passport.Logout();
107+
#else
108+
await passport.LogoutPKCE();
109+
#endif
106110
}
107111

108112
Debug.Log(error);
@@ -169,7 +173,11 @@ public async void Connect()
169173
{
170174
error = $"Connect() error: {ex.Message}";
171175
// Restart everything
176+
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
172177
await passport.Logout();
178+
#else
179+
await passport.LogoutPKCE();
180+
#endif
173181
}
174182

175183
Debug.Log(error);

sample/ProjectSettings/ProjectSettings.asset

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ PlayerSettings:
245245
useCustomLauncherGradleManifest: 0
246246
useCustomBaseGradleTemplate: 0
247247
useCustomGradlePropertiesTemplate: 0
248-
useCustomProguardFile: 0
248+
useCustomProguardFile: 1
249249
AndroidTargetArchitectures: 2
250250
AndroidTargetDevices: 0
251251
AndroidSplashScreenScale: 0

0 commit comments

Comments
 (0)