Update libsu

Close #1314
This commit is contained in:
topjohnwu 2019-04-08 21:05:11 -04:00
parent b72004e9cc
commit 7219947237
3 changed files with 7 additions and 7 deletions

View File

@ -44,7 +44,7 @@ dependencies {
implementation 'androidx.work:work-runtime:2.0.0' implementation 'androidx.work:work-runtime:2.0.0'
implementation 'androidx.transition:transition:1.1.0-alpha02' implementation 'androidx.transition:transition:1.1.0-alpha02'
def libsuVersion = '2.3.3' def libsuVersion = '2.4.0'
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}" implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
implementation "com.github.topjohnwu.libsu:io:${libsuVersion}" implementation "com.github.topjohnwu.libsu:io:${libsuVersion}"

View File

@ -119,7 +119,7 @@ public class Config {
public static void initialize() { public static void initialize() {
SharedPreferences pref = App.self.prefs; SharedPreferences pref = App.self.prefs;
SharedPreferences.Editor editor = pref.edit(); SharedPreferences.Editor editor = pref.edit();
SuFile config = new SuFile("/data/adb/" + Const.MANAGER_CONFIGS); File config = SuFile.open("/data/adb", Const.MANAGER_CONFIGS);
if (config.exists()) { if (config.exists()) {
try { try {
SuFileInputStream is = new SuFileInputStream(config); SuFileInputStream is = new SuFileInputStream(config);

View File

@ -164,9 +164,9 @@ public abstract class MagiskInstaller {
return false; return false;
} }
SuFile init64 = new SuFile(installDir, "magiskinit64"); File init64 = SuFile.open(installDir, "magiskinit64");
if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_64_BIT_ABIS.length != 0) { if (Build.VERSION.SDK_INT >= 21 && Build.SUPPORTED_64_BIT_ABIS.length != 0) {
init64.renameTo(new SuFile(installDir, "magiskinit")); init64.renameTo(SuFile.open(installDir, "magiskinit"));
} else { } else {
init64.delete(); init64.delete();
} }
@ -214,8 +214,8 @@ public abstract class MagiskInstaller {
ShellUtils.pump(tarIn, tarOut); ShellUtils.pump(tarIn, tarOut);
} }
} }
SuFile boot = new SuFile(installDir, "boot.img"); File boot = SuFile.open(installDir, "boot.img");
SuFile recovery = new SuFile(installDir, "recovery.img"); File recovery = SuFile.open(installDir, "recovery.img");
if (vbmeta && recovery.exists() && boot.exists()) { if (vbmeta && recovery.exists() && boot.exists()) {
// Install Magisk to recovery // Install Magisk to recovery
srcBoot = recovery.getPath(); srcBoot = recovery.getPath();
@ -320,7 +320,7 @@ public abstract class MagiskInstaller {
} }
protected boolean storeBoot() { protected boolean storeBoot() {
SuFile patched = new SuFile(installDir, "new-boot.img"); File patched = SuFile.open(installDir, "new-boot.img");
try { try {
OutputStream os; OutputStream os;
if (isTar) { if (isTar) {