From e5be8b7f67282049fbf927bd0834b3ab9bfcc3cb Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 18 Oct 2016 21:54:53 +0800 Subject: [PATCH] Prevent weird Magisk version number crashing app --- app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java b/app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java index 975b31cfa..8cba48ed5 100644 --- a/app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java @@ -167,10 +167,10 @@ public class MagiskFragment extends Fragment { private void updateMagiskVersion() { List ret = Shell.sh("getprop magisk.version"); - if (ret.get(0).isEmpty()) { - magiskVersion = -1; - } else { + try { magiskVersion = Integer.parseInt(ret.get(0)); + } catch (NumberFormatException e) { + magiskVersion = -1; } if (magiskVersion == -1) {