mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 20:15:29 +00:00
Prevent weird Magisk version number crashing app
This commit is contained in:
parent
906ae730e9
commit
e5be8b7f67
@ -167,10 +167,10 @@ public class MagiskFragment extends Fragment {
|
|||||||
|
|
||||||
private void updateMagiskVersion() {
|
private void updateMagiskVersion() {
|
||||||
List<String> ret = Shell.sh("getprop magisk.version");
|
List<String> ret = Shell.sh("getprop magisk.version");
|
||||||
if (ret.get(0).isEmpty()) {
|
try {
|
||||||
magiskVersion = -1;
|
|
||||||
} else {
|
|
||||||
magiskVersion = Integer.parseInt(ret.get(0));
|
magiskVersion = Integer.parseInt(ret.get(0));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
magiskVersion = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (magiskVersion == -1) {
|
if (magiskVersion == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user