(optional) disable crazypass generation (#486)

* (optional) disable crazypass generation

* update FAQ about disabling crazypass
This commit is contained in:
m2049r 2018-11-26 12:05:25 +01:00 committed by GitHub
parent 6f840dcacf
commit 7e14572756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

View File

@ -81,6 +81,8 @@ public class Helper {
(BuildConfig.FLAVOR.startsWith("prod") ? "" : "." + BuildConfig.FLAVOR) (BuildConfig.FLAVOR.startsWith("prod") ? "" : "." + BuildConfig.FLAVOR)
+ (BuildConfig.DEBUG ? "-debug" : ""); + (BuildConfig.DEBUG ? "-debug" : "");
static public final String NOCRAZYPASS_FLAGFILE = ".nocrazypass";
static public final String CRYPTO = "XMR"; static public final String CRYPTO = "XMR";
static private final String WALLET_DIR = "monerujo" + FLAVOR_SUFFIX; static private final String WALLET_DIR = "monerujo" + FLAVOR_SUFFIX;
@ -347,6 +349,11 @@ public class Helper {
WalletManager.setLogLevel(level); 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 // 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 // which could be the actual wallet password or a (maybe malformed) CrAzYpass
// or the password used to derive the CrAzYpass for the wallet // or the password used to derive the CrAzYpass for the wallet

View File

@ -84,7 +84,10 @@ public class KeyStoreHelper {
} }
public static String getCrazyPass(Context context, String password) { 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) { public static String getBrokenCrazyPass(Context context, String password, int brokenVariant) {

View File

@ -91,3 +91,10 @@ Keep calm and make a new wallet.
## Why does it make a 'monero' folder? ## Why does it make a 'monero' folder?
This is a new feature of monero core to share certain key images with other monero forks. 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!**