This commit is contained in:
Xinto 2020-09-19 17:56:42 +04:00
commit a7be68f5b5
2 changed files with 5 additions and 4 deletions

View File

@ -20,9 +20,10 @@ object InternetTools {
val builder = CustomTabsIntent.Builder()
builder.setToolbarColor(ContextCompat.getColor(context, color))
val customTabsIntent = builder.build()
customTabsIntent.intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
customTabsIntent.launchUrl(context, Uri.parse(Url))
} else
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Url)))
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Url)).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
}
fun getFileNameFromUrl(url: String) = url.substring(url.lastIndexOf('/')+1, url.length)

View File

@ -347,7 +347,7 @@ object PackageHelper {
private fun setupScript(apkFPath: String, path: String): Boolean
{
if(Shell.su("""echo "#!/system/bin/sh\nsleep 1m\nmount -o bind $apkFPath $path" > /data/adb/service.d/vanced.sh""").exec().isSuccess)
if(Shell.su("""echo "#!/system/bin/sh\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
}
@ -357,9 +357,9 @@ object PackageHelper {
private fun linkVanced(apkFPath: String, path: String): Boolean
{
Shell.su("am force-stop $yPkg").exec()
Thread.sleep(500)
val umountv = Shell.su("""for i in ${'$'}(ls /data/app/ | grep com.google.android.youtube | tr " "); do umount -l "/data/app/${"$"}i/base.apk"; done """)
val response = Shell.su("""su -mm -c "mount -o bind $apkFPath $path"""").exec()
Thread.sleep(500)
return response.isSuccess
}