Bugfix: crashing on android 5 & 6 (new wallet, receive, ...) (#83)

* getAddress() mess fixed

* v0.8.0.3
This commit is contained in:
m2049r 2017-09-23 18:23:41 +02:00 committed by GitHub
parent cc46dc06c4
commit 793d984200
21 changed files with 3 additions and 9 deletions

View File

@ -8,8 +8,8 @@ android {
applicationId "com.m2049r.xmrwallet"
minSdkVersion 21
targetSdkVersion 25
versionCode 15
versionName "0.8.0.2"
versionCode 16
versionName "0.8.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {

View File

@ -531,8 +531,7 @@ Java_com_m2049r_xmrwallet_model_Wallet_setPassword(JNIEnv *env, jobject instance
JNIEXPORT jstring JNICALL
Java_com_m2049r_xmrwallet_model_Wallet_getAddressJ(JNIEnv *env, jobject instance) {
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
const char *address = wallet->address().c_str();
return env->NewStringUTF(address);
return env->NewStringUTF(wallet->address().c_str());
}
JNIEXPORT jstring JNICALL

View File

@ -36,7 +36,6 @@ public class Wallet {
Wallet(long handle) {
this.handle = handle;
getAddress(); // cache address for later
}
public enum Status {
@ -73,10 +72,6 @@ public class Wallet {
if (address == null) {
address = getAddressJ();
}
if (!Wallet.isAddressValid(address, WalletManager.getInstance().isTestNet())) {
// just die!
throw new IllegalStateException("Wallet returned invalid address: " + address);
}
return address;
}