diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 41933cd..5e9f64b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,15 +2,6 @@ - - - - - - - - - + + + + + + + @@ -40,9 +42,21 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/org/hydev/wearsync/ActivitySplash.kt b/app/src/main/java/org/hydev/wearsync/ActivitySplash.kt new file mode 100644 index 0000000..c936f1f --- /dev/null +++ b/app/src/main/java/org/hydev/wearsync/ActivitySplash.kt @@ -0,0 +1,43 @@ +package org.hydev.wearsync + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import com.topjohnwu.superuser.Shell +import org.hydev.wearsync.databinding.ActivitySplashBinding + +class ActivitySplash : AppCompatActivity() +{ + private lateinit var binding: ActivitySplashBinding + + companion object + { + init + { + // Set settings before the main shell can be created + Shell.enableVerboseLogging = BuildConfig.DEBUG + Shell.setDefaultBuilder(Shell.Builder.create() + .setFlags(Shell.FLAG_REDIRECT_STDERR) + .setFlags(Shell.FLAG_MOUNT_MASTER) + .setTimeout(10) + ) + } + } + + fun getShell() = Shell.getShell { + println(Shell.cmd("whoami").exec().out) + act() + finish() + } + + override fun onCreate(savedInstanceState: Bundle?) + { + super.onCreate(savedInstanceState) + + binding = ActivitySplashBinding.inflate(layoutInflater) + setContentView(binding.root) + + getShell() + + binding.btnTestRoot.setOnClickListener { getShell() } + } +} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml new file mode 100644 index 0000000..1e07fc0 --- /dev/null +++ b/app/src/main/res/layout/activity_splash.xml @@ -0,0 +1,29 @@ + + + + + + +