Update Install Fragment UI

This commit is contained in:
topjohnwu
2016-12-25 22:36:51 +08:00
parent 8fe4cfecb6
commit c78209604c
14 changed files with 217 additions and 171 deletions
@@ -12,6 +12,7 @@ import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.widget.Toast;
import com.topjohnwu.magisk.InstallFragment;
import com.topjohnwu.magisk.ModulesFragment;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.ReposFragment;
@@ -293,4 +294,20 @@ public class Async {
}
}
public static class GetBootBlocks extends RootTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
InstallFragment.blockList = Shell.su("ls /dev/block | grep mmc");
if (InstallFragment.bootBlock == null) {
InstallFragment.bootBlock = Utils.detectBootImage();
}
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
InstallFragment.blockDetectionDone.trigger();
}
}
}
@@ -138,10 +138,6 @@ public class Utils {
.replace("#", "").replace("@", "").replace("*", "");
}
public static List<String> getBlockList() {
return Shell.su("ls /dev/block | grep mmc");
}
public static String detectBootImage() {
String[] commands = {
"for PARTITION in kern-a KERN-A android_boot ANDROID_BOOT kernel KERNEL boot BOOT lnx LNX; do",