From 2e64427734c8186499ce11f9eec0e27625416d2d Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 23 Jun 2021 22:15:40 +0200 Subject: [PATCH 1/6] Add CredentialsService dummy --- .../api/credentials/CredentialRequest.java | 2 + .../src/main/AndroidManifest.xml | 9 +++- .../{ui => auth}/CredentialPickerActivity.kt | 2 +- .../org/microg/gms/auth/CredentialsService.kt | 53 +++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) rename play-services-core/src/main/kotlin/org/microg/gms/{ui => auth}/CredentialPickerActivity.kt (98%) create mode 100644 play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java index 9a5fa917..a1679445 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java @@ -29,6 +29,8 @@ public class CredentialRequest extends AutoSafeParcelable { @Field(4) private CredentialPickerConfig credentialHintPickerConfig; + private CredentialRequest() { } + public CredentialRequest(boolean passwordLoginSupported, String[] accountTypes, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialHintPickerConfig) { this.passwordLoginSupported = passwordLoginSupported; this.accountTypes = accountTypes; diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index f20594bd..73ca617d 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -423,7 +423,7 @@ android:exported="true" /> @@ -431,6 +431,12 @@ + + + + + + @@ -740,7 +746,6 @@ - diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/CredentialPickerActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt similarity index 98% rename from play-services-core/src/main/kotlin/org/microg/gms/ui/CredentialPickerActivity.kt rename to play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt index c5f3849c..e8e3fac3 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/CredentialPickerActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package org.microg.gms.ui +package org.microg.gms.auth import android.app.Activity import android.os.Bundle diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt new file mode 100644 index 00000000..6f571df3 --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt @@ -0,0 +1,53 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.auth + +import android.os.Bundle +import android.util.Log +import com.google.android.gms.auth.api.credentials.CredentialRequest +import com.google.android.gms.auth.api.credentials.internal.* +import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.common.api.Status +import com.google.android.gms.common.internal.GetServiceRequest +import com.google.android.gms.common.internal.IGmsCallbacks +import org.microg.gms.BaseService +import org.microg.gms.common.GmsService + +const val TAG = "GmsCredentials" + +class CredentialsService : BaseService(TAG, GmsService.CREDENTIALS) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + callback.onPostInitComplete(CommonStatusCodes.SUCCESS, CredentialsServiceImpl(), Bundle()) + } +} + +class CredentialsServiceImpl : ICredentialsService.Stub() { + override fun request(callbacks: ICredentialsCallbacks, request: CredentialRequest) { + Log.d(TAG, "request($request)") + callbacks.onStatus(Status.CANCELED) + } + + override fun save(callbacks: ICredentialsCallbacks, request: SaveRequest) { + Log.d(TAG, "save($request)") + callbacks.onStatus(Status.CANCELED) + } + + override fun delete(callbacks: ICredentialsCallbacks, request: DeleteRequest) { + Log.d(TAG, "delete($request)") + callbacks.onStatus(Status.CANCELED) + } + + override fun disableAutoSignIn(callbacks: ICredentialsCallbacks) { + Log.d(TAG, "disableAutoSignIn()") + callbacks.onStatus(Status.SUCCESS) + } + + override fun generatePassword(callbacks: ICredentialsCallbacks, request: GeneratePasswordRequest) { + Log.d(TAG, "generatePassword($request)") + callbacks.onStatus(Status.SUCCESS) + } + +} From a43048995c422bf1f2eedef4b8a4e58c18dcdbf8 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Wed, 23 Jun 2021 23:08:13 +0200 Subject: [PATCH 2/6] Add Cronet --- .gitignore | 4 ++ build.gradle | 1 + play-services-core/build.gradle | 1 + .../chimera/container/DynamiteContext.java | 27 +++++++------ play-services-cronet-core/build.gradle | 38 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 11 ++++++ .../gms/cronet_dynamite/ModuleDescriptor.java | 37 ++++++++++++++++++ settings.gradle | 1 + 8 files changed, 109 insertions(+), 11 deletions(-) create mode 100644 play-services-cronet-core/build.gradle create mode 100644 play-services-cronet-core/src/main/AndroidManifest.xml create mode 100644 play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java diff --git a/.gitignore b/.gitignore index 25ed3657..8db18dfe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ build/ user.gradle local.properties .directory + +.settings +.classpath +.project diff --git a/build.gradle b/build.gradle index c38d7449..50b5f210 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ */ buildscript { + ext.cronetVersion = '91.0.4472.120' ext.nlpVersion = '2.0-alpha6' ext.remoteDroidGuardVersion = '0.1.2' ext.safeParcelVersion = '1.7.0' diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 7cde3e14..685eb1fd 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -43,6 +43,7 @@ dependencies { implementation project(':play-services-base-core') implementation project(':play-services-base-core-ui') implementation project(':play-services-conscrypt-provider-core') + implementation project(':play-services-cronet-core') implementation project(':play-services-location-core') implementation project(':play-services-vision-core') withNearbyImplementation project(':play-services-nearby-core') diff --git a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java index 7f104fbe..8484447b 100644 --- a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java +++ b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java @@ -28,6 +28,8 @@ public class DynamiteContext extends ContextWrapper { private Context gmsContext; private DynamiteContext appContext; + private ClassLoader classLoader; + public DynamiteContext(DynamiteModuleInfo moduleInfo, Context base, Context gmsContext, DynamiteContext appContext) { super(base); this.moduleInfo = moduleInfo; @@ -38,19 +40,22 @@ public class DynamiteContext extends ContextWrapper { @Override public ClassLoader getClassLoader() { - StringBuilder nativeLoaderDirs = new StringBuilder(gmsContext.getApplicationInfo().nativeLibraryDir); - if (Build.VERSION.SDK_INT >= 23 && Process.is64Bit()) { - for (String abi : Build.SUPPORTED_64_BIT_ABIS) { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); + if (classLoader == null) { + StringBuilder nativeLoaderDirs = new StringBuilder(gmsContext.getApplicationInfo().nativeLibraryDir); + if (Build.VERSION.SDK_INT >= 23 && Process.is64Bit()) { + for (String abi : Build.SUPPORTED_64_BIT_ABIS) { + nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); + } + } else if (Build.VERSION.SDK_INT >= 21) { + for (String abi : Build.SUPPORTED_32_BIT_ABIS) { + nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); + } + } else { + nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(Build.CPU_ABI); } - } else if (Build.VERSION.SDK_INT >= 21) { - for (String abi : Build.SUPPORTED_32_BIT_ABIS) { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); - } - } else { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(Build.CPU_ABI); + classLoader = new PathClassLoader(gmsContext.getApplicationInfo().sourceDir, nativeLoaderDirs.toString(), new FilteredClassLoader(originalContext.getClassLoader(), moduleInfo.getMergedClasses(), moduleInfo.getMergedPackages())); } - return new PathClassLoader(gmsContext.getApplicationInfo().sourceDir, nativeLoaderDirs.toString(), new FilteredClassLoader(originalContext.getClassLoader(), moduleInfo.getMergedClasses(), moduleInfo.getMergedPackages())); + return classLoader; } @Override diff --git a/play-services-cronet-core/build.gradle b/play-services-cronet-core/build.gradle new file mode 100644 index 00000000..4afa63c9 --- /dev/null +++ b/play-services-cronet-core/build.gradle @@ -0,0 +1,38 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +dependencies { + implementation("org.microg:cronet-api:$cronetVersion") + implementation("org.microg:cronet-common:$cronetVersion") + implementation("org.microg:cronet-native:$cronetVersion") +} + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + lintOptions { + disable 'MissingTranslation' + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +apply from: '../gradle/publish-android.gradle' + +description = 'microG service implementation for play-services-cronet' diff --git a/play-services-cronet-core/src/main/AndroidManifest.xml b/play-services-cronet-core/src/main/AndroidManifest.xml new file mode 100644 index 00000000..93245ce8 --- /dev/null +++ b/play-services-cronet-core/src/main/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java b/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java new file mode 100644 index 00000000..c46af5c9 --- /dev/null +++ b/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.dynamite.descriptors.com.google.android.gms.cronet_dynamite; + +import java.util.Arrays; +import java.util.List; + +public class ModuleDescriptor { + public static final String MODULE_ID = "com.google.android.gms.cronet_dynamite"; + public static final int MODULE_VERSION = 2; + public static final List MERGED_CLASSES = Arrays.asList( + "org.chromium.net.ApiVersion", + "org.chromium.net.BidirectionalStream", + "org.chromium.net.CallbackException", + "org.chromium.net.CronetEngine", + "org.chromium.net.CronetException", + "org.chromium.net.CronetProvider", + "org.chromium.net.ExperimentalBidirectionalStream", + "org.chromium.net.ExperimentalCronetEngine", + "org.chromium.net.ExperimentalUrlRequest", + "org.chromium.net.ICronetEngineBuilder", + "org.chromium.net.InlineExecutionProhibitedException", + "org.chromium.net.NetworkException", + "org.chromium.net.NetworkQualityRttListener", + "org.chromium.net.NetworkQualityThroughputListener", + "org.chromium.net.QuicException", + "org.chromium.net.RequestFinishedInfo", + "org.chromium.net.UploadDataProvider", + "org.chromium.net.UploadDataProviders", + "org.chromium.net.UploadDataSink", + "org.chromium.net.UrlRequest", + "org.chromium.net.UrlResponseInfo" + ); +} diff --git a/settings.gradle b/settings.gradle index cdbee860..f6a792a3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,6 +22,7 @@ include ':play-services-wearable-proto' include ':play-services-base-core' include ':play-services-conscrypt-provider-core' +include ':play-services-cronet-core' include ':play-services-location-core' include ':play-services-maps-core-mapbox' include ':play-services-maps-core-vtm' From 602a34ff4b6d896b6734afc66fd7cfb76d0c48a0 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 27 Jun 2021 18:52:22 +0200 Subject: [PATCH 3/6] TapAndPay: Add Dummy --- .../tapandpay/internal/ITapAndPayService.aidl | 5 -- .../gms/wallet/IsReadyToPayRequest.java | 4 +- play-services-base-core/build.gradle | 2 +- play-services-core/build.gradle | 4 +- .../src/main/AndroidManifest.xml | 5 -- .../microg/gms/tapandpay/TapAndPayImpl.java | 33 ------------ .../gms/tapandpay/TapAndPayService.java | 38 -------------- play-services-tapandpay-api/build.gradle | 36 +++++++++++++ .../src/main/AndroidManifest.xml | 6 +++ .../gms/tapandpay/firstparty/TokenStatus.aidl | 3 ++ .../tapandpay/internal/ITapAndPayService.aidl | 39 +++++++++++++++ .../internal/ITapAndPayServiceCallbacks.aidl | 47 +++++++++++++++++ .../gms/tapandpay/issuer/TokenStatus.aidl | 3 ++ .../gms/tapandpay/TapAndPayStatusCodes.java | 19 +++++++ .../tapandpay/firstparty/TokenReference.java | 17 +++++++ .../gms/tapandpay/firstparty/TokenStatus.java | 19 +++++++ .../gms/tapandpay/issuer/TokenStatus.java | 32 ++++++++++++ play-services-tapandpay-core/build.gradle | 50 +++++++++++++++++++ .../src/main/AndroidManifest.xml | 16 ++++++ .../microg/gms/tapandpay/TapAndPayService.kt | 49 ++++++++++++++++++ settings.gradle | 2 + 21 files changed, 344 insertions(+), 85 deletions(-) delete mode 100644 play-services-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl delete mode 100644 play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayImpl.java delete mode 100644 play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayService.java create mode 100644 play-services-tapandpay-api/build.gradle create mode 100644 play-services-tapandpay-api/src/main/AndroidManifest.xml create mode 100644 play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/firstparty/TokenStatus.aidl create mode 100644 play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl create mode 100644 play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayServiceCallbacks.aidl create mode 100644 play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/issuer/TokenStatus.aidl create mode 100644 play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/TapAndPayStatusCodes.java create mode 100644 play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenReference.java create mode 100644 play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenStatus.java create mode 100644 play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/issuer/TokenStatus.java create mode 100644 play-services-tapandpay-core/build.gradle create mode 100644 play-services-tapandpay-core/src/main/AndroidManifest.xml create mode 100644 play-services-tapandpay-core/src/main/kotlin/org/microg/gms/tapandpay/TapAndPayService.kt diff --git a/play-services-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl deleted file mode 100644 index 622b0ba7..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl +++ /dev/null @@ -1,5 +0,0 @@ -package com.google.android.gms.tapandpay.internal; - -interface ITapAndPayService { - -} diff --git a/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayRequest.java b/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayRequest.java index 5af03541..2f9fde8b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayRequest.java @@ -19,13 +19,13 @@ import java.util.Collection; */ @PublicApi public class IsReadyToPayRequest extends AutoSafeParcelable { - @Field(2) + @Field(value = 2, useDirectList = true) private ArrayList allowedCardNetworks; @Field(4) private String unknown4; @Field(5) private String unknown5; - @Field(6) + @Field(value = 6, useDirectList = true) private ArrayList allowedPaymentMethods; @Field(7) private boolean existingPaymentMethodRequired; diff --git a/play-services-base-core/build.gradle b/play-services-base-core/build.gradle index 035dd5a5..6bc36bec 100644 --- a/play-services-base-core/build.gradle +++ b/play-services-base-core/build.gradle @@ -9,9 +9,9 @@ apply plugin: 'signing' dependencies { api project(':play-services-basement') + api "androidx.lifecycle:lifecycle-service:$lifecycleVersion" implementation "androidx.annotation:annotation:$annotationVersion" - implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion" } android { diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 685eb1fd..9f87ea76 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -45,9 +45,11 @@ dependencies { implementation project(':play-services-conscrypt-provider-core') implementation project(':play-services-cronet-core') implementation project(':play-services-location-core') - implementation project(':play-services-vision-core') withNearbyImplementation project(':play-services-nearby-core') withNearbyImplementation project(':play-services-nearby-core-ui') + implementation project(':play-services-tapandpay-core') + implementation project(':play-services-vision-core') + implementation project(':play-services-core-proto') implementation project(':play-services-core:microg-ui-tools') // deprecated implementation project(':play-services-api') diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 73ca617d..38092b8c 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -688,11 +688,6 @@ - - - - - diff --git a/play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayImpl.java b/play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayImpl.java deleted file mode 100644 index 40632650..00000000 --- a/play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2019 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 org.microg.gms.tapandpay; - -import com.google.android.gms.tapandpay.internal.ITapAndPayService; -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -public class TapAndPayImpl extends ITapAndPayService.Stub { - private static final String TAG = "GmsTapAndPayImpl"; - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayService.java b/play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayService.java deleted file mode 100644 index 082234e6..00000000 --- a/play-services-core/src/main/java/org/microg/gms/tapandpay/TapAndPayService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2019 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 org.microg.gms.tapandpay; - -import android.os.RemoteException; - -import com.google.android.gms.common.api.CommonStatusCodes; -import com.google.android.gms.common.internal.GetServiceRequest; -import com.google.android.gms.common.internal.IGmsCallbacks; - -import org.microg.gms.BaseService; -import org.microg.gms.common.GmsService; - -public class TapAndPayService extends BaseService { - public TapAndPayService() { - super("GmsTapAndPaySvc", GmsService.TAP_AND_PAY); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - callback.onPostInitComplete(CommonStatusCodes.SUCCESS, new TapAndPayImpl(), null); - - } -} diff --git a/play-services-tapandpay-api/build.gradle b/play-services-tapandpay-api/build.gradle new file mode 100644 index 00000000..4be043c1 --- /dev/null +++ b/play-services-tapandpay-api/build.gradle @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +// Nothing to publish yet +//apply from: '../gradle/publish-android.gradle' + +description = 'microG API for play-services-tapandpay' + +dependencies { + api project(':play-services-basement') + api project(':play-services-base-api') + + implementation "androidx.annotation:annotation:$annotationVersion" +} diff --git a/play-services-tapandpay-api/src/main/AndroidManifest.xml b/play-services-tapandpay-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..0b3e189b --- /dev/null +++ b/play-services-tapandpay-api/src/main/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + diff --git a/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/firstparty/TokenStatus.aidl b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/firstparty/TokenStatus.aidl new file mode 100644 index 00000000..16841b3f --- /dev/null +++ b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/firstparty/TokenStatus.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.tapandpay.firstparty; + +parcelable TokenStatus; diff --git a/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl new file mode 100644 index 00000000..9ee50010 --- /dev/null +++ b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl @@ -0,0 +1,39 @@ +package com.google.android.gms.tapandpay.internal; + +import com.google.android.gms.tapandpay.internal.ITapAndPayServiceCallbacks; + +interface ITapAndPayService { +// void setSelectedToken(in SetSelectedTokenRequest request, ITapAndPayServiceCallbacks callbacks) = 0; +// void getAllCards(in GetAllCardsRequest request, ITapAndPayServiceCallbacks callbacks) = 1; +// void deleteToken(in DeleteTokenRequest request, ITapAndPayServiceCallbacks callbacks) = 2; +// void firstPartyTokenizePan(in FirstPartyTokenizePanRequest request, ITapAndPayServiceCallbacks callbacks) = 3; +// void setActiveAccount(in SetActiveAccountRequest request, ITapAndPayServiceCallbacks callbacks) = 4; +// void showSecurityPrompt(in ShowSecurityPromptRequest request, ITapAndPayServiceCallbacks callbacks) = 7; +// void getActiveAccount(in GetActiveAccountRequest request, ITapAndPayServiceCallbacks callbacks) = 8; + void registerDataChangedListener(ITapAndPayServiceCallbacks callbacks) = 9; +// void isDeviceUnlockedForPayment(in IsDeviceUnlockedForPaymentRequest request, ITapAndPayServiceCallbacks callbacks) = 10; +// void promptDeviceUnlockForPayment(in PromptDeviceUnlockForPaymentRequest request, ITapAndPayServiceCallbacks callbacks) = 11; +// void sendTapEvent(in SendTapEventRequest request, ITapAndPayServiceCallbacks callbacks) = 12; +// void getReceivesTransactionNotification(in GetReceivesTransactionNotificationsRequest request, ITapAndPayServiceCallbacks callbacks) = 13; +// void setReceivesTransactionNotification(in SetReceivesTransactionNotificationsRequest request, ITapAndPayServiceCallbacks callbacks) = 14; +// void retrieveInAppPaymentCredential(in RetrieveInAppPaymentCredentialRequest request, ITapAndPayServiceCallbacks callbacks) = 15; +// void getActiveCardsForAccount(in GetActiveCardsForAccountRequest request, ITapAndPayServiceCallbacks callbacks) = 17; +// void getAnalyticsContext(ITapAndPayServiceCallbacks callbacks) = 19; +// void getActiveWalletId(ITapAndPayServiceCallbacks callbacks) = 20; + void getTokenStatus(int tokenProvider, String issuerTokenId, ITapAndPayServiceCallbacks callbacks) = 21; +// void issuerTokenize(int tokenProvider, String issuerTokenId, String s2, ITapAndPayServiceCallbacks callbacks) = 22; +// void requestSelectToken(int tokenProvider, String issuerTokenId, ITapAndPayServiceCallbacks callbacks) = 23; +// void requestDeleteToken(int tokenProvider, String issuerTokenId, ITapAndPayServiceCallbacks callbacks) = 24; +// void isDeviceUnlockedForInAppPayment(in IsDeviceUnlockedForInAppPaymentRequest request, ITapAndPayServiceCallbacks callbacks) = 25; +// void reportInAppTransactionCompleted(in ReportInAppTransactionCompletedRequest request, ITapAndPayServiceCallbacks callbacks) = 26; +// void pushTokenize(in PushTokenizeRequest request, ITapAndPayServiceCallbacks callbacks) = 27; +// void createWallet(ITapAndPayServiceCallbacks callbacks) = 28; + void getStableHardwareId(ITapAndPayServiceCallbacks callbacks) = 29; +// void getEnvironment(ITapAndPayServiceCallbacks callbacks) = 30; +// void enablePayOnWear(in EnablePayOnWearRequest request, ITapAndPayServiceCallbacks callbacks) = 31; +// void isPayPalAvailable(ITapAndPayServiceCallbacks callbacks) = 32; +// void unknown34(ITapAndPayServiceCallbacks callbacks) = 33; +// void getSecurityParams(ITapAndPayServiceCallbacks callbacks) = 34; +// void getNotificationSettings(in GetNotificationSettingsRequest request, ITapAndPayServiceCallbacks callbacks) = 36; +// void setNotificationSettings(in SetNotificationSettingsRequest request, ITapAndPayServiceCallbacks callbacks) = 37; +} diff --git a/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayServiceCallbacks.aidl b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayServiceCallbacks.aidl new file mode 100644 index 00000000..980d3657 --- /dev/null +++ b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayServiceCallbacks.aidl @@ -0,0 +1,47 @@ +package com.google.android.gms.tapandpay.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.tapandpay.issuer.TokenStatus; + +interface ITapAndPayServiceCallbacks { + void onSetSelectedTokenResponse(in Status status) = 1; + void onStatus3(in Status status, in Bundle data) = 2; +// void onGetAllCardsResponse(in Status status, in GetAllCardsResponse response) = 3; + void onDeleteTokenResponse(in Status status) = 4; + void onSetActiveAccountResponse(in Status status) = 5; +// void onGetActiveAccountResponse(in Status status, in GetActiveAccountResponse response) = 7; + void onStatus9(in Status status) = 8; + void onReturn10() = 9; + void onIsDeviceUnlockedForPaymentResponse(in Status status, boolean isDeviceUnlockedForPayment) = 10; + void onStatus12(in Status status) = 11; + void onGetReceivesTransactionNotificationsResponse(in Status status, boolean receivesTransactionNotifications) = 12; + void onSetReceivesTransactionNotificationsResponse(in Status status) = 13; +// void onGetActiveCardsForAccountResponse(in Status status, in GetActiveCardsForAccountResponse response) = 14; +// void onRetrieveInAppPaymentCredentialResponse(in Status status, in RetrieveInAppPaymentCredentialResponse response) = 16; + void onGetAnalyticsContextResponse(in Status status, String analyticsContext) = 17; + void onTokenStatus(in Status status, in TokenStatus tokenStatus) = 19; + void onIsDeviceUnlockedForInAppPaymentResponse(in Status status, boolean isDeviceUnlockedForInAppPayment) = 20; + void onReportInAppTransactionCompletedResponse(in Status status) = 21; + void onGetStableHardwareIdResponse(in Status status, String stableHardwareId) = 22; + void onGetEnvironmentResponse(in Status status, String env) = 23; + void onEnablePayOnWearResponse(in Status status) = 24; + void onIsPayPalAvailableResponse(in Status status, boolean IsPayPalAvailable) = 25; +// void onGetSecurityParamsResponse(in Status status, in GetSecurityParamsResponse response) = 26; +// void onGetNotificationSettingsResponse(in Status status, in GetNotificationSettingsResponse response) = 27; + void onSetNotificationSettingsResponse(in Status status) = 28; +// void onGetAvailableOtherPaymentMethodsResponse(in Status status, in GetAvailableOtherPaymentMethodsResponse response) = 29; +// void onGetActiveTokensForAccountResponse(in Status status, in GetActiveTokensForAccountResponse response) = 30; +// void onGetSeChipTransactionsResponse(in Status status, in GetSeChipTransactionsResponse response) = 34; +// void onReserveResourceResponse(in Status status, in ReserveResourceResponse response) = 35; + void onReleaseResourceResponse(in Status status) = 36; + void onDisableSelectedTokenResponse(in Status status) = 37; +// void onGetFelicaTosAcceptanceResponse(in Status status, in GetFelicaTosAcceptanceResponse response) = 38; + void onSetFelicaTosAcceptanceResponse(in Status status) = 39; +// void onRefreshSeCardsResponse(in Status status, in RefreshSeCardsResponse response) = 40; +// void onGetGlobalActionCardsResponse(in Status status, in GetGlobalActionCardsResponse response) = 41; + void onGetLinkingTokenResponse(in Status status, String linkingToken) = 42; + void onBlockPaymentCardsResponse(in Status status) = 43; + void onUnblockPaymentCardsResponse(in Status status) = 44; +// void onGetLastAttestationResultResponse(in Status status, in GetLastAttestationResultResponse response) = 45; +// void onQuickAccessWalletConfig(in Status status, in QuickAccessWalletConfig config) = 46; +} diff --git a/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/issuer/TokenStatus.aidl b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/issuer/TokenStatus.aidl new file mode 100644 index 00000000..b23fc997 --- /dev/null +++ b/play-services-tapandpay-api/src/main/aidl/com/google/android/gms/tapandpay/issuer/TokenStatus.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.tapandpay.issuer; + +parcelable TokenStatus; diff --git a/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/TapAndPayStatusCodes.java b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/TapAndPayStatusCodes.java new file mode 100644 index 00000000..368c58d8 --- /dev/null +++ b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/TapAndPayStatusCodes.java @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.tapandpay; + +import com.google.android.gms.common.api.CommonStatusCodes; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public class TapAndPayStatusCodes extends CommonStatusCodes { + public static final int TAP_AND_PAY_NO_ACTIVE_WALLET = 15002; + public static final int TAP_AND_PAY_TOKEN_NOT_FOUND = 15003; + public static final int TAP_AND_PAY_INVALID_TOKEN_STATE = 15004; + public static final int TAP_AND_PAY_ATTESTATION_ERROR = 15005; + public static final int TAP_AND_PAY_UNAVAILABLE = 15009; +} diff --git a/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenReference.java b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenReference.java new file mode 100644 index 00000000..cd04c662 --- /dev/null +++ b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenReference.java @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.tapandpay.firstparty; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TokenReference extends AutoSafeParcelable { + @Field(2) + public String tokenReferenceId; + @Field(3) + public int tokenProvider; + + public static final Creator CREATOR = new AutoCreator<>(TokenReference.class); +} diff --git a/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenStatus.java b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenStatus.java new file mode 100644 index 00000000..213a804d --- /dev/null +++ b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/firstparty/TokenStatus.java @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.tapandpay.firstparty; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TokenStatus extends AutoSafeParcelable { + @Field(2) + public TokenReference tokenReference; + @Field(3) + public int tokenState; + @Field(4) + public boolean isSelected; + + public static final Creator CREATOR = new AutoCreator<>(TokenStatus.class); +} diff --git a/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/issuer/TokenStatus.java b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/issuer/TokenStatus.java new file mode 100644 index 00000000..e4429af9 --- /dev/null +++ b/play-services-tapandpay-api/src/main/java/com/google/android/gms/tapandpay/issuer/TokenStatus.java @@ -0,0 +1,32 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.tapandpay.issuer; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; + +@PublicApi +public class TokenStatus extends AutoSafeParcelable { + @Field(2) + @PublicApi(exclude = true) + public String issuerTokenId; + @Field(3) + @PublicApi(exclude = true) + private int tokenState; + @Field(4) + @PublicApi(exclude = true) + private boolean isSelected; + + public int getTokenState() { + return tokenState; + } + + public boolean isSelected() { + return isSelected; + } + + public static final Creator CREATOR = new AutoCreator<>(TokenStatus.class); +} diff --git a/play-services-tapandpay-core/build.gradle b/play-services-tapandpay-core/build.gradle new file mode 100644 index 00000000..5faa9b60 --- /dev/null +++ b/play-services-tapandpay-core/build.gradle @@ -0,0 +1,50 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +dependencies { + api project(':play-services-tapandpay-api') + + implementation project(':play-services-base-core') + + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion" +} + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + sourceSets { + main { + java.srcDirs = ['src/main/kotlin'] + } + } + + lintOptions { + disable 'MissingTranslation' + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +// Nothing to publish yet +//apply from: '../gradle/publish-android.gradle' + +description = 'microG service implementation for play-services-tapandpay' diff --git a/play-services-tapandpay-core/src/main/AndroidManifest.xml b/play-services-tapandpay-core/src/main/AndroidManifest.xml new file mode 100644 index 00000000..64ee486c --- /dev/null +++ b/play-services-tapandpay-core/src/main/AndroidManifest.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/play-services-tapandpay-core/src/main/kotlin/org/microg/gms/tapandpay/TapAndPayService.kt b/play-services-tapandpay-core/src/main/kotlin/org/microg/gms/tapandpay/TapAndPayService.kt new file mode 100644 index 00000000..0a08696b --- /dev/null +++ b/play-services-tapandpay-core/src/main/kotlin/org/microg/gms/tapandpay/TapAndPayService.kt @@ -0,0 +1,49 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package org.microg.gms.tapandpay + +import android.os.Parcel +import android.os.RemoteException +import android.util.Log +import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.common.api.Status +import com.google.android.gms.common.internal.GetServiceRequest +import com.google.android.gms.common.internal.IGmsCallbacks +import com.google.android.gms.tapandpay.TapAndPayStatusCodes.TAP_AND_PAY_NO_ACTIVE_WALLET +import com.google.android.gms.tapandpay.internal.ITapAndPayService +import com.google.android.gms.tapandpay.internal.ITapAndPayServiceCallbacks +import org.microg.gms.BaseService +import org.microg.gms.common.GmsService + +private const val TAG = "GmsTapAndPay" + +class TapAndPayService : BaseService(TAG, GmsService.TAP_AND_PAY) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + callback.onPostInitComplete(CommonStatusCodes.SUCCESS, TapAndPayImpl(), null) + } +} + +class TapAndPayImpl : ITapAndPayService.Stub() { + override fun registerDataChangedListener(callbacks: ITapAndPayServiceCallbacks) { + Log.d(TAG, "registerDataChangedListener()") + callbacks.onStatus9(Status.SUCCESS) + } + + override fun getTokenStatus(tokenProvider: Int, issuerTokenId: String, callbacks: ITapAndPayServiceCallbacks) { + Log.d(TAG, "getTokenStatus($tokenProvider, $issuerTokenId)") + callbacks.onTokenStatus(Status(TAP_AND_PAY_NO_ACTIVE_WALLET), null) + } + + override fun getStableHardwareId(callbacks: ITapAndPayServiceCallbacks) { + Log.d(TAG, "getStableHardwareId()") + callbacks.onGetStableHardwareIdResponse(Status.SUCCESS, "") + } + + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean { + if (super.onTransact(code, data, reply, flags)) return true + Log.d(TAG, "onTransact [unknown]: $code, $data, $flags") + return false + } +} diff --git a/settings.gradle b/settings.gradle index f6a792a3..23264525 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,6 +10,7 @@ include ':play-services-droidguard-api' include ':play-services-iid-api' include ':play-services-location-api' include ':play-services-nearby-api' +include ':play-services-tapandpay-api' include ':play-services-vision-api' include ':play-services-vision-common-api' include ':play-services-wearable-api' @@ -28,6 +29,7 @@ include ':play-services-maps-core-mapbox' include ':play-services-maps-core-vtm' include ':play-services-maps-core-vtm:vtm-microg-theme' include ':play-services-nearby-core' +include ':play-services-tapandpay-core' include ':play-services-vision-core' include ':play-services-base-core-ui' From 28d82eff0420a6491640ba4f57b5112fb60c8a89 Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 27 Jun 2021 21:04:15 +0200 Subject: [PATCH 4/6] Exposure Notifications: Request permissions for Android 12 Beta --- play-services-nearby-core/src/main/AndroidManifest.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/play-services-nearby-core/src/main/AndroidManifest.xml b/play-services-nearby-core/src/main/AndroidManifest.xml index 83898a23..c04bacee 100644 --- a/play-services-nearby-core/src/main/AndroidManifest.xml +++ b/play-services-nearby-core/src/main/AndroidManifest.xml @@ -11,6 +11,9 @@ + + + From 19af72d14ace6b7ce7ef590e87547628f6471a43 Mon Sep 17 00:00:00 2001 From: Oizaro <75915943+Oizaro@users.noreply.github.com> Date: Sun, 27 Jun 2021 21:53:47 +0200 Subject: [PATCH 5/6] Update to latest upstream --- .gitignore | 6 ++- build.gradle | 1 + .../api/credentials/CredentialRequest.java | 2 + play-services-core/build.gradle | 3 +- .../src/main/AndroidManifest.xml | 9 +++- .../chimera/container/DynamiteContext.java | 27 ++++++---- .../{ui => auth}/CredentialPickerActivity.kt | 2 +- .../org/microg/gms/auth/CredentialsService.kt | 53 +++++++++++++++++++ play-services-cronet-core/build.gradle | 34 ++++++++++++ .../src/main/AndroidManifest.xml | 11 ++++ .../gms/cronet_dynamite/ModuleDescriptor.java | 37 +++++++++++++ settings.gradle | 2 + 12 files changed, 171 insertions(+), 16 deletions(-) rename play-services-core/src/main/kotlin/org/microg/gms/{ui => auth}/CredentialPickerActivity.kt (98%) create mode 100644 play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt create mode 100644 play-services-cronet-core/build.gradle create mode 100644 play-services-cronet-core/src/main/AndroidManifest.xml create mode 100644 play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java diff --git a/.gitignore b/.gitignore index 6932dd10..ec5fff5e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,8 @@ build/ user.gradle local.properties .directory -play-services-core/release \ No newline at end of file +play-services-core/release + +.settings +.classpath +.project \ No newline at end of file diff --git a/build.gradle b/build.gradle index 6b3fc1e3..ab8b41f9 100644 --- a/build.gradle +++ b/build.gradle @@ -4,6 +4,7 @@ */ buildscript { + ext.cronetVersion = '91.0.4472.120' ext.safeParcelVersion = '1.7.0' ext.kotlinVersion = '1.4.32' diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java index 35340b01..d5cbf928 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java @@ -32,6 +32,8 @@ public class CredentialRequest extends AutoSafeParcelable { @Field(4) private CredentialPickerConfig credentialHintPickerConfig; + private CredentialRequest() { } + public CredentialRequest(boolean passwordLoginSupported, String[] accountTypes, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialHintPickerConfig) { this.passwordLoginSupported = passwordLoginSupported; this.accountTypes = accountTypes; diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index fe05de71..1e6f0b93 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -26,6 +26,7 @@ dependencies { // implementation "su.litvak.chromecast:api-v2:0.10.4" implementation "info.armills.chromecast-java-api-v2:api-v2-raw-request:0.10.4-raw-request-1" + implementation project(':play-services-cronet-core') implementation project(':play-services-core-proto') implementation project(':play-services-core:microg-ui-tools') // deprecated implementation project(':play-services-api') @@ -62,7 +63,7 @@ android { targetSdkVersion androidTargetSdk ndk { - abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" + abiFilters "armeabi-v7a", "arm64-v8a", "x86" } } diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 95cbc125..1447b73a 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -277,7 +277,7 @@ android:exported="true" /> @@ -285,6 +285,12 @@ + + + + + + @@ -470,7 +476,6 @@ - diff --git a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java index 7f104fbe..8484447b 100644 --- a/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java +++ b/play-services-core/src/main/java/com/google/android/gms/chimera/container/DynamiteContext.java @@ -28,6 +28,8 @@ public class DynamiteContext extends ContextWrapper { private Context gmsContext; private DynamiteContext appContext; + private ClassLoader classLoader; + public DynamiteContext(DynamiteModuleInfo moduleInfo, Context base, Context gmsContext, DynamiteContext appContext) { super(base); this.moduleInfo = moduleInfo; @@ -38,19 +40,22 @@ public class DynamiteContext extends ContextWrapper { @Override public ClassLoader getClassLoader() { - StringBuilder nativeLoaderDirs = new StringBuilder(gmsContext.getApplicationInfo().nativeLibraryDir); - if (Build.VERSION.SDK_INT >= 23 && Process.is64Bit()) { - for (String abi : Build.SUPPORTED_64_BIT_ABIS) { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); + if (classLoader == null) { + StringBuilder nativeLoaderDirs = new StringBuilder(gmsContext.getApplicationInfo().nativeLibraryDir); + if (Build.VERSION.SDK_INT >= 23 && Process.is64Bit()) { + for (String abi : Build.SUPPORTED_64_BIT_ABIS) { + nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); + } + } else if (Build.VERSION.SDK_INT >= 21) { + for (String abi : Build.SUPPORTED_32_BIT_ABIS) { + nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); + } + } else { + nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(Build.CPU_ABI); } - } else if (Build.VERSION.SDK_INT >= 21) { - for (String abi : Build.SUPPORTED_32_BIT_ABIS) { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(abi); - } - } else { - nativeLoaderDirs.append(File.pathSeparator).append(gmsContext.getApplicationInfo().sourceDir).append("!/lib/").append(Build.CPU_ABI); + classLoader = new PathClassLoader(gmsContext.getApplicationInfo().sourceDir, nativeLoaderDirs.toString(), new FilteredClassLoader(originalContext.getClassLoader(), moduleInfo.getMergedClasses(), moduleInfo.getMergedPackages())); } - return new PathClassLoader(gmsContext.getApplicationInfo().sourceDir, nativeLoaderDirs.toString(), new FilteredClassLoader(originalContext.getClassLoader(), moduleInfo.getMergedClasses(), moduleInfo.getMergedPackages())); + return classLoader; } @Override diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/CredentialPickerActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt similarity index 98% rename from play-services-core/src/main/kotlin/org/microg/gms/ui/CredentialPickerActivity.kt rename to play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt index 1209a900..ee7d332f 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/CredentialPickerActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package org.microg.gms.ui +package org.microg.gms.auth import android.app.Activity import android.os.Bundle diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt new file mode 100644 index 00000000..e50c5e9e --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt @@ -0,0 +1,53 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.auth + +import android.os.Bundle +import android.util.Log +import com.google.android.gms.auth.api.credentials.CredentialRequest +import com.google.android.gms.auth.api.credentials.internal.* +import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.common.api.Status +import com.google.android.gms.common.internal.GetServiceRequest +import com.google.android.gms.common.internal.IGmsCallbacks +import org.microg.gms.BaseService +import org.microg.gms.common.GmsService + +const val TAG = "GmsCredentials" + +class CredentialsService : BaseService(TAG, GmsService.CREDENTIALS) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + callback.onPostInitComplete(CommonStatusCodes.SUCCESS, CredentialsServiceImpl(), Bundle()) + } +} + +class CredentialsServiceImpl : ICredentialsService.Stub() { + override fun request(callbacks: ICredentialsCallbacks, request: CredentialRequest) { + Log.d(TAG, "request($request)") + callbacks.onStatus(Status.CANCELED) + } + + override fun save(callbacks: ICredentialsCallbacks, request: SaveRequest) { + Log.d(TAG, "save($request)") + callbacks.onStatus(Status.CANCELED) + } + + override fun delete(callbacks: ICredentialsCallbacks, request: DeleteRequest) { + Log.d(TAG, "delete($request)") + callbacks.onStatus(Status.CANCELED) + } + + override fun disableAutoSignIn(callbacks: ICredentialsCallbacks) { + Log.d(TAG, "disableAutoSignIn()") + callbacks.onStatus(Status.SUCCESS) + } + + override fun generatePassword(callbacks: ICredentialsCallbacks, request: GeneratePasswordRequest) { + Log.d(TAG, "generatePassword($request)") + callbacks.onStatus(Status.SUCCESS) + } + +} \ No newline at end of file diff --git a/play-services-cronet-core/build.gradle b/play-services-cronet-core/build.gradle new file mode 100644 index 00000000..9c0b280b --- /dev/null +++ b/play-services-cronet-core/build.gradle @@ -0,0 +1,34 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' +apply plugin: 'maven-publish' +apply plugin: 'signing' + +dependencies { + implementation("org.microg:cronet-api:$cronetVersion") + implementation("org.microg:cronet-common:$cronetVersion") + implementation("org.microg:cronet-native:$cronetVersion") +} + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + lintOptions { + disable 'MissingTranslation' + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} diff --git a/play-services-cronet-core/src/main/AndroidManifest.xml b/play-services-cronet-core/src/main/AndroidManifest.xml new file mode 100644 index 00000000..93245ce8 --- /dev/null +++ b/play-services-cronet-core/src/main/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java b/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java new file mode 100644 index 00000000..c46af5c9 --- /dev/null +++ b/play-services-cronet-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/cronet_dynamite/ModuleDescriptor.java @@ -0,0 +1,37 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.dynamite.descriptors.com.google.android.gms.cronet_dynamite; + +import java.util.Arrays; +import java.util.List; + +public class ModuleDescriptor { + public static final String MODULE_ID = "com.google.android.gms.cronet_dynamite"; + public static final int MODULE_VERSION = 2; + public static final List MERGED_CLASSES = Arrays.asList( + "org.chromium.net.ApiVersion", + "org.chromium.net.BidirectionalStream", + "org.chromium.net.CallbackException", + "org.chromium.net.CronetEngine", + "org.chromium.net.CronetException", + "org.chromium.net.CronetProvider", + "org.chromium.net.ExperimentalBidirectionalStream", + "org.chromium.net.ExperimentalCronetEngine", + "org.chromium.net.ExperimentalUrlRequest", + "org.chromium.net.ICronetEngineBuilder", + "org.chromium.net.InlineExecutionProhibitedException", + "org.chromium.net.NetworkException", + "org.chromium.net.NetworkQualityRttListener", + "org.chromium.net.NetworkQualityThroughputListener", + "org.chromium.net.QuicException", + "org.chromium.net.RequestFinishedInfo", + "org.chromium.net.UploadDataProvider", + "org.chromium.net.UploadDataProviders", + "org.chromium.net.UploadDataSink", + "org.chromium.net.UrlRequest", + "org.chromium.net.UrlResponseInfo" + ); +} diff --git a/settings.gradle b/settings.gradle index cd6649aa..9ce0de99 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,6 +12,8 @@ include ':play-services-api' include ':play-services-core-proto' +include ':play-services-cronet-core' + include ':play-services-core:microg-ui-tools' // Legacy include ':play-services-core' From 9554db9dd7e6ae3afee534965110735592dddbba Mon Sep 17 00:00:00 2001 From: Oizaro <75915943+Oizaro@users.noreply.github.com> Date: Sun, 27 Jun 2021 22:09:37 +0200 Subject: [PATCH 6/6] MicroG 0.2.20.212415 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index ab8b41f9..b2439556 100644 --- a/build.gradle +++ b/build.gradle @@ -46,8 +46,8 @@ allprojects { apply plugin: 'idea' group = 'org.microg.gms' - version = "0.2.19.211712" - ext.appVersionCode = 211712001 + version = "0.2.20.212415" + ext.appVersionCode = 212415001 ext.isReleaseVersion = false }