diff --git a/app/build.gradle b/app/build.gradle index 41b8c7a..e3921b9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -79,9 +79,26 @@ android.applicationVariants.all { variant -> } repositories { + maven { + url 'https://jitpack.io' + content { + includeGroup("com.github.topjohnwu.libsu") + } + } + maven { + url 'https://dl.bintray.com/rikkaw/MaterialPreference' + content { + includeGroup("moe.shizuku.preference") + } + } + maven { + url 'https://dl.bintray.com/rikkaw/Libraries' + content { + includeGroupByRegex("rikka.*") + } + } jcenter() google() - maven { url 'https://dl.bintray.com/rikkaw/Libraries' } } configurations.all { @@ -105,10 +122,11 @@ dependencies { implementation "rikka.html:html-ktx:$rikka_html_version" implementation "rikka.material:material:$rikka_material_version" implementation "rikka.recyclerview:recyclerview-utils:$rikka_recyclerview_utils_version" + implementation "rikka.widget:borderview:1.0.0" implementation "moe.shizuku.preference:preference-appcompat:$rikka_preference_version" implementation "moe.shizuku.preference:preference-simplemenu-appcompat:$rikka_preference_version" - def libsuVersion = '3.0.2' + def libsuVersion = '3.1.1' implementation "com.github.topjohnwu.libsu:core:${libsuVersion}" def shizuku_version = '11.0.2' diff --git a/app/src/main/java/moe/haruue/wadb/component/HomeFragment.kt b/app/src/main/java/moe/haruue/wadb/component/HomeFragment.kt index 0cf9274..2797b55 100644 --- a/app/src/main/java/moe/haruue/wadb/component/HomeFragment.kt +++ b/app/src/main/java/moe/haruue/wadb/component/HomeFragment.kt @@ -22,10 +22,10 @@ import moe.haruue.wadb.util.NotificationHelper import moe.haruue.wadb.util.ScreenKeeper import moe.haruue.wadb.wadbApplication import moe.shizuku.preference.* -import rikka.material.widget.BorderRecyclerView -import rikka.material.widget.BorderView import rikka.recyclerview.addVerticalPadding import rikka.recyclerview.fixEdgeEffect +import rikka.widget.borderview.BorderRecyclerView +import rikka.widget.borderview.BorderView class HomeFragment : PreferenceFragment(), WadbStateChangedEvent, WadbFailureEvent, SharedPreferences.OnSharedPreferenceChangeListener { diff --git a/app/src/main/java/moe/haruue/wadb/util/SuShell.java b/app/src/main/java/moe/haruue/wadb/util/SuShell.java index ce3a6a6..6944c26 100644 --- a/app/src/main/java/moe/haruue/wadb/util/SuShell.java +++ b/app/src/main/java/moe/haruue/wadb/util/SuShell.java @@ -15,9 +15,10 @@ public class SuShell { static { - Shell.Config.setFlags(Shell.FLAG_REDIRECT_STDERR); - Shell.Config.verboseLogging(BuildConfig.DEBUG); - Shell.Config.setTimeout(10); + Shell.enableVerboseLogging = BuildConfig.DEBUG; + Shell.setDefaultBuilder(Shell.Builder.create() + .setFlags(Shell.FLAG_REDIRECT_STDERR) + .setTimeout(10)); } /** @@ -84,7 +85,7 @@ public synchronized static boolean available() { } catch (IOException e) { e.printStackTrace(); } - Shell.newInstance(); + Shell.getShell(); Shell.su("echo test").exec(); } return Shell.rootAccess(); @@ -118,40 +119,4 @@ public synchronized static Result run(String... commands) { Shell.Result result = Shell.su(commands).exec(); return new Result(result.getCode(), result.getOut()); } - - public static class Interactive { - - public interface Callback { - void onLine(String line); - - void onResult(Result result); - } - - public static void run(String command, Callback callback) { - run(new String[]{command}, callback); - } - - public static void run(List commands, Callback callback) { - run(commands.toArray(new String[0]), callback); - } - - public static void run(String[] commands, Callback callback) { - Shell.su(commands).to(new CallbackList() { - @Override - public void onAddElement(String s) { - if (callback != null) { - callback.onLine(s); - } - } - }).submit(result -> { - if (callback != null) { - callback.onResult(new Result(result.getCode(), result.getOut())); - } - }); - } - - public static void close() { - SuShell.close(); - } - } } diff --git a/app/src/main/res/layout/preference_recyclerview.xml b/app/src/main/res/layout/preference_recyclerview.xml index a3ef5e0..97f31f8 100644 --- a/app/src/main/res/layout/preference_recyclerview.xml +++ b/app/src/main/res/layout/preference_recyclerview.xml @@ -1,5 +1,5 @@ -