diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl index da539f32..c75982bb 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl @@ -4,7 +4,7 @@ import com.google.android.gms.common.internal.GoogleCertificatesQuery; import com.google.android.gms.dynamic.IObjectWrapper; interface IGoogleCertificatesApi { - IObjectWrapper getGoogleCertficates(); + IObjectWrapper getGoogleCertificates(); IObjectWrapper getGoogleReleaseCertificates(); boolean isGoogleReleaseSigned(String packageName, IObjectWrapper certData); boolean isGoogleSigned(String packageName, IObjectWrapper certData); diff --git a/play-services-core/src/main/java/com/google/android/gms/common/GoogleCertificatesImpl.java b/play-services-core/src/main/java/com/google/android/gms/common/GoogleCertificatesImpl.java index 7ab30bc3..948361f0 100644 --- a/play-services-core/src/main/java/com/google/android/gms/common/GoogleCertificatesImpl.java +++ b/play-services-core/src/main/java/com/google/android/gms/common/GoogleCertificatesImpl.java @@ -17,11 +17,13 @@ package com.google.android.gms.common; import android.content.pm.PackageManager; +import android.os.IBinder; import android.os.RemoteException; import android.util.Log; import androidx.annotation.Keep; +import com.google.android.gms.common.internal.CertData; import com.google.android.gms.common.internal.GoogleCertificatesQuery; import com.google.android.gms.common.internal.IGoogleCertificatesApi; import com.google.android.gms.dynamic.IObjectWrapper; @@ -29,20 +31,25 @@ import com.google.android.gms.dynamic.ObjectWrapper; import org.microg.gms.common.PackageUtils; +import java.util.Collections; +import java.util.Set; + @Keep public class GoogleCertificatesImpl extends IGoogleCertificatesApi.Stub { private static final String TAG = "GmsCertImpl"; + private Set googleCertificates = Collections.emptySet(); + private Set googleReleaseCertificates = Collections.emptySet(); @Override - public IObjectWrapper getGoogleCertficates() throws RemoteException { - Log.d(TAG, "unimplemented Method: getGoogleCertficates"); - return null; + public IObjectWrapper getGoogleCertificates() throws RemoteException { + Log.d(TAG, "unimplemented Method: getGoogleCertificates"); + return ObjectWrapper.wrap(googleCertificates.toArray(new IBinder[0])); } @Override public IObjectWrapper getGoogleReleaseCertificates() throws RemoteException { Log.d(TAG, "unimplemented Method: getGoogleReleaseCertificates"); - return null; + return ObjectWrapper.wrap(googleReleaseCertificates.toArray(new IBinder[0])); } @Override diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertManager.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertManager.kt index 3120a555..7ae44173 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertManager.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertManager.kt @@ -96,7 +96,11 @@ class AppCertManager(private val context: Context) { } override fun deliverError(error: VolleyError) { - Log.d(TAG, "Error: ${Base64.encodeToString(error.networkResponse.data, 2)}") + if (error.networkResponse != null) { + Log.d(TAG, "Error: ${Base64.encodeToString(error.networkResponse.data, 2)}") + } else { + Log.d(TAG, "Error: ${error.message}") + } deviceKeyCacheTime = 0 deferredResponse.complete(null) } @@ -149,14 +153,19 @@ class AppCertManager(private val context: Context) { ) } else { Log.d(TAG, "Using fallback spatula header based on Android ID") +<<<<<<< HEAD val androidId = CheckIn.getContentUri(context)?.let { getSettings(context, it, arrayOf(CheckIn.ANDROID_ID, CheckIn.SECURITY_TOKEN)) { cursor: Cursor -> cursor.getLong(0) } } +======= + val androidId = getSettings(context, CheckIn.getContentUri(context), arrayOf(CheckIn.ANDROID_ID)) { cursor: Cursor -> cursor.getLong(0) } +>>>>>>> dc5ec8f7 (AppCert: Update for latest API https://github.com/microg/GmsCore/commit/3a42d956abb017e35d30204c556afcc29cb8a636) SpatulaHeaderProto( packageInfo = SpatulaHeaderProto.PackageInfo(packageName, packageCertificateHash), deviceId = androidId ) + return null // TODO } Log.d(TAG, "Spatula Header: $proto") return Base64.encodeToString(proto.encode(), Base64.NO_WRAP)