AppCert: Update for latest API 3a42d956ab
This commit is contained in:
parent
10a29689c1
commit
21e75291fe
3 changed files with 22 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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<CertData> googleCertificates = Collections.emptySet();
|
||||
private Set<CertData> 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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue