set main shell builder once

This commit is contained in:
5ec1cff
2024-10-04 01:15:40 +08:00
parent 41fc58856b
commit f93a1a41d7
3 changed files with 12 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.KsuWebUI"
android:networkSecurityConfig="@xml/network_security_config"
android:name=".App"
tools:targetApi="31" >
<activity android:name=".MainActivity"
android:exported="true">

View File

@@ -0,0 +1,11 @@
package io.github.a13e300.ksuwebui
import android.app.Application
import com.topjohnwu.superuser.Shell
class App : Application() {
override fun onCreate() {
super.onCreate()
Shell.setDefaultBuilder(Shell.Builder.create().setFlags(Shell.FLAG_MOUNT_MASTER))
}
}

View File

@@ -177,7 +177,6 @@ class MainActivity : AppCompatActivity() {
}
}
Shell.setDefaultBuilder(Shell.Builder.create().setFlags(Shell.FLAG_MOUNT_MASTER))
runOnUiThread {
RootService.bind(Intent(this, FileSystemService::class.java), connection!!)
}