From 7e14572756f1b8d51324ef93fb287591cf45dbcf Mon Sep 17 00:00:00 2001 From: m2049r Date: Mon, 26 Nov 2018 12:05:25 +0100 Subject: [PATCH] (optional) disable crazypass generation (#486) * (optional) disable crazypass generation * update FAQ about disabling crazypass --- app/src/main/java/com/m2049r/xmrwallet/util/Helper.java | 7 +++++++ .../java/com/m2049r/xmrwallet/util/KeyStoreHelper.java | 5 ++++- doc/FAQ.md | 7 +++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java index 6022cd04..cb7bd7f5 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java +++ b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java @@ -81,6 +81,8 @@ public class Helper { (BuildConfig.FLAVOR.startsWith("prod") ? "" : "." + BuildConfig.FLAVOR) + (BuildConfig.DEBUG ? "-debug" : ""); + static public final String NOCRAZYPASS_FLAGFILE = ".nocrazypass"; + static public final String CRYPTO = "XMR"; static private final String WALLET_DIR = "monerujo" + FLAVOR_SUFFIX; @@ -347,6 +349,11 @@ public class Helper { WalletManager.setLogLevel(level); } + static public boolean useCrazyPass(Context context) { + File flagFile = new File(getWalletRoot(context), NOCRAZYPASS_FLAGFILE); + return !flagFile.exists(); + } + // try to figure out what the real wallet password is given the user password // which could be the actual wallet password or a (maybe malformed) CrAzYpass // or the password used to derive the CrAzYpass for the wallet diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/KeyStoreHelper.java b/app/src/main/java/com/m2049r/xmrwallet/util/KeyStoreHelper.java index 4212887f..c6e4bcec 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/util/KeyStoreHelper.java +++ b/app/src/main/java/com/m2049r/xmrwallet/util/KeyStoreHelper.java @@ -84,7 +84,10 @@ public class KeyStoreHelper { } public static String getCrazyPass(Context context, String password) { - return getCrazyPass(context, password, 0); + if (Helper.useCrazyPass(context)) + return getCrazyPass(context, password, 0); + else + return password; } public static String getBrokenCrazyPass(Context context, String password, int brokenVariant) { diff --git a/doc/FAQ.md b/doc/FAQ.md index e42d4d2c..ed514e52 100644 --- a/doc/FAQ.md +++ b/doc/FAQ.md @@ -91,3 +91,10 @@ Keep calm and make a new wallet. ## Why does it make a 'monero' folder? This is a new feature of monero core to share certain key images with other monero forks. + +## CrAzYpass is awesome - but I don't want it! +Creating a file named `.nocrazypass` in the wallets folder will disable generation of crazypass for NEW passwords (new wallet or change password). +The content of the file is not read and is irrelevant. +Wallets with CrAzYpass will continue working normally. The currently set real wallet password can be checked in the "Show Secrets". + +**NB: This feature is for test purposed only - all your XMR will be stolen if you use it!**