mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-12 23:43:38 +00:00
Support new sha1 location
This commit is contained in:
parent
a34ed538b6
commit
166469827f
@ -19,10 +19,18 @@ public class RestoreStockBoot extends ParallelTask<Void, Void, Boolean> {
|
||||
|
||||
@Override
|
||||
protected Boolean doInBackground(Void... voids) {
|
||||
List<String> ret = Shell.su("cat /init.magisk.rc | grep STOCKSHA1");
|
||||
String sha1;
|
||||
List<String> ret = Utils.readFile("/.backup/.sha1");
|
||||
if (!Utils.isValidShellResponse(ret)) {
|
||||
ret = Shell.su("cat /init.magisk.rc | grep STOCKSHA1");
|
||||
if (!Utils.isValidShellResponse(ret))
|
||||
return false;
|
||||
String stock_boot = "/data/stock_boot_" + ret.get(0).substring(ret.get(0).indexOf('=') + 1) + ".img.gz";
|
||||
sha1 = ret.get(0).substring(ret.get(0).indexOf('=') + 1);
|
||||
} else {
|
||||
sha1 = ret.get(0);
|
||||
}
|
||||
|
||||
String stock_boot = "/data/stock_boot_" + sha1 + ".img.gz";
|
||||
if (!Utils.itemExist(stock_boot))
|
||||
return false;
|
||||
Shell.su_raw("flash_boot_image " + stock_boot + " " + mBoot);
|
||||
|
Loading…
x
Reference in New Issue
Block a user