Skip to content

Commit

Permalink
Game archive, ranking, and achievement functions are implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
DaVinci9196 committed Aug 13, 2024
1 parent a77ccf5 commit c43a801
Show file tree
Hide file tree
Showing 128 changed files with 10,052 additions and 82 deletions.
2 changes: 2 additions & 0 deletions play-services-auth-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@ dependencies {
api project(':play-services-basement')
api project(':play-services-base')
api project(':play-services-tasks')

annotationProcessor project(':safe-parcel-processor')
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth;

parcelable TokenData;
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth;

import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;

import com.google.android.auth.IAuthManagerService;

import java.util.Objects;

public class AccessAccountDataBinder implements DataBinder<Boolean> {

private final String clientPackageName;

public AccessAccountDataBinder(String clientPackageName) {
this.clientPackageName = clientPackageName;
}

@Override
public Boolean getBinderData(IBinder iBinder) throws Exception {
IAuthManagerService service;
if (iBinder == null) {
service = null;
} else {
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.auth.IAuthManagerService");
if (queryLocalInterface instanceof IAuthManagerService) {
service = (IAuthManagerService) queryLocalInterface;
} else {
service = IAuthManagerService.Stub.asInterface(iBinder);
}
}
if (service == null) {
return null;
}
Bundle bundle = service.requestGoogleAccountsAccess(clientPackageName);
if (bundle == null) {
return false;
}
return Objects.equals(bundle.getString("Error"), "OK");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public Account getAccount() {
return null;
}

@Constructor
public AccountChangeEventsRequest(@Param(value = 1) int versionCode, @Param(value = 2) int since, @Param(value = 3) String accountName, @Param(value = 4) Account account) {
this.versionCode = versionCode;
this.since = since;
this.accountName = accountName;
this.account = account;
}

public static Creator<AccountChangeEventsRequest> CREATOR = new AutoCreator<AccountChangeEventsRequest>(AccountChangeEventsRequest.class);

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ public class AccountChangeEventsResponse extends AutoSafeParcelable {
@SafeParceled(value = 2, subClass = AccountChangeEvent.class)
private List<AccountChangeEvent> events;

public List<AccountChangeEvent> getEvents() {
return events;
}

public AccountChangeEventsResponse() {
events = new ArrayList<AccountChangeEvent>();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth;

import android.accounts.Account;
import android.os.IBinder;
import android.os.IInterface;

import com.google.android.auth.IAuthManagerService;

import java.util.List;

public class ChangeEventDataBinder implements DataBinder<List<AccountChangeEvent>> {

private final String accountName;
private final int since;

public ChangeEventDataBinder(String accountName, int since) {
this.accountName = accountName;
this.since = since;
}

@Override
public List<AccountChangeEvent> getBinderData(IBinder iBinder) throws Exception {
IAuthManagerService service;
if (iBinder == null) {
service = null;
} else {
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.auth.IAuthManagerService");
if (queryLocalInterface instanceof IAuthManagerService) {
service = (IAuthManagerService) queryLocalInterface;
} else {
service = IAuthManagerService.Stub.asInterface(iBinder);
}
}
if (service == null) {
return null;
}
AccountChangeEventsRequest request = new AccountChangeEventsRequest(1, since, accountName, new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE));
AccountChangeEventsResponse changeEvents = service.getChangeEvents(request);
return changeEvents.getEvents();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth;

import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;

import com.google.android.auth.IAuthManagerService;

public class ClearTokenDataBinder implements DataBinder<Void> {

private final String token;
private final Bundle extras;

public ClearTokenDataBinder(String token, Bundle extras) {
this.token = token;
this.extras = extras;
}

@Override
public Void getBinderData(IBinder iBinder) throws Exception {
IAuthManagerService service;
if (iBinder == null) {
service = null;
} else {
IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.auth.IAuthManagerService");
if (queryLocalInterface instanceof IAuthManagerService) {
service = (IAuthManagerService) queryLocalInterface;
} else {
service = IAuthManagerService.Stub.asInterface(iBinder);
}
}
if (service == null) {
return null;
}
service.clearToken(token, extras);
return Void.TYPE.newInstance();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth;

import android.os.IBinder;

public interface DataBinder<T> {
T getBinderData(IBinder iBinder) throws Exception;
}
Loading

0 comments on commit c43a801

Please sign in to comment.