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
9a421be3
Commit
9a421be3
authored
Aug 26, 2021
by
narinder Rana
Browse files
get package name from APK file
parent
454f1297
Pipeline
#131974
failed with stage
in 3 minutes and 21 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/apps/application/model/IntegrityVerificationTask.kt
View file @
9a421be3
...
...
@@ -61,9 +61,10 @@ class IntegrityVerificationTask(
override
fun
doInBackground
(
vararg
context
:
Context
):
Context
{
try
{
verificationSuccessful
=
if
(
isSystemApplication
(
fullData
.
packageName
))
{
var
packageName
=
getAPK_PackageName
(
context
[
0
]);
verificationSuccessful
=
if
(
isSystemApplication
(
packageName
.
toString
()))
{
verifyAPKSignature
(
context
[
0
])
}
else
if
(
isfDroidApplication
(
fullData
.
packageName
))
{
}
else
if
(
isfDroidApplication
(
packageName
.
toString
()
))
{
verifyFdroidSignature
(
context
[
0
])
}
else
{
checkGoogleApp
(
context
[
0
])
...
...
@@ -120,7 +121,7 @@ class IntegrityVerificationTask(
return
null
}
private
fun
verifySystemValues
(
context
:
Context
):
Boolean
{
private
fun
getAPK_PackageName
(
context
:
Context
):
String
?
{
val
pm
:
PackageManager
=
context
.
packageManager
val
fullPath
:
String
=
applicationInfo
.
getApkFile
(
...
...
@@ -129,10 +130,12 @@ class IntegrityVerificationTask(
).
absolutePath
val
info
=
pm
.
getPackageArchiveInfo
(
fullPath
,
0
)
if
(
info
!=
null
)
{
Log
.
e
(
"TAG"
,
".................."
+
info
.
packageName
)
Log
.
e
(
"TAG"
,
".................."
+
info
.
signatures
)
return
info
.
packageName
;
}
return
false
else
return
null
;
}
private
fun
getFirstSignature
(
pkg
:
PackageInfo
?):
Signature
?
{
...
...
Write
Preview
Markdown
is supported
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