mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-16 07:45:06 +00:00
added a check for session id in root installer
This commit is contained in:
parent
85e2d0c5c2
commit
f7d90b7c59
1 changed files with 9 additions and 2 deletions
|
@ -299,10 +299,17 @@ object PackageHelper {
|
|||
}
|
||||
}
|
||||
|
||||
private fun installSplitApkFilesRoot(apkFiles: List<File>?, context: Context) : Boolean {
|
||||
private fun installSplitApkFilesRoot(apkFiles: List<File>?, context: Context): Boolean {
|
||||
val filenames = arrayOf("black.apk", "dark.apk", "blue.apk", "pink.apk", "hash.json")
|
||||
log(INSTALLER_TAG, "installing split apk files: ${apkFiles?.map { it.name }}")
|
||||
val sessionId = Shell.su("pm install-create -r").exec().out.joinToString(" ").filter { it.isDigit() }.toInt()
|
||||
val sessionId = Shell.su("pm install-create -r").exec().out.joinToString(" ").filter { it.isDigit() }.toIntOrNull()
|
||||
|
||||
if (sessionId == null) {
|
||||
sendFailure("Session ID is null", context)
|
||||
sendCloseDialog(context)
|
||||
return false
|
||||
}
|
||||
|
||||
apkFiles?.filter { !filenames.contains(it.name) }?.forEach { apkFile ->
|
||||
val apkName = apkFile.name
|
||||
log(INSTALLER_TAG, "installing APK: $apkName")
|
||||
|
|
Loading…
Reference in a new issue