Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ buildscript {
ext.appcompatVersion = '1.6.1'
ext.biometricVersion = '1.1.0'
ext.coreVersion = '1.12.0'
ext.credentialsVersion = '1.2.0'
ext.fragmentVersion = '1.6.2'
ext.lifecycleVersion = '2.7.0'
ext.loaderVersion = '1.1.0'
Expand Down Expand Up @@ -123,4 +124,3 @@ subprojects {
if (hasModule("hms", false)) maven {url 'https://developer.huawei.com/repo/'}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,132 @@ public boolean isPreferImmediatelyAvailableCredentials() {
return preferImmediatelyAvailableCredentials;
}

/**
* Builder for {@link BeginSignInRequest}.
*/
public static class Builder {
private PasswordRequestOptions passwordRequestOptions;
private GoogleIdTokenRequestOptions googleIdTokenRequestOptions;
private String sessionId;
private boolean autoSelectEnabled;
private int theme;
private PasskeysRequestOptions passkeysRequestOptions;
private PasskeyJsonRequestOptions passkeyJsonRequestOptions;
private boolean preferImmediatelyAvailableCredentials;

/**
* Returns the built {@link BeginSignInRequest}.
*/
@NonNull
public BeginSignInRequest build() {
return new BeginSignInRequest(
passwordRequestOptions,
googleIdTokenRequestOptions,
sessionId,
autoSelectEnabled,
theme,
passkeysRequestOptions,
passkeyJsonRequestOptions,
preferImmediatelyAvailableCredentials
);
}

/**
* Sets whether to enable auto-select for the credential.
* <p>
* If enabled and only one credential is available, it will be automatically selected.
*
* @param autoSelectEnabled whether to enable auto-select
*/
@NonNull
public Builder setAutoSelectEnabled(boolean autoSelectEnabled) {
this.autoSelectEnabled = autoSelectEnabled;
return this;
}

/**
* Sets options for requesting Google ID token-backed credentials.
*
* @param googleIdTokenRequestOptions the Google ID token request options
*/
@NonNull
public Builder setGoogleIdTokenRequestOptions(@Nullable GoogleIdTokenRequestOptions googleIdTokenRequestOptions) {
this.googleIdTokenRequestOptions = googleIdTokenRequestOptions;
return this;
}

/**
* Sets options for requesting passkey credentials using JSON format.
*
* @param passkeyJsonRequestOptions the passkey JSON request options
*/
@NonNull
public Builder setPasskeyJsonRequestOptions(@Nullable PasskeyJsonRequestOptions passkeyJsonRequestOptions) {
this.passkeyJsonRequestOptions = passkeyJsonRequestOptions;
return this;
}

/**
* Sets options for requesting passkey credentials.
*
* @param passkeysRequestOptions the passkey request options
* @deprecated Use {@link #setPasskeyJsonRequestOptions(PasskeyJsonRequestOptions)} instead
*/
@Deprecated
@NonNull
public Builder setPasskeysRequestOptions(@Nullable PasskeysRequestOptions passkeysRequestOptions) {
this.passkeysRequestOptions = passkeysRequestOptions;
return this;
}

/**
* Sets options for requesting password-backed credentials.
*
* @param passwordRequestOptions the password request options
*/
@NonNull
public Builder setPasswordRequestOptions(@Nullable PasswordRequestOptions passwordRequestOptions) {
this.passwordRequestOptions = passwordRequestOptions;
return this;
}

/**
* Sets whether to prefer immediately available credentials.
* <p>
* If true, the API will only return credentials that are immediately available
* without requiring user interaction.
*
* @param preferImmediatelyAvailableCredentials whether to prefer immediately available credentials
*/
@NonNull
public Builder setPreferImmediatelyAvailableCredentials(boolean preferImmediatelyAvailableCredentials) {
this.preferImmediatelyAvailableCredentials = preferImmediatelyAvailableCredentials;
return this;
}

/**
* Sets the session ID for this sign-in request.
*
* @param sessionId the session ID
*/
@Hide
@NonNull
public Builder setSessionId(@Nullable String sessionId) {
this.sessionId = sessionId;
return this;
}

/**
* Sets the theme for the sign-in UI.
*
* @param theme the theme resource ID
*/
@Hide
@NonNull
public Builder setTheme(int theme) {
this.theme = theme;
return this;
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.google.android.gms.clearcut.internal;

import com.google.android.gms.common.api.Status;

interface IBootCountCallbacks {
void onBootCount(in Status status, int bootCount) = 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.google.android.gms.clearcut.internal;

import com.google.android.gms.clearcut.internal.IBootCountCallbacks;

interface IBootCountService {
void getBootCount(IBootCountCallbacks callbacks) = 0;
}
1 change: 1 addition & 0 deletions play-services-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"

implementation "androidx.credentials:credentials:$credentialsVersion"
implementation "androidx.work:work-runtime-ktx:$workVersion"
}

Expand Down
73 changes: 73 additions & 0 deletions play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.PROVIDE_REMOTE_CREDENTIALS" />
<uses-permission android:name="android.permission.PROVIDE_DEFAULT_ENABLED_CREDENTIAL_SERVICE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
Expand Down Expand Up @@ -185,6 +187,7 @@
tools:overrideLibrary="androidx.compose.ui.tooling,
androidx.compose.material3,
androidx.activity.compose,
androidx.credentials,
androidx.compose.material.icons,
androidx.compose.material.ripple,
androidx.compose.foundation,
Expand Down Expand Up @@ -674,6 +677,70 @@
android:exported="true"
android:theme="@style/Theme.LoginBlue"/>

<!-- Credential Provider Services -->
<service
android:name="com.google.android.gms.auth.api.credentials.credman.service.PasswordAndPasskeyService"
android:exported="true"
android:permission="android.permission.BIND_CREDENTIAL_PROVIDER_SERVICE"
tools:targetApi="34">
<intent-filter>
<action android:name="android.service.credentials.CredentialProviderService"/>
</intent-filter>
<meta-data
android:name="android.credentials.provider"
android:resource="@xml/credentials_provider_passkey" />
</service>

<service
android:name="com.google.android.gms.auth.api.credentials.credman.service.RemoteService"
android:exported="true"
android:permission="android.permission.BIND_CREDENTIAL_PROVIDER_SERVICE"
tools:targetApi="34">
<intent-filter>
<action android:name="android.service.credentials.system.CredentialProviderService"/>
</intent-filter>
<meta-data
android:name="android.credentials.provider"
android:resource="@xml/credentials_provider_remote" />
</service>

<service
android:name="com.google.android.gms.auth.api.credentials.credman.service.GoogleIdService"
android:exported="true"
android:icon="@drawable/ic_google_logo"
android:label="@string/credentials_service_sign_in_with_google_label"
android:permission="android.permission.BIND_CREDENTIAL_PROVIDER_SERVICE"
tools:targetApi="34">
<intent-filter>
<action android:name="android.service.credentials.system.CredentialProviderService"/>
</intent-filter>
<meta-data
android:name="android.credentials.provider"
android:resource="@xml/credentials_provider_google_id" />
</service>


<activity
android:name="org.microg.gms.auth.credentials.provider.PublicKeyProxyActivity"
android:exported="false"
android:process=":ui"
android:theme="@style/Theme.App.Translucent"
android:excludeFromRecents="true"
tools:targetApi="34" />

<activity
android:name="org.microg.gms.auth.credentials.provider.SignInProxyActivity"
android:exported="false"
android:process=":ui"
android:theme="@style/Theme.App.Translucent"
android:excludeFromRecents="true"
tools:targetApi="34">
<intent-filter>
<action android:name="org.microg.gms.auth.credentials.GOOGLE_ID_PROXY_INTENT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>

<!-- Games -->

<activity
Expand Down Expand Up @@ -1250,6 +1317,12 @@
</intent-filter>
</receiver>

<service android:name="org.microg.gms.clearcut.BootCountService" >
<intent-filter>
<action android:name="com.google.android.gms.clearcut.bootcount.service.START" />
</intent-filter>
</service>

<service android:name="org.microg.gms.DummyService">
<intent-filter>
<action android:name="com.google.android.contextmanager.service.ContextManagerService.START" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ private const val TAG = "SemanticLocationService"

private val FEATURES = arrayOf(
Feature("semanticlocation_events", 1L),
Feature("semanticlocation_events_listener", 1L),
Feature("semanticlocation_registration_check", 1L),
Feature("semanticlocation_personalization_signal", 1L),
)

class SemanticLocationService : BaseService(TAG, GmsService.SEMANTIC_LOCATION) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2026 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth.api.credentials.credman.service

import org.microg.gms.auth.credentials.provider.GoogleIdService

class GoogleIdService : GoogleIdService()
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2026 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth.api.credentials.credman.service

import org.microg.gms.auth.credentials.provider.PasswordAndPasskeyService

class PasswordAndPasskeyService : PasswordAndPasskeyService()
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* SPDX-FileCopyrightText: 2026 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.auth.api.credentials.credman.service

import org.microg.gms.auth.credentials.provider.RemoteService

class RemoteService : RemoteService()
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import com.google.android.gms.fido.Fido.FIDO2_KEY_CREDENTIAL_EXTRA
import com.google.android.gms.fido.fido2.api.common.AuthenticatorErrorResponse
import com.google.android.gms.fido.fido2.api.common.PublicKeyCredential
import org.microg.gms.auth.AuthConstants
import org.microg.gms.fido.core.ui.ACTION_FIDO_AUTHENTICATE
import org.microg.gms.fido.core.ui.AuthenticatorActivity.Companion.KEY_CALLER

private const val REQUEST_CODE = 1586077619

class IdentityFidoProxyActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
startActivityForResult(Intent("org.microg.gms.fido.AUTHENTICATE").apply {
startActivityForResult(Intent(ACTION_FIDO_AUTHENTICATE).apply {
`package` = packageName
putExtras(intent.extras ?: Bundle())
putExtra(KEY_CALLER, callingActivity?.packageName)
Expand Down
Loading
Loading