Commit 09bdbc12 authored by topjohnwu's avatar topjohnwu

Revert "Read only the first line instead of loading the whole file"

This reverts commit a5b573ea.

The file shall always have one single line, no need to create a new method
parent 978b3a64
......@@ -218,8 +218,9 @@ public class Async {
protected boolean unzipAndCheck() {
ZipUtils.unzip(mCachedFile, mCachedFile.getParentFile(), "META-INF/com/google/android");
String line = Utils.readFirstLine(mCachedFile.getParent() + "/META-INF/com/google/android/updater-script");
return line != null && line.contains("#MAGISK");
List<String> ret;
ret = Utils.readFile(mCachedFile.getParent() + "/META-INF/com/google/android/updater-script");
return Utils.isValidShellResponse(ret) && ret.get(0).contains("#MAGISK");
}
@Override
......
......@@ -75,17 +75,6 @@ public class Utils {
return ret;
}
public static String readFirstLine(String path) {
List<String> ret;
String command = "head -1 " + path;
if (Shell.rootAccess()) {
ret = Shell.su(command);
} else {
ret = Shell.sh(command);
}
return isValidShellResponse(ret) ? ret.get(0) : null;
}
public static void dlAndReceive(Context context, DownloadReceiver receiver, String link, String filename) {
if (isDownloading) {
return;
......
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