0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-25 12:45:12 +00:00

added back a fix for split installer

This commit is contained in:
X1nto 2021-04-18 14:56:51 +04:00
parent 4b645ef1c0
commit aeaa0d445e

View file

@ -302,7 +302,14 @@ object PackageHelper {
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").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")