Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
App Lounge
Commits
6e869802
Commit
6e869802
authored
Mar 17, 2021
by
narinder Rana
Browse files
Toast message test
parent
ebbe52cc
Changes
2
Show whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/apps/application/model/IntegrityVerificationTask.kt
View file @
6e869802
...
...
@@ -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
;
...
...
app/src/main/res/values/strings.xml
View file @
6e869802
...
...
@@ -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>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment