Commit 72199472 authored by topjohnwu's avatar topjohnwu

Update libsu

Close #1314
parent b72004e9
......@@ -44,7 +44,7 @@ dependencies {
implementation 'androidx.work:work-runtime:2.0.0'
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:io:${libsuVersion}"
......
......@@ -119,7 +119,7 @@ public class Config {
public static void initialize() {
SharedPreferences pref = App.self.prefs;
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()) {
try {
SuFileInputStream is = new SuFileInputStream(config);
......
......@@ -164,9 +164,9 @@ public abstract class MagiskInstaller {
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) {
init64.renameTo(new SuFile(installDir, "magiskinit"));
init64.renameTo(SuFile.open(installDir, "magiskinit"));
} else {
init64.delete();
}
......@@ -214,8 +214,8 @@ public abstract class MagiskInstaller {
ShellUtils.pump(tarIn, tarOut);
}
}
SuFile boot = new SuFile(installDir, "boot.img");
SuFile recovery = new SuFile(installDir, "recovery.img");
File boot = SuFile.open(installDir, "boot.img");
File recovery = SuFile.open(installDir, "recovery.img");
if (vbmeta && recovery.exists() && boot.exists()) {
// Install Magisk to recovery
srcBoot = recovery.getPath();
......@@ -320,7 +320,7 @@ public abstract class MagiskInstaller {
}
protected boolean storeBoot() {
SuFile patched = new SuFile(installDir, "new-boot.img");
File patched = SuFile.open(installDir, "new-boot.img");
try {
OutputStream os;
if (isTar) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment