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

Commit 6e869802 authored by narinder Rana's avatar narinder Rana
Browse files

Toast message test

parent ebbe52cc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -19,6 +19,8 @@ package foundation.e.apps.application.model

import android.content.Context
import android.os.AsyncTask
import android.widget.Toast
import foundation.e.apps.R
import foundation.e.apps.application.model.data.FullData
import foundation.e.apps.utils.Constants
import org.bouncycastle.jce.provider.BouncyCastleProvider
@@ -53,6 +55,7 @@ class IntegrityVerificationTask(
            } else {
                Security.addProvider(BouncyCastleProvider())
                verifyAPKSignature(
                        context[0],
                        BufferedInputStream(FileInputStream(
                                applicationInfo.getApkFile(context[0],
                                        fullData.basicData).absolutePath)),
@@ -88,6 +91,7 @@ class IntegrityVerificationTask(
    }

    private fun verifyAPKSignature(
            context: Context,
            apkInputStream: BufferedInputStream,
            apkSignatureInputStream: InputStream,
            publicKeyInputStream: InputStream): Boolean {
@@ -125,12 +129,12 @@ class IntegrityVerificationTask(
            apkInputStream.close()
            apkSignatureInputStream.close()
            publicKeyInputStream.close()

            Toast.makeText(context, R.string.Signature_verification_failed, Toast.LENGTH_LONG).show();
            return signature.verify()
        } catch (e: Exception) {
            e.printStackTrace()
            //Toast message if we want to show message to user

            Toast.makeText(context, R.string.Signature_verification_failed, Toast.LENGTH_LONG).show();
        }
        return false;

+5 −0
Original line number Diff line number Diff line
@@ -184,4 +184,9 @@
    <string name="microg_not_installed">Not Installed</string>
    <string name="microg_installed">Installed</string>


    <string name="Signature_verification_failed">Signature verification failed, aborting install</string>



</resources>