2019-06-10 11:37:56 +00:00
|
|
|
package com.topjohnwu.magisk;
|
|
|
|
|
2019-06-16 23:47:30 +00:00
|
|
|
import androidx.annotation.NonNull;
|
|
|
|
|
|
|
|
import com.topjohnwu.magisk.model.entity.UpdateInfo;
|
2019-06-10 11:37:56 +00:00
|
|
|
import com.topjohnwu.superuser.Shell;
|
|
|
|
import com.topjohnwu.superuser.ShellUtils;
|
|
|
|
|
|
|
|
public final class Info {
|
|
|
|
|
|
|
|
public static int magiskVersionCode = -1;
|
2019-06-16 23:47:30 +00:00
|
|
|
|
|
|
|
@NonNull
|
2019-06-10 11:37:56 +00:00
|
|
|
public static String magiskVersionString = "";
|
2019-06-16 23:47:30 +00:00
|
|
|
|
|
|
|
public static UpdateInfo remote = new UpdateInfo();
|
|
|
|
|
2019-06-10 11:37:56 +00:00
|
|
|
public static boolean keepVerity = false;
|
|
|
|
public static boolean keepEnc = false;
|
|
|
|
public static boolean recovery = false;
|
|
|
|
|
|
|
|
public static void loadMagiskInfo() {
|
|
|
|
try {
|
|
|
|
magiskVersionString = ShellUtils.fastCmd("magisk -v").split(":")[0];
|
|
|
|
magiskVersionCode = Integer.parseInt(ShellUtils.fastCmd("magisk -V"));
|
|
|
|
Config.setMagiskHide(Shell.su("magiskhide --status").exec().isSuccess());
|
|
|
|
} catch (NumberFormatException ignored) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|