idTokenDepositionScopes;
- private boolean requestVerifiedPhoneNumber;
-
- /**
- * Sets whether to support sign-in using Google accounts that are linked to your users' accounts.
- *
- * When such a credential is selected, a Google ID token for the Google account that the selected account is linked to, will
- * first be deposited to your server and then returned to you. Similar to the regular sign-in, your backend could use the ID
- * token to sign the user in. Note that, the ID token deposition will only happen the first time signing in, using this credential.
- * Subsequent sign-ins will not require a deposition, since the ID token will already have been associated with your user's
- * account.
- *
- * @param linkedServiceId service ID used when linking accounts to a Google account.
- * @param idTokenDepositionScopes Oauth scopes that Google will need to deposit a Google ID token to your application's backend server. This
- * is optional and can be set to null. Only required if Google requires particular scopes to be able to deposit
- * the ID token.
- */
- public Builder associateLinkedAccounts(@NonNull String linkedServiceId, @Nullable List idTokenDepositionScopes) {
- this.linkedServiceId = linkedServiceId;
- this.idTokenDepositionScopes = idTokenDepositionScopes;
- return this;
- }
-
- /**
- * Returns the built {@link BeginSignInRequest.GoogleIdTokenRequestOptions}.
- */
- @NonNull
- public GoogleIdTokenRequestOptions build() {
- return new GoogleIdTokenRequestOptions(supported, serverClientId, nonce, filterByAuthorizedAccounts, linkedServiceId, idTokenDepositionScopes, requestVerifiedPhoneNumber);
- }
-
- /**
- * Sets whether to only allow the user to select from Google accounts that are already authorized to sign in to your
- * application. The default value is true.
- *
- * If {@code true}, the user will not be able to select any Google account that would otherwise require explicit authorization to
- * share basic profile/email data with your application. This may reduce some friction in the sign-in user journey, and
- * guarantees that the returned credential is for a "returning user", but limits the user's freedom to choose among all the
- * Google accounts on the device.
- *
- * @param filterByAuthorizedAccounts whether to only allow the user to select from Google accounts that are already authorized to sign in to
- * your application
- */
- @NonNull
- public Builder setFilterByAuthorizedAccounts(boolean filterByAuthorizedAccounts) {
- this.filterByAuthorizedAccounts = filterByAuthorizedAccounts;
- return this;
- }
-
- /**
- * Sets the nonce to use when generating a Google ID token.
- *
- * @param nonce the nonce to use during ID token generation
- */
- @NonNull
- public Builder setNonce(@Nullable String nonce) {
- this.nonce = nonce;
- return this;
- }
-
- /**
- * Sets whether to request for a verified phone number during sign-ups.
- *
- * In order to use this feature, the
- * {@link BeginSignInRequest.GoogleIdTokenRequestOptions#filterByAuthorizedAccounts()} field must be explicitly set
- * to false, because this feature is only available during sign-ups.
- *
- * @deprecated No replacement.
- */
- @Deprecated
- @NonNull
- public Builder setRequestVerifiedPhoneNumber(boolean requestVerifiedPhoneNumber) {
- this.requestVerifiedPhoneNumber = requestVerifiedPhoneNumber;
- return this;
- }
-
- /**
- * Sets the server's client ID to use as the audience for Google ID tokens generated during the sign-in.
- *
- * @param serverClientId the client ID of the server to which the ID token will be issued
- */
- @NonNull
- public Builder setServerClientId(@NonNull String serverClientId) {
- this.serverClientId = serverClientId;
- return this;
- }
-
- /**
- * Sets whether Google ID token-backed credentials should be returned by the API.
- *
- * @param supported whether Google ID token-backed credentials should be returned
- */
- @NonNull
- public Builder setSupported(boolean supported) {
- this.supported = supported;
- return this;
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof GoogleIdTokenRequestOptions)) return false;
-
- GoogleIdTokenRequestOptions that = (GoogleIdTokenRequestOptions) o;
-
- if (supported != that.supported) return false;
- if (filterByAuthorizedAccounts != that.filterByAuthorizedAccounts) return false;
- if (requestVerifiedPhoneNumber != that.requestVerifiedPhoneNumber) return false;
- if (!Objects.equals(serverClientId, that.serverClientId)) return false;
- if (!Objects.equals(nonce, that.nonce)) return false;
- if (!Objects.equals(linkedServiceId, that.linkedServiceId)) return false;
- return Objects.equals(idTokenDepositionScopes, that.idTokenDepositionScopes);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{supported, serverClientId, nonce, filterByAuthorizedAccounts, linkedServiceId, idTokenDepositionScopes, requestVerifiedPhoneNumber});
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(GoogleIdTokenRequestOptions.class);
- }
-
- /**
- * Options for requesting passkeys during sign-in.
- */
- @Class
- public static class PasskeyJsonRequestOptions extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "isSupported")
- private final boolean supported;
- @Field(value = 2, getterName = "getRequestJson")
- private final String requestJson;
-
- @Constructor
- @Hide
- public PasskeyJsonRequestOptions(@Param(1) boolean supported, @Param(2) String requestJson) {
- this.supported = supported;
- this.requestJson = requestJson;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public String getRequestJson() {
- return requestJson;
- }
-
- public boolean isSupported() {
- return supported;
- }
-
- /**
- * Builder for {@link BeginSignInRequest.PasskeyJsonRequestOptions}.
- */
- public static class Builder {
- private boolean supported;
- private String requestJson;
-
- @NonNull
- public PasskeyJsonRequestOptions build() {
- return new PasskeyJsonRequestOptions(supported, requestJson);
- }
-
- /**
- * Sets the {@link PublicKeyCredentialRequestOptions} in JSON format.
- *
- * @param requestJson the JSON formatted representation of the WebAuthn request.
- */
- @NonNull
- public Builder setRequestJson(@NonNull String requestJson) {
- this.requestJson = requestJson;
- return this;
- }
-
- /**
- * Sets whether passkey credentials should be returned by this API.
- *
- * @param supported whether passkey credentials should be returned
- */
- @NonNull
- public Builder setSupported(boolean supported) {
- this.supported = supported;
- return this;
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof PasskeyJsonRequestOptions)) return false;
-
- PasskeyJsonRequestOptions that = (PasskeyJsonRequestOptions) o;
-
- if (supported != that.supported) return false;
- return Objects.equals(requestJson, that.requestJson);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{supported, requestJson});
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(PasskeyJsonRequestOptions.class);
- }
-
- /**
- * Options for requesting passkeys during sign-in.
- *
- * @deprecated Use {@link BeginSignInRequest.PasskeyJsonRequestOptions} instead.
- */
- @Deprecated
- @Class
- public static class PasskeysRequestOptions extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "isSupported")
- private final boolean supported;
- @Field(value = 2, getterName = "getChallenge")
- private final byte[] challenge;
- @Field(value = 3, getterName = "getRpId")
- private final String rpId;
-
- @Constructor
- @Hide
- public PasskeysRequestOptions(@Param(1) boolean supported, @Param(2) byte[] challenge, @Param(3) String rpId) {
- this.supported = supported;
- this.challenge = challenge;
- this.rpId = rpId;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public byte[] getChallenge() {
- return challenge;
- }
-
- public String getRpId() {
- return rpId;
- }
-
- public boolean isSupported() {
- return supported;
- }
-
- /**
- * Builder for {@link BeginSignInRequest.PasskeysRequestOptions}.
- */
- public static class Builder {
- private boolean supported;
- private byte[] challenge;
- private String rpId;
-
- public PasskeysRequestOptions build() {
- return new PasskeysRequestOptions(supported, challenge, rpId);
- }
-
- /**
- * Sets the nonce value that the authenticator should sign using a private key corresponding to a public key credential that
- * is acceptable for this authentication session.
- *
- * @param challenge the challenge
- */
- @NonNull
- public Builder setChallenge(@NonNull byte[] challenge) {
- this.challenge = challenge;
- return this;
- }
-
- /**
- * Sets identifier for a relying party, on whose behalf a given authentication operation is being performed. A public key
- * credential can only be used for authentication with the same replying party it was registered with.
- *
- * Note: the RpId should be an effective domain (without scheme or port).
- *
- * @param rpId identifier for a relying party
- */
- @NonNull
- public Builder setRpId(@NonNull String rpId) {
- this.rpId = rpId;
- return this;
- }
-
- /**
- * Sets whether passkey credentials should be returned by this API.
- *
- * @param supported whether passkey credentials should be returned
- */
- @NonNull
- public Builder setSupported(boolean supported) {
- this.supported = supported;
- return this;
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof PasskeysRequestOptions)) return false;
-
- PasskeysRequestOptions that = (PasskeysRequestOptions) o;
-
- if (supported != that.supported) return false;
- if (!Arrays.equals(challenge, that.challenge)) return false;
- return Objects.equals(rpId, that.rpId);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{supported, challenge, rpId});
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(PasskeysRequestOptions.class);
- }
-
- /**
- * Options for requesting password-backed credentials during sign-in.
- */
- @Class
- public static class PasswordRequestOptions extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "isSupported")
- public final boolean supported;
-
- @Constructor
- @Hide
- public PasswordRequestOptions(@Param(1) boolean supported) {
- this.supported = supported;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public boolean isSupported() {
- return supported;
- }
-
- /**
- * Builder for {@link BeginSignInRequest.PasswordRequestOptions}.
- */
- public static class Builder {
- private boolean supported = false;
-
- /**
- * Returns the built {@link BeginSignInRequest.PasswordRequestOptions}.
- */
- @NonNull
- public PasswordRequestOptions build() {
- return new PasswordRequestOptions(supported);
- }
-
- /**
- * Sets whether password-backed credentials should be returned by the API.
- *
- * @param supported whether password-backed credentials should be returned
- */
- @NonNull
- public Builder setSupported(boolean supported) {
- this.supported = supported;
- return this;
- }
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(PasswordRequestOptions.class);
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof BeginSignInRequest)) return false;
-
- BeginSignInRequest that = (BeginSignInRequest) o;
-
- if (autoSelectEnabled != that.autoSelectEnabled) return false;
- if (theme != that.theme) return false;
- if (!Objects.equals(passwordRequestOptions, that.passwordRequestOptions)) return false;
- if (!Objects.equals(googleIdTokenRequestOptions, that.googleIdTokenRequestOptions))
- return false;
- if (!Objects.equals(sessionId, that.sessionId)) return false;
- if (!Objects.equals(passkeysRequestOptions, that.passkeysRequestOptions)) return false;
- return Objects.equals(passkeyJsonRequestOptions, that.passkeyJsonRequestOptions);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{passwordRequestOptions, googleIdTokenRequestOptions, sessionId, autoSelectEnabled, theme, passkeysRequestOptions, passkeyJsonRequestOptions});
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(BeginSignInRequest.class);
-
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/BeginSignInResult.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/BeginSignInResult.java
deleted file mode 100644
index ab875a06..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/BeginSignInResult.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2023 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.app.PendingIntent;
-import android.os.Parcel;
-
-import androidx.annotation.NonNull;
-
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-import org.microg.gms.common.Hide;
-
-/**
- * Result returned from sign-in initiation that includes a {@link PendingIntent} that can be used to continue the sign-in flow.
- */
-@SafeParcelable.Class
-public class BeginSignInResult extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getPendingIntent")
- private final PendingIntent pendingIntent;
-
- @Constructor
- @Hide
- public BeginSignInResult(@Param(1) PendingIntent pendingIntent) {
- this.pendingIntent = pendingIntent;
- }
-
- public PendingIntent getPendingIntent() {
- return pendingIntent;
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(BeginSignInResult.class);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/CredentialSavingClient.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/CredentialSavingClient.java
deleted file mode 100644
index 1761d85e..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/CredentialSavingClient.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.app.PendingIntent;
-import android.content.Intent;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.google.android.gms.common.api.HasApiKey;
-import com.google.android.gms.common.api.Status;
-import com.google.android.gms.tasks.Task;
-
-/**
- * A client for the Credential Saving API.
- */
-public interface CredentialSavingClient extends HasApiKey {
- /**
- * Extracts the {@link Status} from the {@link Intent} object in activity results.
- */
- @NonNull
- Status getStatusFromIntent(@Nullable Intent intent);
-
- /**
- * Attempts to save a token for account linking.
- *
- * Calling this method will provide a {@link PendingIntent} in the response that can be used to launch the flow to complete the
- * saving of the account linking token. As part of the request, you need to provide a {@link PendingIntent} for your consent page
- * that Google Play services will launch in the middle of the flow. The result must then be sent back to the caller following a
- * certain contract described in {@link SaveAccountLinkingTokenRequest.Builder#setConsentPendingIntent(PendingIntent)}.
- *
- * @param saveAccountLinkingTokenRequest the request that contains the parameters to successfully return a response that can be used to
- * launch the appropriate flow.
- * @return {@link Task} which may contain the {@link PendingIntent} required to launch the flow. To find out if the response can be used
- * to start the flow, first call {@link SaveAccountLinkingTokenResult#hasResolution()}.
- */
- @NonNull
- Task saveAccountLinkingToken(@NonNull SaveAccountLinkingTokenRequest saveAccountLinkingTokenRequest);
-
- /**
- * Initiates the storage of a password-backed credential that can later be used to sign a user in.
- *
- * If the request cannot be honored, an exception will be set on the returned {@link Task}. In all other cases, a
- * {@link SavePasswordResult} will be returned.
- *
- * @param savePasswordRequest container for the {@link SignInPassword} for the password-saving flow
- * @return {@link Task} which eventually contains the result of the initialization
- */
- @NonNull
- Task savePassword(@NonNull SavePasswordRequest savePasswordRequest);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/CredentialSavingOptions.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/CredentialSavingOptions.java
deleted file mode 100644
index bfdd7320..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/CredentialSavingOptions.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import androidx.annotation.Nullable;
-import com.google.android.gms.common.api.Api;
-
-import java.util.Arrays;
-
-public class CredentialSavingOptions implements Api.ApiOptions.Optional {
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{CredentialSavingOptions.class});
- }
-
- @Override
- public boolean equals(@Nullable Object obj) {
- return obj instanceof CredentialSavingOptions;
- }
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/GetPhoneNumberHintIntentRequest.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/GetPhoneNumberHintIntentRequest.java
deleted file mode 100644
index 89063405..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/GetPhoneNumberHintIntentRequest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2023 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.os.Parcel;
-
-import androidx.annotation.NonNull;
-
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-import org.microg.gms.common.Hide;
-
-/**
- * Request object used to get an Intent to start the Phone Number Hint flow.
- */
-@SafeParcelable.Class
-public class GetPhoneNumberHintIntentRequest extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getTheme")
- private final int theme;
-
- @Constructor
- GetPhoneNumberHintIntentRequest(@Param(1) int theme) {
- this.theme = theme;
- }
-
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
- @Hide
- public int getTheme() {
- return theme;
- }
-
- /**
- * Builder for {@link GetPhoneNumberHintIntentRequest}
- */
- public static class Builder {
- private int theme;
-
- @NonNull
- public GetPhoneNumberHintIntentRequest build() {
- return new GetPhoneNumberHintIntentRequest(theme);
- }
-
- @Hide
- @NonNull
- public Builder setTheme(int theme) {
- this.theme = theme;
- return this;
- }
- }
-
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(GetPhoneNumberHintIntentRequest.class);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/GetSignInIntentRequest.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/GetSignInIntentRequest.java
deleted file mode 100644
index c656b329..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/GetSignInIntentRequest.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2023 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.os.Parcel;
-
-import androidx.annotation.NonNull;
-
-import androidx.annotation.Nullable;
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-import org.microg.gms.common.Hide;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * Request to get a Google sign-in intent.
- */
-@SafeParcelable.Class
-public class GetSignInIntentRequest extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getServerClientId")
- private final String serverClientId;
- @Field(value = 2, getterName = "getHostedDomainFilter")
- private final String hostedDomainFilter;
- @Field(value = 3, getterName = "getSessionId")
- private final String sessionId;
- @Field(value = 4, getterName = "getNonce")
- private final String nonce;
- @Field(value = 5, getterName = "requestVerifiedPhoneNumber")
- private final boolean requestVerifiedPhoneNumber;
- @Field(value = 6, getterName = "getTheme")
- private final int theme;
-
- @Constructor
- GetSignInIntentRequest(@Param(1) String serverClientId, @Param(2) String hostedDomainFilter, @Param(3) String sessionId, @Param(4) String nonce, @Param(5) boolean requestVerifiedPhoneNumber, @Param(6) int theme) {
- this.serverClientId = serverClientId;
- this.hostedDomainFilter = hostedDomainFilter;
- this.sessionId = sessionId;
- this.nonce = nonce;
- this.requestVerifiedPhoneNumber = requestVerifiedPhoneNumber;
- this.theme = theme;
- }
-
- @NonNull
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * Returns the {@code hostedDomainFilter} if it was set in the request, or {@code null} otherwise.
- */
- public String getHostedDomainFilter() {
- return hostedDomainFilter;
- }
-
- /**
- * Returns the nonce that was set in the request.
- */
- public String getNonce() {
- return nonce;
- }
-
- /**
- * Returns the {@code serverClientId} that was set in the request.
- */
- public String getServerClientId() {
- return serverClientId;
- }
-
- @Hide
- public String getSessionId() {
- return sessionId;
- }
-
- @Hide
- public int getTheme() {
- return theme;
- }
-
- /**
- * Returns whether a verified phone number is requested.
- *
- * @deprecated No replacement.
- */
- @Deprecated
- public boolean requestVerifiedPhoneNumber() {
- return requestVerifiedPhoneNumber;
- }
-
- /**
- * Builder class for {@link GetSignInIntentRequest}.
- */
- public static class Builder {
- private String serverClientId;
- private String hostedDomainFilter;
- private String sessionId;
- private String nonce;
- private boolean requestVerifiedPhoneNumber;
- private int theme;
-
- @NonNull
- public GetSignInIntentRequest build() {
- return new GetSignInIntentRequest(serverClientId, hostedDomainFilter, sessionId, nonce, requestVerifiedPhoneNumber, theme);
- }
-
- /**
- * Sets the hosted domain filter (e.g. myuniveristy.edu). Default is no filter.
- */
- @NonNull
- public Builder filterByHostedDomain(@Nullable String hostedDomainFilter) {
- this.hostedDomainFilter = hostedDomainFilter;
- return this;
- }
-
- /**
- * Sets the nonce to use when generating a Google ID token. The values for nonce can be any random string and is used to
- * prevent replay-attack. Default is no nonce.
- *
- * @param nonce the nonce to use during ID token generation
- */
- @NonNull
- public Builder setNonce(@Nullable String nonce) {
- this.nonce = nonce;
- return this;
- }
-
- /**
- * Sets whether to prompt the users to share a verified phone number associated with their Google accounts.
- *
- * Note that if the user selects a Google account which has previously been used to sign up to your app, they won't be
- * prompted with the phone number selection.
- *
- * @deprecated No replacement.
- */
- @Deprecated
- @NonNull
- public Builder setRequestVerifiedPhoneNumber(boolean requestsVerifiedPhoneNumber) {
- this.requestVerifiedPhoneNumber = requestsVerifiedPhoneNumber;
- return this;
- }
-
- /**
- * Sets the client ID of the server that will verify the integrity of the token. Calling this method to set the {@code serverClientId} is
- * required.
- */
- @NonNull
- public Builder setServerClientId(@NonNull String serverClientId) {
- this.serverClientId = serverClientId;
- return this;
- }
-
- @NonNull
- public Builder setSessionId(@Nullable String sessionId) {
- this.sessionId = sessionId;
- return this;
- }
-
- @NonNull
- public Builder setTheme(int theme) {
- this.theme = theme;
- return this;
- }
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof GetSignInIntentRequest)) return false;
-
- GetSignInIntentRequest that = (GetSignInIntentRequest) o;
-
- if (requestVerifiedPhoneNumber != that.requestVerifiedPhoneNumber) return false;
- if (theme != that.theme) return false;
- if (!Objects.equals(serverClientId, that.serverClientId)) return false;
- if (!Objects.equals(hostedDomainFilter, that.hostedDomainFilter)) return false;
- if (!Objects.equals(sessionId, that.sessionId)) return false;
- return Objects.equals(nonce, that.nonce);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{serverClientId, hostedDomainFilter, serverClientId, nonce, requestVerifiedPhoneNumber, theme});
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(GetSignInIntentRequest.class);
-
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/Identity.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/Identity.java
deleted file mode 100644
index 19647beb..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/Identity.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.app.Activity;
-import android.content.Context;
-import androidx.annotation.NonNull;
-
-/**
- * The entry point to the Sign-In APIs.
- */
-public final class Identity {
-
-// /**
-// * Returns a new instance of {@link AuthorizationClient}.
-// */
-// @NonNull
-// public static AuthorizationClient getAuthorizationClient(@NonNull Context context) {
-// throw new UnsupportedOperationException();
-// }
-//
-// /**
-// * Returns a new instance of {@link AuthorizationClient}.
-// */
-// @NonNull
-// public static AuthorizationClient getAuthorizationClient(@NonNull Activity activity) {
-// throw new UnsupportedOperationException();
-// }
-
- /**
- * Returns a new instance of {@link CredentialSavingClient}.
- */
- @NonNull
- public static CredentialSavingClient getCredentialSavingClient(@NonNull Activity activity) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns a new instance of {@link CredentialSavingClient}.
- */
- @NonNull
- public static CredentialSavingClient getCredentialSavingClient(@NonNull Context context) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns a new instance of {@link SignInClient}.
- */
- @NonNull
- public static SignInClient getSignInClient(@NonNull Activity activity) {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Returns a new instance of {@link SignInClient}.
- */
- @NonNull
- public static SignInClient getSignInClient(@NonNull Context context) {
- throw new UnsupportedOperationException();
- }
-
- private Identity() {
- }
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SaveAccountLinkingTokenRequest.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SaveAccountLinkingTokenRequest.java
deleted file mode 100644
index ada66da8..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SaveAccountLinkingTokenRequest.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.app.Activity;
-import android.app.PendingIntent;
-import android.os.Parcel;
-import androidx.annotation.NonNull;
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-import org.microg.gms.common.Hide;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Objects;
-
-/**
- * Configurations that allow saving a token to Google for the purpose of account linking.
- */
-public class SaveAccountLinkingTokenRequest extends AbstractSafeParcelable {
- public static final String EXTRA_TOKEN = "extra_token";
- /**
- * A constant to indicate that the type of token that will be saved is an Authorization Code.
- */
- public static final String TOKEN_TYPE_AUTH_CODE = "auth_code";
-
- @Field(value = 1, getterName = "getConsentPendingIntent")
- private final PendingIntent consentPendingIntent;
- @Field(value = 2, getterName = "getTokenType")
- private final String tokenType;
- @Field(value = 3, getterName = "getServiceId")
- private final String serviceId;
- @Field(value = 4, getterName = "getScopes")
- private final List scopes;
- @Field(value = 5, getterName = "getSessionId")
- private final String sessionId;
- @Field(value = 6, getterName = "getTheme")
- private final int theme;
-
- @Constructor
- SaveAccountLinkingTokenRequest(@Param(1) PendingIntent consentPendingIntent, @Param(2) String tokenType, @Param(3) String serviceId, @Param(4) List scopes, @Param(5) String sessionId, @Param(6) int theme) {
- this.consentPendingIntent = consentPendingIntent;
- this.tokenType = tokenType;
- this.serviceId = serviceId;
- this.scopes = scopes;
- this.sessionId = sessionId;
- this.theme = theme;
- }
-
- /**
- * Returns an instance of the {@link SaveAccountLinkingTokenRequest.Builder} that can be used to build an instance of {@link SaveAccountLinkingTokenRequest}.
- */
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * Returns the {@link PendingIntent} that is set in the request and will be used to launch the consent page by Google Play Services during the flow.
- */
- public PendingIntent getConsentPendingIntent() {
- return consentPendingIntent;
- }
-
- /**
- * Returns the scopes that were set in the request. These are the requested scopes for the token that will be issued by your application.
- */
- public List getScopes() {
- return scopes;
- }
-
- /**
- * Returns the service-id that was set in the request. This service-id can be found in your cloud project.
- */
- public String getServiceId() {
- return serviceId;
- }
-
- @Hide
- public String getSessionId() {
- return sessionId;
- }
-
- @Hide
- public int getTheme() {
- return theme;
- }
-
- /**
- * Returns the type of token that is requested.
- */
- public String getTokenType() {
- return tokenType;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof SaveAccountLinkingTokenRequest)) return false;
-
- SaveAccountLinkingTokenRequest that = (SaveAccountLinkingTokenRequest) o;
-
- if (theme != that.theme) return false;
- if (!Objects.equals(consentPendingIntent, that.consentPendingIntent)) return false;
- if (!Objects.equals(tokenType, that.tokenType)) return false;
- if (!Objects.equals(serviceId, that.serviceId)) return false;
- if (!Objects.equals(scopes, that.scopes)) return false;
- return Objects.equals(sessionId, that.sessionId);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{consentPendingIntent, tokenType, serviceId, scopes, serviceId, theme});
- }
-
- /**
- * Builder for {@link SaveAccountLinkingTokenRequest}.
- */
- public static class Builder {
- private PendingIntent consentPendingIntent;
- private String tokenType;
- private String serviceId;
- private List scopes;
- private String sessionId;
- private int theme;
-
- /**
- * Builds an immutable instance of the {@link SaveAccountLinkingTokenRequest}.
- */
- @NonNull
- public SaveAccountLinkingTokenRequest build() {
- return new SaveAccountLinkingTokenRequest(consentPendingIntent, tokenType, serviceId, scopes, sessionId, theme);
- }
-
- /**
- * Sets the (mandatory) {@link PendingIntent} that can be launched by Google Play services to show the consent page during
- * the flow. When the launched Activity is finished, it has to provide the appropriate data in the result that it returns to the
- * caller, based on the following contract:
- *
- */
- @NonNull
- public Builder setConsentPendingIntent(PendingIntent consentPendingIntent) {
- this.consentPendingIntent = consentPendingIntent;
- return this;
- }
-
- /**
- * Sets the list of scopes that are associated with the token that will be saved to Google. Calling this method with the
- * correct scope(s) is required.
- */
- @NonNull
- public Builder setScopes(List scopes) {
- this.scopes = scopes;
- return this;
- }
-
- /**
- * Sets the service-id that can be obtained from your Google Cloud project. Calling this method to set {@code serviceId}
- * is required.
- */
- @NonNull
- public Builder setServiceId(String serviceId) {
- this.serviceId = serviceId;
- return this;
- }
-
- @Hide
- @NonNull
- public Builder setSessionId(String sessionId) {
- this.sessionId = sessionId;
- return this;
- }
-
- @Hide
- @NonNull
- public Builder setTheme(int theme) {
- this.theme = theme;
- return this;
- }
-
- /**
- * Sets the type of token that will be saved to Google. Valid options are:
- *
- * - {@link SaveAccountLinkingTokenRequest#TOKEN_TYPE_AUTH_CODE}
- *
- * Calling this method with a valid token type is required.
- */
- @NonNull
- public Builder setTokenType(String tokenType) {
- this.tokenType = tokenType;
- return this;
- }
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SaveAccountLinkingTokenRequest.class);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SaveAccountLinkingTokenResult.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SaveAccountLinkingTokenResult.java
deleted file mode 100644
index 11448995..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SaveAccountLinkingTokenResult.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.app.PendingIntent;
-import android.os.Parcel;
-import androidx.annotation.NonNull;
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-import org.microg.gms.common.Hide;
-
-import java.util.Objects;
-
-/**
- * Result returned from the initial call to save an account linking token that includes a {@link PendingIntent} that can be used to
- * continue the flow.
- */
-@SafeParcelable.Class
-public class SaveAccountLinkingTokenResult extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getPendingIntent")
- private final PendingIntent pendingIntent;
-
- @Constructor
- @Hide
- public SaveAccountLinkingTokenResult(@Param(1) PendingIntent pendingIntent) {
- this.pendingIntent = pendingIntent;
- }
-
- /**
- * Returns the {@link PendingIntent} that can be used to launch the flow. Note that this method can return a {@code null} value if such
- * flow cannot be started. It is expected that the caller first calls {@link #hasResolution()} to make sure the flow can be started,
- * instead of examining the nullness of the result returned by this method.
- */
- public PendingIntent getPendingIntent() {
- return pendingIntent;
- }
-
- /**
- * Returns {@code true} if and only if this result contains a resolution that needs to be launched.
- */
- public boolean hasResolution() {
- return pendingIntent != null;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof SaveAccountLinkingTokenResult)) return false;
-
- SaveAccountLinkingTokenResult that = (SaveAccountLinkingTokenResult) o;
-
- return Objects.equals(pendingIntent, that.pendingIntent);
- }
-
- @Override
- public int hashCode() {
- return pendingIntent != null ? pendingIntent.hashCode() : 0;
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SaveAccountLinkingTokenResult.class);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SavePasswordRequest.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SavePasswordRequest.java
deleted file mode 100644
index cd998a20..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SavePasswordRequest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.os.Parcel;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-import org.microg.gms.common.Hide;
-
-/**
- * Configurations that allow saving a {@link SignInPassword} to Google.
- */
-@SafeParcelable.Class
-public class SavePasswordRequest extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getSignInPassword")
- private final SignInPassword signInPassword;
- @Field(value = 2, getterName = "getSessionId")
- @Nullable
- private final String sessionId;
- @Field(value = 3, getterName = "getTheme")
- private final int theme;
-
- @Constructor
- SavePasswordRequest(@Param(1) SignInPassword signInPassword, @Param(2) @Nullable String sessionId, @Param(3) int theme) {
- this.signInPassword = signInPassword;
- this.sessionId = sessionId;
- this.theme = theme;
- }
-
- /**
- * Returns a new instance of the {@link SavePasswordRequest.Builder}.
- */
- public static Builder builder() {
- return new Builder();
- }
-
- @Hide
- @Nullable
- public String getSessionId() {
- return sessionId;
- }
-
- public SignInPassword getSignInPassword() {
- return signInPassword;
- }
-
- @Hide
- public int getTheme() {
- return theme;
- }
-
- /**
- * Builder for {@link SavePasswordRequest}.
- */
- public static class Builder {
- private SignInPassword signInPassword;
- @Nullable
- private String sessionId;
- private int theme;
-
- /**
- * Sets the {@link SignInPassword}
- */
- @NonNull
- public Builder setSignInPassword(@NonNull SignInPassword signInPassword) {
- this.signInPassword = signInPassword;
- return this;
- }
-
- @Hide
- @NonNull
- public Builder setSessionId(@Nullable String sessionId) {
- this.sessionId = sessionId;
- return this;
- }
-
- @Hide
- @NonNull
- public Builder setTheme(int theme) {
- this.theme = theme;
- return this;
- }
-
- /**
- * Builds and returns a new instance of {@link SavePasswordRequest}.
- */
- @NonNull
- public SavePasswordRequest build() {
- return new SavePasswordRequest(signInPassword, sessionId, theme);
- }
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SavePasswordRequest.class);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SavePasswordResult.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SavePasswordResult.java
deleted file mode 100644
index 9360a1c3..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SavePasswordResult.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.app.PendingIntent;
-import android.os.Parcel;
-import androidx.annotation.NonNull;
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-
-import java.util.Objects;
-
-/**
- * The result returned from calling {@link CredentialSavingClient#savePassword(SavePasswordRequest)} that includes a
- * {@link PendingIntent} that can be used to launch the password saving flow.
- */
-@SafeParcelable.Class
-public class SavePasswordResult extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getPendingIntent")
- private final PendingIntent pendingIntent;
-
- @Constructor
- public SavePasswordResult(@Param(1) PendingIntent pendingIntent) {
- this.pendingIntent = pendingIntent;
- }
-
- /**
- * Returns the {@link PendingIntent} that should be launched to start the UI flow for saving the password.
- */
- public PendingIntent getPendingIntent() {
- return pendingIntent;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof SavePasswordResult)) return false;
-
- SavePasswordResult that = (SavePasswordResult) o;
-
- return Objects.equals(pendingIntent, that.pendingIntent);
- }
-
- @Override
- public int hashCode() {
- return pendingIntent != null ? pendingIntent.hashCode() : 0;
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SavePasswordResult.class);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInClient.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInClient.java
deleted file mode 100644
index 0268ef85..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInClient.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.app.PendingIntent;
-import android.content.Intent;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.google.android.gms.common.api.ApiException;
-import com.google.android.gms.common.api.HasApiKey;
-import com.google.android.gms.tasks.Task;
-
-public interface SignInClient extends HasApiKey {
- /**
- * Initiates the retrieval of a credential that can assist the caller in signing a user in to their application.
- *
- * If the request cannot be honored, an exception will be set on the returned {@link Task}. In all other cases, a
- * {@link BeginSignInResult} will be returned.
- *
- * @param signInRequest configuration for the sign-in operation
- * @return {@link Task} which eventually contains the result of the initialization
- */
- @NonNull
- Task beginSignIn(@NonNull BeginSignInRequest signInRequest);
-
- /**
- * Retrieves the Phone Number from the {@link Intent} returned upon a successful Phone Number Hint request, throwing an
- * {@link ApiException} if no phone number is available or the input {@link Intent} is null.
- *
- * @throws ApiException
- */
- @NonNull
- String getPhoneNumberFromIntent(@Nullable Intent data) throws ApiException;
-
- /**
- * Gets the {@link PendingIntent} that initiates the Phone Number Hint flow.
- *
- * If there is no phone number on the device, an exception will be set on the returned {@link Task}. In all other cases, a
- * {@link PendingIntent} will be returned.
- *
- * @return {@link Task} which can be used to start the Phone Number Hint flow.
- */
- @NonNull
- Task getPhoneNumberHintIntent(@NonNull GetPhoneNumberHintIntentRequest getPhoneNumberHintIntentRequest);
-
- /**
- * Retrieves the {@link SignInCredential} from the {@link Intent} returned upon successful sign-in, throwing an {@link ApiException} if no
- * credential is present.
- *
- * @throws ApiException
- */
- @NonNull
- SignInCredential getSignInCredentialFromIntent(@Nullable Intent data) throws ApiException;
-
- /**
- * Gets the {@link PendingIntent} that initiates the Google Sign-in flow.
- *
- * If the request cannot be honored, an exception will be set on the returned {@link Task}. In all other cases, a {@link PendingIntent}
- * will be returned.
- *
- * @param getSignInIntentRequest configuration for Google Sign-in flow
- * @return {@link Task} which eventually contains the {@link PendingIntent} to start the Google Sign-in flow.
- */
- @NonNull
- Task getSignInIntent(@NonNull GetSignInIntentRequest getSignInIntentRequest);
-
- /**
- * Resets internal state related to sign-in.
- *
- * This method should be invoked when a user signs out of your app.
- *
- * @return {@link Task} which eventually terminates in success or failure
- */
- @NonNull
- Task signOut();
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInCredential.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInCredential.java
deleted file mode 100644
index 85ef8e92..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInCredential.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2023 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.net.Uri;
-import android.os.Parcel;
-
-import androidx.annotation.NonNull;
-
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-import com.google.android.gms.fido.fido2.api.common.PublicKeyCredential;
-import org.microg.gms.common.Hide;
-
-import java.util.Arrays;
-import java.util.Objects;
-
-/**
- * The credential returned as a result of a successful sign-in. Data returned within this object depends on the type of
- * credential that user has selected; for example a password is returned only when a password-backed credential was
- * selected.
- */
-@SafeParcelable.Class
-public class SignInCredential extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getId")
- private final String id;
- @Field(value = 2, getterName = "getDisplayName")
- private final String displayName;
- @Field(value = 3, getterName = "getGivenName")
- private final String givenName;
- @Field(value = 4, getterName = "getFamilyName")
- private final String familyName;
- @Field(value = 5, getterName = "getProfilePictureUri")
- private final Uri profilePictureUri;
- @Field(value = 6, getterName = "getPassword")
- private final String password;
- @Field(value = 7, getterName = "getGoogleIdToken")
- private final String googleIdToken;
- @Field(value = 8, getterName = "getPhoneNumber")
- private final String phoneNumber;
- @Field(value = 9, getterName = "getPublicKeyCredential")
- private final PublicKeyCredential publicKeyCredential;
-
- @Hide
- @Constructor
- public SignInCredential(@Param(1) String id, @Param(2) String displayName, @Param(3) String givenName, @Param(4) String familyName, @Param(5) Uri profilePictureUri, @Param(6) String password, @Param(7) String googleIdToken, @Param(8) String phoneNumber, @Param(9) PublicKeyCredential publicKeyCredential) {
- this.id = id;
- this.displayName = displayName;
- this.givenName = givenName;
- this.familyName = familyName;
- this.profilePictureUri = profilePictureUri;
- this.password = password;
- this.googleIdToken = googleIdToken;
- this.phoneNumber = phoneNumber;
- this.publicKeyCredential = publicKeyCredential;
- }
-
- public String getDisplayName() {
- return displayName;
- }
-
- public String getFamilyName() {
- return familyName;
- }
-
- public String getGivenName() {
- return givenName;
- }
-
- public String getGoogleIdToken() {
- return googleIdToken;
- }
-
- public String getPassword() {
- return password;
- }
-
- /**
- * Returns the identifier of the credential. For an ID token credential, this returns the email address of the user's account
- * and for a password-backed credential, it returns the username for that password.
- */
- public String getId() {
- return id;
- }
-
- /**
- * @deprecated No replacement.
- */
- @Deprecated
- public String getPhoneNumber() {
- return phoneNumber;
- }
-
- public Uri getProfilePictureUri() {
- return profilePictureUri;
- }
-
- /**
- * Returns {@code publicKeyCredential}.
- */
- public PublicKeyCredential getPublicKeyCredential() {
- return publicKeyCredential;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof SignInCredential)) return false;
-
- SignInCredential that = (SignInCredential) o;
-
- if (!Objects.equals(id, that.id)) return false;
- if (!Objects.equals(displayName, that.displayName)) return false;
- if (!Objects.equals(givenName, that.givenName)) return false;
- if (!Objects.equals(familyName, that.familyName)) return false;
- if (!Objects.equals(profilePictureUri, that.profilePictureUri)) return false;
- if (!Objects.equals(password, that.password)) return false;
- if (!Objects.equals(googleIdToken, that.googleIdToken)) return false;
- if (!Objects.equals(phoneNumber, that.phoneNumber)) return false;
- return Objects.equals(publicKeyCredential, that.publicKeyCredential);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{id, displayName, givenName, familyName, profilePictureUri, password, googleIdToken, phoneNumber, publicKeyCredential});
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SignInCredential.class);
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInOptions.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInOptions.java
deleted file mode 100644
index c1078df4..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInOptions.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import androidx.annotation.Nullable;
-import com.google.android.gms.common.api.Api;
-
-import java.util.Arrays;
-
-public class SignInOptions implements Api.ApiOptions.Optional {
- @Override
- public int hashCode() {
- return Arrays.hashCode(new Object[]{SignInOptions.class});
- }
-
- @Override
- public boolean equals(@Nullable Object obj) {
- return obj instanceof SignInOptions;
- }
-}
diff --git a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInPassword.java b/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInPassword.java
deleted file mode 100644
index a2889522..00000000
--- a/play-services-auth/src/main/java/com/google/android/gms/auth/api/identity/SignInPassword.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2024 microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- * Notice: Portions of this file are reproduced from work created and shared by Google and used
- * according to terms described in the Creative Commons 4.0 Attribution License.
- * See https://developers.google.com/readme/policies for details.
- */
-
-package com.google.android.gms.auth.api.identity;
-
-import android.os.Parcel;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
-import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
-
-import java.util.Arrays;
-
-/**
- * An account ID such as a username or an email, and a password that can be used to sign a user in.
- */
-@SafeParcelable.Class
-public class SignInPassword extends AbstractSafeParcelable {
- @Field(value = 1, getterName = "getId")
- @NonNull
- private final String id;
- @Field(value = 2, getterName = "getPassword")
- @NonNull
- private final String password;
-
- @Constructor
- public SignInPassword(@Param(1) @NonNull String id, @Param(2) @NonNull String password) {
- this.id = id;
- this.password = password;
- }
-
- @NonNull
- public String getId() {
- return id;
- }
-
- @NonNull
- public String getPassword() {
- return password;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (!(o instanceof SignInPassword)) return false;
-
- SignInPassword that = (SignInPassword) o;
-
- if (!id.equals(that.id)) return false;
- return password.equals(that.password);
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(new String[]{id, password});
- }
-
- @Override
- public void writeToParcel(@NonNull Parcel dest, int flags) {
- CREATOR.writeToParcel(this, dest, flags);
- }
-
- public static final SafeParcelableCreatorAndWriter CREATOR = findCreator(SignInPassword.class);
-}
diff --git a/play-services-base-api/build.gradle b/play-services-base-api/build.gradle
deleted file mode 100644
index 59dc1be7..00000000
--- a/play-services-base-api/build.gradle
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2013-2015 microG Project Team
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-apply plugin: 'com.android.library'
-
-dependencies {
- api project(':play-services-basement')
-}
-
-android {
- compileSdkVersion androidCompileSdk
- buildToolsVersion androidBuildVersionTools
-
- aidlPackageWhiteList "com/google/android/gms/common/data/DataHolder.aidl"
- aidlPackageWhiteList "com/google/android/gms/common/images/WebImage.aidl"
- aidlPackageWhiteList "com/google/android/gms/common/api/internal/IStatusCallback.aidl"
-
- defaultConfig {
- minSdkVersion androidMinSdk
- targetSdkVersion androidTargetSdk
- }
-
- compileOptions {
- sourceCompatibility = 1.8
- targetCompatibility = 1.8
- }
- namespace 'org.microg.gms.base.api'
- buildFeatures {
- aidl true
- }
-}
\ No newline at end of file
diff --git a/play-services-base-api/src/main/aidl/com/google/android/gms/common/api/internal/IStatusCallback.aidl b/play-services-base-api/src/main/aidl/com/google/android/gms/common/api/internal/IStatusCallback.aidl
deleted file mode 100644
index 6355a13b..00000000
--- a/play-services-base-api/src/main/aidl/com/google/android/gms/common/api/internal/IStatusCallback.aidl
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.google.android.gms.common.api.internal;
-
-import com.google.android.gms.common.api.Status;
-
-interface IStatusCallback {
- void onResult(in Status status);
-}
diff --git a/play-services-base-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl b/play-services-base-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl
deleted file mode 100644
index 3bbd1174..00000000
--- a/play-services-base-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl
+++ /dev/null
@@ -1,3 +0,0 @@
-package com.google.android.gms.common.data;
-
-parcelable DataHolder;
diff --git a/play-services-base-api/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl b/play-services-base-api/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl
deleted file mode 100644
index e31f15ab..00000000
--- a/play-services-base-api/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl
+++ /dev/null
@@ -1,3 +0,0 @@
-package com.google.android.gms.common.images;
-
-parcelable WebImage;
diff --git a/play-services-base-api/src/main/java/com/google/android/gms/auth/api/signin/GoogleSignInAccount.java b/play-services-base-api/src/main/java/com/google/android/gms/auth/api/signin/GoogleSignInAccount.java
deleted file mode 100644
index 031c5b37..00000000
--- a/play-services-base-api/src/main/java/com/google/android/gms/auth/api/signin/GoogleSignInAccount.java
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2020, microG Project Team
- * SPDX-License-Identifier: Apache-2.0
- */
-
-package com.google.android.gms.auth.api.signin;
-
-import org.microg.safeparcel.AutoSafeParcelable;
-
-public class GoogleSignInAccount extends AutoSafeParcelable {
- public static final Creator CREATOR = new AutoCreator<>(GoogleSignInAccount.class);
-}
diff --git a/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java
deleted file mode 100644
index 77acbb1b..00000000
--- a/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Copyright (C) 2013-2017 microG Project Team
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.android.gms.common.data;
-
-import android.annotation.SuppressLint;
-import android.database.Cursor;
-import android.database.CursorWindow;
-import android.os.Bundle;
-import android.os.Parcel;
-
-import androidx.annotation.NonNull;
-
-import org.microg.gms.common.PublicApi;
-import org.microg.safeparcel.AutoSafeParcelable;
-import org.microg.safeparcel.SafeParceled;
-
-import java.io.Closeable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Class for accessing collections of data, organized into columns. This provides the backing
- * support for DataBuffer. Much like a cursor, the holder supports the notion of a current
- * position, and has methods for extracting various types of data from named columns.
- */
-@PublicApi(until = "1")
-public class DataHolder extends AutoSafeParcelable implements Closeable {
- @SafeParceled(1)
- private final String[] columns;
-
- @SafeParceled(2)
- private final CursorWindow[] windows;
-
- @SafeParceled(3)
- private final int statusCode;
-
- @SafeParceled(4)
- private final Bundle metadata;
-
- private boolean closed = false;
- private Map columnIndices;
-
- protected static final int FIELD_TYPE_NULL = 0;
- protected static final int FIELD_TYPE_INTEGER = 1;
- protected static final int FIELD_TYPE_FLOAT = 2;
- protected static final int FIELD_TYPE_STRING = 3;
- protected static final int FIELD_TYPE_BLOB = 4;
-
- /**
- * Creates a data holder with the specified data.
- *
- * @param columns The column names corresponding to the data in the given windows.
- * @param windows The {@link CursorWindow} instances holding the data.
- * @param statusCode The status code of this {@link DataHolder}.
- * @param metadata The metadata associated with this {@link DataHolder} (may be null).
- */
- public DataHolder(String[] columns, CursorWindow[] windows, int statusCode, Bundle metadata) {
- this.columns = columns;
- this.windows = windows;
- this.statusCode = statusCode;
- this.metadata = metadata;
- validateContents();
- }
-
- /**
- * Creates a data holder wrapping the provided cursor, with provided status code and metadata.
- *
- * @param cursor The cursor containing the data.
- * @param statusCode The status code of this {@link DataHolder}.
- * @param metadata The metadata associated with this {@link DataHolder} (may be null).
- */
- public DataHolder(Cursor cursor, int statusCode, Bundle metadata) {
- this(cursor.getColumnNames(), createCursorWindows(cursor), statusCode, metadata);
- }
-
- /**
- * Get a {@link DataHolder.Builder} to create a new {@link DataHolder} manually.
- *
- * @param columns The array of column names that the object supports.
- * @return {@link DataHolder.Builder} object to work with.
- */
- public static Builder builder(String[] columns) {
- return new Builder(columns);
- }
-
- @SuppressLint({"NewApi", "ObsoleteSdkInt"})
- static int getCursorType(Cursor cursor, int i) {
- return cursor.getType(i);
- }
-
- /**
- * Closes the data holder, releasing all of its resources and making it completely invalid.
- */
- @Override
- public void close() {
- synchronized (this) {
- if (!closed) {
- closed = true;
- for (CursorWindow window : windows) {
- window.close();
- }
- }
- }
- }
-
- @SuppressWarnings("deprecation")
- private static CursorWindow[] createCursorWindows(Builder builder) {
- if (builder.columns.length == 0) return new CursorWindow[0];
- List windows = new ArrayList<>();
- try {
- CursorWindow current = null;
- for (int rowIndex = 0; rowIndex < builder.rows.size(); rowIndex++) {
- Map row = builder.rows.get(rowIndex);
- if (current == null || !current.allocRow()) {
- current = new CursorWindow(false);
- current.setStartPosition(rowIndex);
- current.setNumColumns(builder.columns.length);
- windows.add(current);
- if (!current.allocRow()) {
- windows.remove(current);
- return windows.toArray(new CursorWindow[0]);
- }
- }
- for (int columnIndex = 0; columnIndex < builder.columns.length; columnIndex++) {
- Object val = row.get(builder.columns[columnIndex]);
- if (val == null) {
- current.putNull(rowIndex, columnIndex);
- } else if (val instanceof String) {
- current.putString((String) val, rowIndex, columnIndex);
- } else if (val instanceof Long) {
- current.putLong((Long) val, rowIndex, columnIndex);
- } else if (val instanceof Integer) {
- current.putLong((Integer) val, rowIndex, columnIndex);
- } else if (val instanceof Boolean) {
- if ((Boolean) val)
- current.putLong(1, rowIndex, columnIndex);
- } else if (val instanceof byte[]) {
- current.putBlob((byte[]) val, rowIndex, columnIndex);
- } else if (val instanceof Double) {
- current.putDouble((Double) val, rowIndex, columnIndex);
- } else if (val instanceof Float) {
- current.putDouble((Float) val, rowIndex, columnIndex);
- } else {
- throw new IllegalArgumentException("Unsupported object for column " + columnIndex + ": " + val);
- }
- }
- }
- } catch (RuntimeException e) {
- for (CursorWindow window : windows) {
- window.close();
- }
- throw e;
- }
- return windows.toArray(new CursorWindow[0]);
- }
-
- private static CursorWindow[] createCursorWindows(Cursor cursor) {
- if (cursor.getColumnCount() == 0) return new CursorWindow[0];
- List windows = new ArrayList<>();
- CursorWindow current = null;
- int rowIndex = 0;
- while (cursor.moveToNext()) {
- if (current == null || !current.allocRow()) {
- current = new CursorWindow(false);
- current.setStartPosition(rowIndex);
- current.setNumColumns(cursor.getColumnCount());
- windows.add(current);
- if (!current.allocRow()) {
- windows.remove(current);
- return windows.toArray(new CursorWindow[0]);
- }
- }
- for (int i = 0; i < cursor.getColumnCount(); i++) {
- switch (getCursorType(cursor, i)) {
- case FIELD_TYPE_NULL:
- current.putNull(rowIndex, i);
- break;
- case FIELD_TYPE_BLOB:
- current.putBlob(cursor.getBlob(i), rowIndex, i);
- break;
- case FIELD_TYPE_FLOAT:
- current.putDouble(cursor.getDouble(i), rowIndex, i);
- break;
- case FIELD_TYPE_INTEGER:
- current.putLong(cursor.getLong(i), rowIndex, i);
- break;
- case FIELD_TYPE_STRING:
- current.putString(cursor.getString(i), rowIndex, i);
- break;
- }
- }
- rowIndex++;
- }
- cursor.close();
- return windows.toArray(new CursorWindow[0]);
- }
-
- /**
- * Gets the number of rows in the data holder.
- *
- * @return the number of rows in the data holder.
- */
- public int getCount() {
- int c = 0;
- if (windows != null) {
- for (CursorWindow window : windows) {
- c += window.getNumRows();
- }
- }
- return c;
- }
-
- /**
- * Retrieves the string value for a given column at the provided position.
- * This will throw an {@link IllegalArgumentException} if the column does not exist, the
- * position is invalid, or the data holder has been closed.
- *
- * @param column The column to retrieve.
- * @param row The row to retrieve the data from.
- * @param windowIndex Index of the cursor window to extract the data from.
- * @return The string value in that column.
- */
- public String getString(String column, int row, int windowIndex) {
- return windows[windowIndex].getString(row, columnIndices.get(column));
- }
-
- @NonNull
- @Override
- public String toString() {
- return "DataHolder{" +
- "columns=" + Arrays.toString(columns) +
- ", windows=" + Arrays.toString(windows) +
- ", statusCode=" + statusCode +
- ", metadata=" + metadata +
- '}';
- }
-
- public void validateContents() {
- columnIndices = new HashMap<>();
- for (int i = 0; i < columns.length; i++) {
- columnIndices.put(columns[i], i);
- }
- }
-
- /**
- * Helper class to build {@link DataHolder} instances containing arbitrary data.
- *
- * Note that the constructor is private; use DataHolder.builder() to create instances of this class.
- */
- public static class Builder {
- private final String[] columns;
- private final ArrayList