1
mirror of https://github.com/m2049r/xmrwallet synced 2025-09-05 09:58:42 +02:00

Compare commits

..

8 Commits

Author SHA1 Message Date
m2049r
e9c74d4d9c Random fixes (#228)
* adapt for android studio 3.1 and remove witness

* set networktype from node

* add monero logging for DEBUG builds

* do not reset timestamps in apk

* no witness

* new version & apk naming
2018-04-15 16:33:20 +02:00
m2049r
b37adb4546 Update README.md 2018-04-11 18:20:07 +02:00
erciccione
a4e99209be change suggested ringsize from 5 to 7 in help.xml (#223) 2018-04-07 16:44:18 +02:00
m2049r
45aa8f30e5 fix openssl links 2018-04-05 19:09:30 +02:00
m2049r
60a7b15700 new version for fixed malloc (83dcd65) 2018-04-03 11:51:14 +02:00
m2049r
df2ff8b3b7 correct toolbar colour for testnet (#218) 2018-04-02 13:02:00 +02:00
m2049r
da8c8f80f1 new version for m2049r/monero 7e97e11 (#217) 2018-04-02 12:14:55 +02:00
m2049r
eda3de11fe added zxcvbn4j license (#216) 2018-04-01 13:23:03 +02:00
17 changed files with 161 additions and 67 deletions

2
.gitignore vendored
View File

@@ -3,6 +3,8 @@
*.iml
/.idea/libraries
/.idea/workspace.xml
/.idea/caches
/.idea/codeStyles
/local.properties
/captures
.externalNativeBuild

View File

@@ -3,6 +3,7 @@ Another Android Monero Wallet
### QUICKSTART
- Download the APK for the most current release [here](https://github.com/m2049r/xmrwallet/releases) and install it
- Alternatively add our F-Droid repo https://f-droid.monerujo.io/fdroid/repo with fingerpint ```A8 2C 68 E1 4A F0 AA 6A 2E C2 0E 6B 27 2E FF 25 E5 A0 38 F3 F6 58 84 31 6E 0F 5E 0D 91 E7 B7 13``` to your F-Droid client
- Run the App and select "Generate Wallet" to create a new wallet or recover a wallet
- Advanced users can copy over synced wallet files (all files) onto sdcard in directory Monerujo (created first time App is started)
- See the [FAQ](doc/FAQ.md)

View File

@@ -1,15 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'witness'
android {
compileSdkVersion 25
buildToolsVersion '26.0.2'
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.m2049r.xmrwallet"
minSdkVersion 21
targetSdkVersion 25
versionCode 83
versionName "1.4.3 'Monero Spedner'"
versionCode 87
versionName "1.4.7 'Monero Spedner'"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
@@ -17,9 +16,6 @@ android {
arguments '-DANDROID_STL=c++_shared'
}
}
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
buildTypes {
@@ -52,59 +48,35 @@ android {
// APKs for the same app that all have the same version information.
android.applicationVariants.all { variant ->
// Assigns a different version code for each output APK.
variant.outputs.each {
variant.outputs.all {
output ->
def abiName = output.getFilter(com.android.build.OutputFile.ABI)
output.versionCodeOverride = abiCodes.get(abiName, 0) + 10 * variant.versionCode
if (abiName == null) abiName = "universal"
def v = "${variant.versionName}".replaceFirst(" .*\$", "").replace(".", "x")
outputFileName = "$rootProject.ext.apkName-" + v + "_" + abiName + ".apk"
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:design:25.4.0'
implementation 'com.android.support:support-v4:25.4.0'
implementation 'com.android.support:recyclerview-v7:25.4.0'
implementation 'com.android.support:cardview-v7:25.4.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
compile "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
compile "com.jakewharton.timber:timber:$rootProject.ext.timberVersion"
implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
implementation "com.jakewharton.timber:timber:$rootProject.ext.timberVersion"
compile 'com.nulab-inc:zxcvbn:1.2.3'
implementation 'com.nulab-inc:zxcvbn:1.2.3'
testCompile "junit:junit:$rootProject.ext.junitVersion"
testCompile "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
testCompile "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"
testCompile 'org.json:json:20140107'
testCompile 'net.jodah:concurrentunit:0.4.2'
}
dependencyVerification {
verify = [
'com.android.support:design:3f409bf2019967ffc344cfaf11e52131fac982468a1707aaeb25bf3c52838966',
'com.android.support:appcompat-v7:70551e62660db15b790c5275f56b9de4dd9407d1494d07c8f3dd5698f3638677',
'com.android.support:transition:848270144fb180efd2bf928a00ed176dbbc5290badfd638390ffba90088df8b3',
'me.dm7.barcodescanner:zxing:d43973c9527c23fa8e6d338c6a2c458e373ce1ac6bcaa3bc41d11ae49116000d',
'me.dm7.barcodescanner:core:a5c8a704089b58029db166172ed8e55d756877d010a85a0b1c94fdc96ffb8f9a',
'com.android.support:support-v4:ee44c481a1f4d6978568e223e8125379b52b2ececdd53450e09ebae144bd377d',
'com.android.support:recyclerview-v7:a2fe121f9d01ed8980e97095b4a3fe9700a0aa0a7d4b0f8c594f765ad8455a0d',
'com.android.support:cardview-v7:f3fbbe1fcfdbec7333c6a2c516c5fd511a909d1975271818e268d6fe297d8c70',
'com.android.support.constraint:constraint-layout:b0c688cc2b7172608f8153a689d746da40f71e52d7e2fe2bfd9df2f92db77085',
'com.android.support:animated-vector-drawable:628ab1d56a6ee4cbedf32617af8b2a1fe02964ed0628e8f898cc09ddba6e1835',
'com.android.support:support-vector-drawable:077009d13882ee96f061e4bc2dbe7cce7ae1762d8297592a787ff741afbfb1f2',
'com.android.support:support-fragment:316d35d4d2d2902057efad104a73e4bdb50bee260a7075678185b8cd71170945',
'com.android.support:support-core-ui:e72ae29b823889686cff6fcb948d6745c2baf6d4c2af4fdffa1ec1e42e3833a3',
'com.android.support:support-media-compat:566a161d9cb0083ef62a53e46b71ce5b3d455b8635b1a0a4ae28d96d4b583de8',
'com.android.support:support-core-utils:34b8437dfa95ff28d29cf57ffa3b1354a9fa9bfe4059f0fd5ce2f5e4326a1748',
'com.android.support:support-compat:54019c63614ce08b02d7b9605490cd2b29ba5b2505f394a9517450b5f72b30ca',
'com.android.support:support-annotations:a774272036941b4e912eb426d70c848bde7f06a3bf5fb491f75a427dc6595270',
'com.android.support.constraint:constraint-layout-solver:8c62525a9bc5cff5633a96cb9b32fffeccaf41b8841aa87fc22607070dea9b8d',
'com.google.zxing:core:bba7724e02a997cec38213af77133ee8e24b0d5cf5fa7ecbc16a4fa93f11ee0d',
'com.squareup.okio:okio:734269c3ebc5090e3b23566db558f421f0b4027277c79ad5d176b8ec168bb850',
'com.squareup.okhttp3:okhttp:7265adbd6f028aade307f58569d814835cd02bc9beffb70c25f72c9de50d61c4',
'com.jakewharton.timber:timber:35c22867f2673132e97e17857d36bb2fc25f5790f0425406833ed0254d62fc66',
'com.nulab-inc:zxcvbn:18d7862a6abd2705defec478d77dedadf8f3bb7cf811df22995494f05485785f',
]
testImplementation "junit:junit:$rootProject.ext.junitVersion"
testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
testImplementation "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"
testImplementation 'org.json:json:20140107'
testImplementation 'net.jodah:concurrentunit:0.4.2'
}

View File

@@ -1075,6 +1075,85 @@ Java_com_m2049r_xmrwallet_model_PendingTransaction_getTxCount(JNIEnv *env, jobje
}
// these are all in Bitmonero::Wallet - which I find wrong, so they are here!
//static void init(const char *argv0, const char *default_log_base_name);
//static void debug(const std::string &category, const std::string &str);
//static void info(const std::string &category, const std::string &str);
//static void warning(const std::string &category, const std::string &str);
//static void error(const std::string &category, const std::string &str);
JNIEXPORT void JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_initLogger(JNIEnv *env, jobject instance,
jstring argv0, jstring default_log_base_name) {
const char *_argv0 = env->GetStringUTFChars(argv0, NULL);
const char *_default_log_base_name = env->GetStringUTFChars(default_log_base_name, NULL);
Bitmonero::Wallet::init(_argv0, _default_log_base_name);
env->ReleaseStringUTFChars(argv0, _argv0);
env->ReleaseStringUTFChars(default_log_base_name, _default_log_base_name);
}
JNIEXPORT void JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_logDebug(JNIEnv *env, jobject instance,
jstring category, jstring message) {
const char *_category = env->GetStringUTFChars(category, NULL);
const char *_message = env->GetStringUTFChars(message, NULL);
Bitmonero::Wallet::debug(_category, _message);
env->ReleaseStringUTFChars(category, _category);
env->ReleaseStringUTFChars(message, _message);
}
JNIEXPORT void JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_logInfo(JNIEnv *env, jobject instance,
jstring category, jstring message) {
const char *_category = env->GetStringUTFChars(category, NULL);
const char *_message = env->GetStringUTFChars(message, NULL);
Bitmonero::Wallet::info(_category, _message);
env->ReleaseStringUTFChars(category, _category);
env->ReleaseStringUTFChars(message, _message);
}
JNIEXPORT void JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_logWarning(JNIEnv *env, jobject instance,
jstring category, jstring message) {
const char *_category = env->GetStringUTFChars(category, NULL);
const char *_message = env->GetStringUTFChars(message, NULL);
Bitmonero::Wallet::warning(_category, _message);
env->ReleaseStringUTFChars(category, _category);
env->ReleaseStringUTFChars(message, _message);
}
JNIEXPORT void JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_logError(JNIEnv *env, jobject instance,
jstring category, jstring message) {
const char *_category = env->GetStringUTFChars(category, NULL);
const char *_message = env->GetStringUTFChars(message, NULL);
Bitmonero::Wallet::error(_category, _message);
env->ReleaseStringUTFChars(category, _category);
env->ReleaseStringUTFChars(message, _message);
}
JNIEXPORT void JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_setLogLevel(JNIEnv *env, jobject instance,
jint level) {
Bitmonero::WalletManagerFactory::setLogLevel(level);
}
#ifdef __cplusplus
}
#endif

View File

@@ -743,7 +743,9 @@ public class LoginActivity extends SecureActivity
}
void startLoginFragment() {
// we set these here because we cannot be ceratin we have permissions for storage before
Helper.setMoneroHome(this);
Helper.initLogger(this);
Fragment fragment = new LoginFragment();
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, fragment).commit();

View File

@@ -222,6 +222,8 @@ public class WalletActivity extends SecureActivity implements WalletFragment.Lis
}
});
showNet();
Fragment walletFragment = new WalletFragment();
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, walletFragment, WalletFragment.class.getName()).commit();

View File

@@ -86,6 +86,10 @@ public class WalletNode {
return name;
}
public NetworkType getNetworkType() {
return networkType;
}
public String getAddress() {
return host + ":" + port;
}

View File

@@ -41,6 +41,7 @@ public class WalletManager {
if (WalletManager.Instance == null) {
WalletManager.Instance = new WalletManager();
}
return WalletManager.Instance;
}
@@ -215,7 +216,7 @@ public class WalletManager {
//public void setDaemon(String address, NetworkType networkType, String username, String password) {
public void setDaemon(WalletNode walletNode) {
this.daemonAddress = walletNode.getAddress();
this.networkType = networkType;
this.networkType = walletNode.getNetworkType();
this.daemonUsername = walletNode.getUsername();
this.daemonPassword = walletNode.getPassword();
setDaemonAddressJ(daemonAddress);
@@ -269,5 +270,17 @@ public class WalletManager {
//TODO static std::tuple<bool, std::string, std::string, std::string, std::string> checkUpdates(const std::string &software, const std::string &subdir);
static public native void initLogger(String argv0, String defaultLogBaseName);
//TODO: maybe put these in an enum like in monero core - but why?
static public int LOGLEVEL_SILENT = -1;
static public int LOGLEVEL_WARN = 0;
static public int LOGLEVEL_INFO = 1;
static public int LOGLEVEL_DEBUG = 2;
static public int LOGLEVEL_TRACE = 3;
static public int LOGLEVEL_MAX = 4;
static public native void setLogLevel(int level);
static public native void logDebug(String category, String message);
static public native void logInfo(String category, String message);
static public native void logWarning(String category, String message);
static public native void logError(String category, String message);
}

View File

@@ -38,6 +38,7 @@ import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.inputmethod.InputMethodManager;
import com.m2049r.xmrwallet.BuildConfig;
import com.m2049r.xmrwallet.R;
import com.m2049r.xmrwallet.model.NetworkType;
import com.m2049r.xmrwallet.model.Wallet;
@@ -287,4 +288,19 @@ public class Helper {
throw new IllegalStateException(ex);
}
}
static public void initLogger(Context context) {
if (BuildConfig.DEBUG) {
initLogger(context, WalletManager.LOGLEVEL_DEBUG);
}
// no logger if not debug
}
// TODO make the log levels refer to the WalletManagerFactory::LogLevel enum ?
static public void initLogger(Context context, int level) {
String home = getStorage(context, HOME_DIR).getAbsolutePath();
WalletManager.initLogger(home + "/monerujo", "monerujo.log");
if (level >= WalletManager.LOGLEVEL_SILENT)
WalletManager.setLogLevel(level);
}
}

View File

@@ -161,8 +161,8 @@
negocio pueda asociar inequívocamente tu transacción con un producto que has comprado.</p>
<h2>Tamaño del anillo</h2>
<p>Hay varios tamaños de anillo (ring size) para elegir en Monerujo. Si eres un
usuario principiante te recomendamos que simplemente utilices un tamaño de anillo de 5.
Aumentar el tamaño de anillo por encima de 5 incrementa el número de firmantes en una firma
usuario principiante te recomendamos que simplemente utilices un tamaño de anillo de 7.
Aumentar el tamaño de anillo por encima de 7 incrementa el número de firmantes en una firma
de anillo, lo cual teóricamente proporciona una mayor negación plausible. Pero configurar
tamaños de anillo altos también puede provocar que tu transacción quede fuera de la
cadena de bloques.</p>

View File

@@ -285,6 +285,8 @@
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
<h3>easylogging++ (https://github.com/monero-project/monero/tree/master/external/easylogging%2B%2B)</h3>
Copyright (c) 2017 muflihun.com
<h3>zxcvbn4j (https://github.com/nulab/zxcvbn4j)</h3>
Copyright (c) 2014 Nulab Inc
<h3>The MIT License</h3>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<br/>
<br/>

View File

@@ -148,7 +148,7 @@
transaction with an item you bought.<p>
<h2>Ring size</h2>
<p>There are a number of ring sizes to choose from in Monerujo. If you are a beginner user
we recommend you stick with a ring size of 5. Increasing the ring size above 5 increases
we recommend you stick with a ring size of 7. Increasing the ring size above 7 increases
the amount of signers in a ring signature, theoretically providing increased plausible
deniability. However setting high ring sizes can also make your transaction stand out on
the blockchain.</p>
@@ -213,4 +213,4 @@
previous step and then coming back to the \"Confirm\" screen.</p>
]]></string>
</resources>
</resources>

View File

@@ -6,10 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath files('external-libs/gradle-witness.jar')
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.1.1'
}
}
@@ -27,6 +24,7 @@ task clean(type: Delete) {
}
ext {
apkName = 'monerujo'
okHttpVersion = '3.9.0'
junitVersion = '4.12'
mockitoVersion = '1.10.19'

View File

@@ -64,16 +64,16 @@ ln -s /opt/android/build/openssl/include /opt/android/build/openssl/x86_64/inclu
```
```Shell
ln -sf /opt/android/build/openssl/include /opt/android/tool/arm/sysroot/usr/include/openssl
ln -sf /opt/android/build/openssl/lib/armeabi-v7a/*.so /opt/android/tool/arm/sysroot/usr/lib
ln -sf /opt/android/build/openssl/arm/lib/*.so /opt/android/tool/arm/sysroot/usr/lib
ln -sf /opt/android/build/openssl/include /opt/android/tool/arm64/sysroot/usr/include/openssl
ln -sf /opt/android/build/openssl/lib/arm64-v8a/*.so /opt/android/tool/arm64/sysroot/usr/lib
ln -sf /opt/android/build/openssl/arm64/lib/*.so /opt/android/tool/arm64/sysroot/usr/lib
ln -sf /opt/android/build/openssl/include /opt/android/tool/x86/sysroot/usr/include/openssl
ln -sf /opt/android/build/openssl/lib/x86/*.so /opt/android/tool/x86/sysroot/usr/lib
ln -sf /opt/android/build/openssl/x86/lib/*.so /opt/android/tool/x86/sysroot/usr/lib
ln -sf /opt/android/build/openssl/include /opt/android/tool/x86_64/sysroot/usr/include/openssl
ln -sf /opt/android/build/openssl/lib/x86_64/*.so /opt/android/tool/x86_64/sysroot/usr/lib64
ln -sf /opt/android/build/openssl/x86_64/lib/*.so /opt/android/tool/x86_64/sysroot/usr/lib64
```
## Build Boost

Binary file not shown.

View File

@@ -15,3 +15,6 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# keep build timestamps in APK
android.keepTimestampsInApk = true

View File

@@ -1,6 +1,6 @@
#Wed Oct 25 23:06:49 CEST 2017
#Mon Apr 09 08:52:01 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip