Skip to content

[DX-2700] fix: android login and connect pkce not working if minify is enabled in sample app #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sample/Assets/Plugins/Android/proguard-user.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-dontwarn com.immutable.**
-keep class com.immutable.** { *; }
-keep interface com.immutable.** { *; }

-dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }
7 changes: 7 additions & 0 deletions sample/Assets/Plugins/Android/proguard-user.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions sample/Assets/Scripts/UnauthenticatedScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ public async void Login()
{
error = $"Login() error: {ex.Message}";
// Restart everything
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
await passport.Logout();
#else
await passport.LogoutPKCE();
#endif
}

Debug.Log(error);
Expand Down Expand Up @@ -169,7 +173,11 @@ public async void Connect()
{
error = $"Connect() error: {ex.Message}";
// Restart everything
#if (UNITY_ANDROID && !UNITY_EDITOR_WIN) || (UNITY_IPHONE && !UNITY_EDITOR_WIN) || UNITY_STANDALONE_OSX
await passport.Logout();
#else
await passport.LogoutPKCE();
#endif
}

Debug.Log(error);
Expand Down
2 changes: 1 addition & 1 deletion sample/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ PlayerSettings:
useCustomLauncherGradleManifest: 0
useCustomBaseGradleTemplate: 0
useCustomGradlePropertiesTemplate: 0
useCustomProguardFile: 0
useCustomProguardFile: 1
AndroidTargetArchitectures: 2
AndroidTargetDevices: 0
AndroidSplashScreenScale: 0
Expand Down