Auth: Forward UID/PID from IAuthManagerService.getTokenWithAccount 4a7bac35f8
This commit is contained in:
parent
ebb9f2d54e
commit
f933a77f3f
5 changed files with 40 additions and 22 deletions
|
|
@ -7,7 +7,7 @@ import com.google.android.gms.auth.AccountChangeEventsResponse;
|
|||
import com.google.android.gms.auth.AccountChangeEventsRequest;
|
||||
import com.google.android.gms.auth.GetHubTokenRequest;
|
||||
import com.google.android.gms.auth.GetHubTokenInternalResponse;
|
||||
import com.google.android.gms.auth.HasCababilitiesRequest;
|
||||
import com.google.android.gms.auth.HasCapabilitiesRequest;
|
||||
|
||||
interface IAuthManagerService {
|
||||
Bundle getToken(String accountName, String scope, in Bundle extras) = 0;
|
||||
|
|
@ -18,6 +18,6 @@ interface IAuthManagerService {
|
|||
Bundle getAccounts(in Bundle extras) = 5;
|
||||
Bundle removeAccount(in Account account) = 6;
|
||||
Bundle requestGoogleAccountsAccess(String packageName) = 7;
|
||||
int hasCapabilities(in HasCababilitiesRequest request) = 8;
|
||||
int hasCapabilities(in HasCapabilitiesRequest request) = 8;
|
||||
GetHubTokenInternalResponse getHubToken(in GetHubTokenRequest request, in Bundle extras) = 9;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.auth;
|
||||
|
||||
parcelable HasCapabilitiesRequest;
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.auth;
|
||||
|
||||
import android.accounts.Account;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
public class HasCababilitiesRequest extends AutoSafeParcelable {
|
||||
@Field(1)
|
||||
public Account account;
|
||||
public static final Creator<HasCababilitiesRequest> CREATOR = new AutoCreator<>(HasCababilitiesRequest.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.auth;
|
||||
|
||||
import android.accounts.Account;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
|
||||
public class HasCapabilitiesRequest extends AutoSafeParcelable {
|
||||
@Field(1)
|
||||
public Account account;
|
||||
<<<<<<< HEAD:play-services-api/src/main/java/com/google/android/gms/auth/HasCababilitiesRequest.java
|
||||
public static final Creator<HasCababilitiesRequest> CREATOR = new AutoCreator<>(HasCababilitiesRequest.class);
|
||||
=======
|
||||
@Field(2)
|
||||
public String[] capabilities;
|
||||
public static final Creator<HasCapabilitiesRequest> CREATOR = new AutoCreator<>(HasCapabilitiesRequest.class);
|
||||
>>>>>>> d04e2718 (Auth: Forward UID/PID from IAuthManagerService.getTokenWithAccount https://github.com/microg/GmsCore/commit/4a7bac35f8eeb1bb3cb1607dc03b439b819abe40):play-services-api/src/main/java/com/google/android/gms/auth/HasCapabilitiesRequest.java
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ import com.google.android.gms.auth.AccountChangeEventsRequest;
|
|||
import com.google.android.gms.auth.AccountChangeEventsResponse;
|
||||
import com.google.android.gms.auth.GetHubTokenInternalResponse;
|
||||
import com.google.android.gms.auth.GetHubTokenRequest;
|
||||
import com.google.android.gms.auth.HasCababilitiesRequest;
|
||||
import com.google.android.gms.auth.HasCapabilitiesRequest;
|
||||
import com.google.android.gms.auth.TokenData;
|
||||
import com.google.android.gms.common.api.Scope;
|
||||
|
||||
|
|
@ -68,6 +68,8 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub {
|
|||
public static final String KEY_REQUEST_VISIBLE_ACTIVITIES = "request_visible_actions";
|
||||
public static final String KEY_SUPPRESS_PROGRESS_SCREEN = "suppressProgressScreen";
|
||||
public static final String KEY_SYNC_EXTRAS = "sync_extras";
|
||||
public static final String KEY_DELEGATION_TYPE = "delegation_type";
|
||||
public static final String KEY_DELEGATEE_USER_ID = "delegatee_user_id";
|
||||
|
||||
public static final String KEY_ERROR = "Error";
|
||||
|
||||
|
|
@ -113,7 +115,8 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub {
|
|||
packageName = PackageUtils.getAndCheckCallingPackage(context, packageName, extras.getInt(KEY_CALLER_UID, 0), extras.getInt(KEY_CALLER_PID, 0));
|
||||
boolean notify = extras.getBoolean(KEY_HANDLE_NOTIFICATION, false);
|
||||
|
||||
Log.d(TAG, "getToken: account:" + account.name + " scope:" + scope + " extras:" + extras + ", notify: " + notify);
|
||||
if (!AuthConstants.SCOPE_GET_ACCOUNT_ID.equals(scope))
|
||||
Log.d(TAG, "getToken: account:" + account.name + " scope:" + scope + " extras:" + extras + ", notify: " + notify);
|
||||
|
||||
/*
|
||||
* TODO: This scope seems to be invalid (according to https://developers.google.com/oauthplayground/),
|
||||
|
|
@ -196,7 +199,12 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub {
|
|||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public int hasCapabilities(HasCababilitiesRequest request) {
|
||||
=======
|
||||
public int hasCapabilities(HasCapabilitiesRequest request) throws RemoteException {
|
||||
Log.w(TAG, "Not implemented: hasCapabilities(" + request.account + ", " + Arrays.toString(request.capabilities) + ")");
|
||||
>>>>>>> d04e2718 (Auth: Forward UID/PID from IAuthManagerService.getTokenWithAccount https://github.com/microg/GmsCore/commit/4a7bac35f8eeb1bb3cb1607dc03b439b819abe40)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -215,7 +223,11 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub {
|
|||
|
||||
Log.d(TAG, "clearToken: token:" + token + " extras:" + extras);
|
||||
AccountManager.get(context).invalidateAuthToken(AuthConstants.DEFAULT_ACCOUNT_TYPE, token);
|
||||
return null;
|
||||
|
||||
Bundle res = new Bundle();
|
||||
res.putString("Error", "Ok");
|
||||
res.putBoolean("booleanResult", true);
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue