Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 2bb0a9c4 authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Integrity: Fix some names and error handling

parent 8de2afc7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
package com.google.android.play.core.integrity.protocol;

interface IExpressIntegrityServiceCallback {
    void OnWarmUpIntegrityTokenCallback(in Bundle bundle) = 1;
    void onWarmUpExpressIntegrityToken(in Bundle bundle) = 1;
    void onRequestExpressIntegrityToken(in Bundle bundle) = 2;
    void onRequestIntegrityToken(in Bundle bundle) = 3;
}
+1 −0
Original line number Diff line number Diff line
@@ -11,4 +11,5 @@ import com.google.android.play.core.integrity.protocol.IRequestDialogCallback;
interface IIntegrityService {
    void requestDialog(in Bundle bundle, in IRequestDialogCallback callback) = 0;
    void requestIntegrityToken(in Bundle request, in IIntegrityServiceCallback callback) = 1;
    void requestAndShowDialog(in Bundle bundle, in IRequestDialogCallback callback) = 2;
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -6,5 +6,5 @@
package com.google.android.play.core.integrity.protocol;

interface IIntegrityServiceCallback {
    void onResult(in Bundle bundle) = 1;
    void onRequestIntegrityToken(in Bundle bundle) = 1;
}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -6,5 +6,5 @@
package com.google.android.play.core.integrity.protocol;

interface IRequestDialogCallback {
    void onRequestAndShowDialog(in Bundle bundle);
    void onRequestDialog(in Bundle bundle);
}
 No newline at end of file
+2 −3
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ import android.content.Context
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
import android.content.pm.Signature
import android.os.Binder
import android.os.Bundle
import android.security.keystore.KeyGenParameterSpec
import android.security.keystore.KeyProperties
@@ -145,7 +144,7 @@ fun ByteArray.sha256(): ByteArray {
    return MessageDigest.getInstance("SHA-256").digest(this)
}

fun Bundle.buildPlayCoreVersion() = PlayCoreVersion(
fun Bundle.getPlayCoreVersion() = PlayCoreVersion(
    major = getInt(KEY_VERSION_MAJOR, 0), minor = getInt(KEY_VERSION_MINOR, 0), patch = getInt(KEY_VERSION_PATCH, 0)
)

@@ -170,7 +169,7 @@ suspend fun getIntegrityRequestWrapper(context: Context, expressIntegritySession
    }
    val expressFilePB = FileInputStream(context.getProtoFile()).use { input -> ExpressFilePB.ADAPTER.decode(input) }
    expressFilePB.integrityRequestWrapper.filter { item ->
        TextUtils.equals(item.packageName, expressIntegritySession.packageName) && item.cloudProjectNumber == expressIntegritySession.cloudProjectVersion && getUpdatedWebViewRequestMode(
        TextUtils.equals(item.packageName, expressIntegritySession.packageName) && item.cloudProjectNumber == expressIntegritySession.cloudProjectNumber && getUpdatedWebViewRequestMode(
            expressIntegritySession.webViewRequestMode
        ) == getUpdatedWebViewRequestMode(
            item.webViewRequestMode ?: 0
Loading