Skip to content

Commit

Permalink
Games: Add initial basic support for Play Games
Browse files Browse the repository at this point in the history
This puts the base to allow apps that allow/require sign in with Google Play Games to work.
Note that as the Play Games companion app is not functional (yet), many features of Play Games remain unusable.
  • Loading branch information
mar-v-in committed Sep 11, 2023
1 parent 046218e commit 40269ab
Show file tree
Hide file tree
Showing 80 changed files with 3,707 additions and 433 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

package com.google.android.gms.auth.api.signin;

import androidx.annotation.NonNull;
import org.microg.gms.common.Hide;
import org.microg.gms.utils.ToStringHelper;
import org.microg.safeparcel.AutoSafeParcelable;

@Hide
Expand All @@ -17,5 +19,11 @@ public class SignInAccount extends AutoSafeParcelable {
@Field(8)
public String userId;

@NonNull
@Override
public String toString() {
return ToStringHelper.name("SignInAccount").field("email", email).field("account", googleSignInAccount).field("userId", userId).end();
}

public static final Creator<SignInAccount> CREATOR = findCreator(SignInAccount.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

package com.google.android.gms.auth.api.signin.internal;

import androidx.annotation.NonNull;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import org.microg.gms.common.Hide;
import org.microg.gms.utils.ToStringHelper;
import org.microg.safeparcel.AutoSafeParcelable;

@Hide
Expand All @@ -16,5 +18,11 @@ public class SignInConfiguration extends AutoSafeParcelable {
@Field(5)
public GoogleSignInOptions options;

@NonNull
@Override
public String toString() {
return ToStringHelper.name("SignInConfiguration").field("packageName", packageName).field("options", options).end();
}

public static final Creator<SignInConfiguration> CREATOR = findCreator(SignInConfiguration.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
import android.util.Log;

import com.google.android.gms.common.api.Scope;
import com.google.android.gms.common.internal.GetServiceRequest;
import com.google.android.gms.common.internal.IGmsCallbacks;
import com.google.android.gms.common.internal.IGmsServiceBroker;
import com.google.android.gms.common.internal.ValidateAccountRequest;
import com.google.android.gms.common.internal.*;

import org.microg.gms.common.GmsService;

Expand Down Expand Up @@ -108,7 +105,7 @@ public void getGamesService(IGmsCallbacks callback, int versionCode, String pack
Bundle extras = params == null ? new Bundle() : params;
extras.putString("com.google.android.gms.games.key.gamePackageName", gamePackageName);
extras.putString("com.google.android.gms.games.key.desiredLocale", desiredLocale);
//extras.putParcelable("com.google.android.gms.games.key.popupWindowToken", popupWindowToken);
extras.putParcelable("com.google.android.gms.games.key.popupWindowToken", new BinderWrapper(popupWindowToken));
callGetService(GmsService.GAMES, callback, versionCode, packageName, extras, accountName, scopes);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ interface ISignInCallbacks {
void onRecordConsent(in Status status) = 5;
void onCurrentAccount(in Status status, in GoogleSignInAccount account) = 6;
void onSignIn(in SignInResponse response) = 7;
void onRecrodConsentByConsent(in RecordConsentByConsentResultResponse response) = 8;
void onRecordConsentByConsent(in RecordConsentByConsentResultResponse response) = 8;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.json.JSONObject;
import org.microg.gms.auth.AuthConstants;
import org.microg.gms.common.Hide;
import org.microg.gms.utils.ToStringHelper;
import org.microg.safeparcel.AutoSafeParcelable;

import java.util.ArrayList;
Expand Down Expand Up @@ -260,5 +261,22 @@ public int hashCode() {
return (obfuscatedIdentifier.hashCode() + 527) * 31 + getGrantedScopes().hashCode();
}

@NonNull
@Override
public String toString() {
return ToStringHelper.name("GoogleSignInAccount")
.field("id", id)
.field("tokenId", tokenId)
.field("email", email)
.field("displayName", displayName)
.field("givenName", givenName)
.field("familyName", familyName)
.field("photoUrl", photoUrl)
.field("serverAuthCode", serverAuthCode)
.field("expirationTime", expirationTime)
.field("obfuscatedIdentifier", obfuscatedIdentifier)
.end();
}

public static final Creator<GoogleSignInAccount> CREATOR = new AutoCreator<>(GoogleSignInAccount.class);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.json.JSONObject;
import org.microg.gms.auth.AuthConstants;
import org.microg.gms.common.Hide;
import org.microg.gms.utils.ToStringHelper;
import org.microg.safeparcel.AutoSafeParcelable;

import java.util.*;
Expand Down Expand Up @@ -357,5 +358,19 @@ public String toJson() {
}
}

@NonNull
@Override
public String toString() {
return ToStringHelper.name("GoogleSignInOptions")
.field("scopes", scopes)
.field("account", account)
.field("idTokenRequested", idTokenRequested)
.field("forceCodeForRefreshToken", forceCodeForRefreshToken)
.field("serverAuthCodeRequested", serverAuthCodeRequested)
.field("serverClientId", serverClientId)
.field("hostedDomain", hostedDomain)
.end();
}

public static final Creator<GoogleSignInOptions> CREATOR = findCreator(GoogleSignInOptions.class);
}
Loading

1 comment on commit 40269ab

@farline99
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wwoohoooh! 🎉
You are incredible ❤️

Please sign in to comment.