explicit check pw (#439)

also, revert device type query changes
This commit is contained in:
m2049r 2018-10-12 23:03:53 +02:00 committed by GitHub
parent 1f5061df38
commit 668cefb357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -178,16 +178,12 @@ public class WalletManager {
public native boolean verifyWalletPassword(String keys_file_name, String password, boolean watch_only);
public boolean verifyWalletPasswordOnly(String keys_file_name, String password) {
return queryWalletDevice(keys_file_name, password) != Wallet.Device.Device_Undefined;
return queryWalletDeviceJ(keys_file_name, password) >= 0;
}
public Wallet.Device queryWalletDevice(String keys_file_name, String password) {
int device = queryWalletDeviceJ(keys_file_name, password);
Wallet.Device[] types = Wallet.Device.values();
// mapping is monero+1=android
if ((device < 0) || (device > types.length - 2))
device = -1;
return types[device + 1];
return Wallet.Device.values()[device + 1]; // mapping is monero+1=android
}
private native int queryWalletDeviceJ(String keys_file_name, String password);