From 89be07e1f2b99bca405657145ac73adb04ecfd98 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 13 Nov 2018 00:21:42 -0500 Subject: [PATCH] Update to libsu 2.0.3 --- app/build.gradle | 2 +- .../com/topjohnwu/magisk/container/Module.java | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 428bc8f36..54c35a776 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -77,7 +77,7 @@ dependencies { fullImplementation "androidx.recyclerview:recyclerview:${rootProject.ext.androidXVersion}" fullImplementation "androidx.cardview:cardview:${rootProject.ext.androidXVersion}" fullImplementation "com.google.android.material:material:${rootProject.ext.androidXVersion}" - fullImplementation 'com.github.topjohnwu:libsu:2.0.2' + fullImplementation 'com.github.topjohnwu:libsu:2.0.3' fullImplementation 'com.atlassian.commonmark:commonmark:0.11.0' fullImplementation 'org.kamranzafar:jtar:2.3' diff --git a/app/src/full/java/com/topjohnwu/magisk/container/Module.java b/app/src/full/java/com/topjohnwu/magisk/container/Module.java index 3ba863216..7bf908651 100644 --- a/app/src/full/java/com/topjohnwu/magisk/container/Module.java +++ b/app/src/full/java/com/topjohnwu/magisk/container/Module.java @@ -11,7 +11,7 @@ public class Module extends BaseModule { public Module(String path) { try { - parseProps(Shell.Sync.su("dos2unix < " + path + "/module.prop")); + parseProps(Shell.su("dos2unix < " + path + "/module.prop").exec().getOut()); } catch (NumberFormatException ignored) {} mRemoveFile = new SuFile(path, "remove"); @@ -33,13 +33,11 @@ public class Module extends BaseModule { } public void createDisableFile() { - mEnable = false; - mDisableFile.createNewFile(); + mEnable = !mDisableFile.createNewFile(); } public void removeDisableFile() { - mEnable = true; - mDisableFile.delete(); + mEnable = mDisableFile.delete(); } public boolean isEnabled() { @@ -47,13 +45,11 @@ public class Module extends BaseModule { } public void createRemoveFile() { - mRemove = true; - mRemoveFile.createNewFile(); + mRemove = mRemoveFile.createNewFile(); } public void deleteRemoveFile() { - mRemove = false; - mRemoveFile.delete(); + mRemove = !mRemoveFile.delete(); } public boolean willBeRemoved() {