Skip to content
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

SilentSignIn: Fixed games cannot be logged in #2582

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.microg.gms.auth.signin

import android.accounts.Account
import android.accounts.AccountManager
import android.content.Context
import android.os.Bundle
import android.os.Parcel
Expand All @@ -37,6 +38,7 @@ import com.google.android.gms.common.internal.ConnectionInfo
import com.google.android.gms.common.internal.GetServiceRequest
import com.google.android.gms.common.internal.IGmsCallbacks
import org.microg.gms.BaseService
import org.microg.gms.auth.AuthConstants
import org.microg.gms.auth.AuthPrefs
import org.microg.gms.common.GmsService
import org.microg.gms.common.PackageUtils
Expand Down Expand Up @@ -77,10 +79,14 @@ class AuthSignInServiceImpl(
}
lifecycleScope.launchWhenStarted {
try {
val account = account ?: options?.account ?: SignInConfigurationService.getDefaultAccount(context, packageName)
if (account != null && options?.isForceCodeForRefreshToken != true && options?.includeUnacceptableScope != true) {
val account = account
?: options?.account
?: SignInConfigurationService.getDefaultAccount(context, packageName)
?: AccountManager.get(context).getAccountsByType(AuthConstants.DEFAULT_ACCOUNT_TYPE).firstOrNull()
Log.d(TAG, "silentSignIn: account -> ${account?.name}")
if (account != null && options?.isForceCodeForRefreshToken != true) {
if (getOAuthManager(context, packageName, options, account).isPermitted || AuthPrefs.isTrustGooglePermitted(context)) {
val googleSignInAccount = performSignIn(context, packageName, options, account)
val googleSignInAccount = performSignIn(context, packageName, options, account, true)
if (googleSignInAccount != null) {
sendResult(googleSignInAccount, Status(CommonStatusCodes.SUCCESS))
} else {
Expand Down