diff --git a/app/src/main/java/io/github/wulkanowy/ui/main/exams/ExamsTabFragment.java b/app/src/main/java/io/github/wulkanowy/ui/main/exams/ExamsTabFragment.java index ccc3da17..d41e34d2 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/main/exams/ExamsTabFragment.java +++ b/app/src/main/java/io/github/wulkanowy/ui/main/exams/ExamsTabFragment.java @@ -135,7 +135,7 @@ public class ExamsTabFragment extends BaseFragment implements ExamsTabContract.V @Override public void onDestroyView() { - super.onDestroyView(); presenter.onDestroy(); + super.onDestroyView(); } } diff --git a/app/src/main/java/io/github/wulkanowy/utils/RootChecker.java b/app/src/main/java/io/github/wulkanowy/utils/RootChecker.java deleted file mode 100644 index 9c23c217..00000000 --- a/app/src/main/java/io/github/wulkanowy/utils/RootChecker.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.github.wulkanowy.utils; - -import android.os.Build; - -import java.io.File; - -public final class RootChecker { - - private RootChecker() { - throw new IllegalStateException("Utility class"); - } - - public static boolean isRooted() { - return checkOne() || checkTwo() || checkThree(); - } - - private static boolean checkOne() { - return Build.TAGS != null && Build.TAGS.contains("test-keys"); - } - - private static boolean checkTwo() { - return new File("/system/app/Superuser.apk").exists(); - } - - private static boolean checkThree() { - String[] commands = {"/system/xbin/which su", "/system/bin/which su", "which su"}; - for (String command : commands) { - try { - Runtime.getRuntime().exec(command); - return true; - } catch (Exception e) { - // ignore - } - } - return false; - } - -} diff --git a/app/src/main/java/io/github/wulkanowy/utils/security/Scrambler.java b/app/src/main/java/io/github/wulkanowy/utils/security/Scrambler.java index 93da1d0b..dc0c409a 100644 --- a/app/src/main/java/io/github/wulkanowy/utils/security/Scrambler.java +++ b/app/src/main/java/io/github/wulkanowy/utils/security/Scrambler.java @@ -27,7 +27,6 @@ import javax.crypto.CipherOutputStream; import javax.security.auth.x500.X500Principal; import io.github.wulkanowy.utils.LogUtils; -import io.github.wulkanowy.utils.RootChecker; public final class Scrambler { @@ -46,23 +45,16 @@ public final class Scrambler { loadKeyStore(); generateNewKey(email, context); return encryptString(email, plainText); - } else { - if (RootChecker.isRooted()) { - return new String(Base64.encode(plainText.getBytes(), Base64.DEFAULT)); - } else { - throw new UnsupportedOperationException("Stored data in this devices " + - "isn't safe because android is rooted"); - } } + return new String(Base64.encode(plainText.getBytes(), Base64.DEFAULT)); } public static String decrypt(String email, String encryptedText) throws CryptoException { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { loadKeyStore(); return decryptString(email, encryptedText); - } else { - return new String(Base64.decode(encryptedText, Base64.DEFAULT)); } + return new String(Base64.decode(encryptedText, Base64.DEFAULT)); } private static void loadKeyStore() throws CryptoException {