commit
2bfcc01719
|
@ -339,8 +339,10 @@ object PackageHelper {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupScript(apkFPath: String, path: String): Boolean {
|
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
|
return Shell.su("chmod 744 /data/adb/service.d/vanced.sh").exec().isSuccess
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -496,11 +498,14 @@ object PackageHelper {
|
||||||
//get path of the installed youtube
|
//get path of the installed youtube
|
||||||
private fun getPackageDir(context: Context): String?
|
private fun getPackageDir(context: Context): String?
|
||||||
{
|
{
|
||||||
return try {
|
val p = getPkgInfo(yPkg, context)
|
||||||
val p = getPkgInfo(vancedRootPkg, context)
|
return if(p != null)
|
||||||
p!!.applicationInfo.sourceDir
|
{
|
||||||
} catch (e: Exception) {
|
p.applicationInfo.sourceDir
|
||||||
val execRes = Shell.su("dumpsys package com.google.android.youtube | grep codePath").exec()
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
val execRes = Shell.su("dumpsys package com.google.android.youtube | grep codePath").exec()
|
||||||
if(execRes.isSuccess)
|
if(execRes.isSuccess)
|
||||||
{
|
{
|
||||||
val result = execRes.out
|
val result = execRes.out
|
||||||
|
|
Loading…
Reference in New Issue