Root Installer Fix v9001

This commit is contained in:
ostajic 2020-10-03 21:52:57 +02:00
parent 76bfb8ae93
commit 84a525c3ef
1 changed files with 9 additions and 6 deletions

View File

@ -348,7 +348,7 @@ object PackageHelper {
private fun setupScript(apkFPath: String, path: String): Boolean
{
if(Shell.su("""echo "#!/system/bin/sh\nmount -o bind $apkFPath $path" > /data/adb/service.d/vanced.sh""").exec().isSuccess)
if(Shell.su("""echo "#!/system/bin/sh\nwhile [ "${'$'}(getprop sys.boot_completed)" != 1 ];\ndo sleep 1;\ndone;\nmount -o bind $apkFPath $path" > /data/adb/service.d/vanced.sh""").exec().isSuccess)
{
return Shell.su("chmod 744 /data/adb/service.d/vanced.sh").exec().isSuccess
}
@ -509,11 +509,14 @@ object PackageHelper {
//get path of the installed youtube
private fun getPackageDir(context: Context): String?
{
return try {
val p = getPkgInfo(yPkg, context)
p!!.applicationInfo.sourceDir
} catch (e: Exception) {
val execRes = Shell.su("dumpsys package com.google.android.youtube | grep codePath").exec()
val p = getPkgInfo(yPkg, context)
return if(p != null)
{
p.applicationInfo.sourceDir
}
else
{
val execRes = Shell.su("dumpsys package com.google.android.youtube | grep codePath").exec()
if(execRes.isSuccess)
{
val result = execRes.out