mirror of https://github.com/m2049r/xmrwallet.git
Bugfix: crashing on android 5 & 6 (new wallet, receive, ...) (#83)
* getAddress() mess fixed * v0.8.0.3
This commit is contained in:
parent
cc46dc06c4
commit
793d984200
|
@ -8,8 +8,8 @@ android {
|
||||||
applicationId "com.m2049r.xmrwallet"
|
applicationId "com.m2049r.xmrwallet"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 25
|
targetSdkVersion 25
|
||||||
versionCode 15
|
versionCode 16
|
||||||
versionName "0.8.0.2"
|
versionName "0.8.0.3"
|
||||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
|
|
|
@ -531,8 +531,7 @@ Java_com_m2049r_xmrwallet_model_Wallet_setPassword(JNIEnv *env, jobject instance
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
Java_com_m2049r_xmrwallet_model_Wallet_getAddressJ(JNIEnv *env, jobject instance) {
|
Java_com_m2049r_xmrwallet_model_Wallet_getAddressJ(JNIEnv *env, jobject instance) {
|
||||||
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
|
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
|
||||||
const char *address = wallet->address().c_str();
|
return env->NewStringUTF(wallet->address().c_str());
|
||||||
return env->NewStringUTF(address);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
|
|
|
@ -36,7 +36,6 @@ public class Wallet {
|
||||||
|
|
||||||
Wallet(long handle) {
|
Wallet(long handle) {
|
||||||
this.handle = handle;
|
this.handle = handle;
|
||||||
getAddress(); // cache address for later
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Status {
|
public enum Status {
|
||||||
|
@ -73,10 +72,6 @@ public class Wallet {
|
||||||
if (address == null) {
|
if (address == null) {
|
||||||
address = getAddressJ();
|
address = getAddressJ();
|
||||||
}
|
}
|
||||||
if (!Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
|
|
||||||
// just die!
|
|
||||||
throw new IllegalStateException("Wallet returned invalid address: " + address);
|
|
||||||
}
|
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue