1
mirror of https://github.com/m2049r/xmrwallet synced 2025-09-02 15:53:04 +02:00

Compare commits

...

24 Commits

Author SHA1 Message Date
m2049r
65991ff554 bump version 2018-09-17 17:58:24 +02:00
m2049r
b0629e46e8 correct address entry message (#409) 2018-09-17 17:56:04 +02:00
m2049r
45ec3198a0 bump version & fix permissions (#408) 2018-09-17 11:50:06 +02:00
m2049r
9b66c466f2 update licenses (#407) 2018-09-17 11:48:12 +02:00
m2049r
d257e183ad tweak message (#406) 2018-09-17 10:07:21 +02:00
m2049r
10d8e441fe Ledger translations (#405)
- zh-rCN, ru, nb, sv, it, es, ro, el, pt missing
2018-09-17 10:03:52 +02:00
m2049r
9f9bc4793d OpenAlias support for XMR & BTC (#404)
* with support for OpenAlias QR Codes
2018-09-17 09:03:07 +02:00
m2049r
8b28e3ea1e check ACTION_DOWN when KEYCODE_ENTER (#403) 2018-09-16 18:16:55 +02:00
m2049r
e394394538 Description in QR Code (#401)
* use notes in qr code

* remove payment id on receive

* prep translations
2018-09-14 21:15:10 +02:00
jar'o Lee
7424ef07f7 Slovak Translation #2 (#341) 2018-09-07 22:58:35 +02:00
Lafudoci
f5ce6ec824 Update zh-rTW translation (#388)
* Update zh-rTW translation

* Unify the space between english and zh character.

* Follow W3C requirements for text layout

* Unify the space between English and zh characters in other files
* Use full-width punctuation marks

* Adjust the position of line break
2018-09-04 00:26:29 +02:00
m2049r
4215a8bf9e Better offline estimation of restore height (#398)
* 2018-09-01 blockheight

* better offline restore height estimate for new wallets
2018-09-04 00:25:18 +02:00
m2049r
8b016f93dc bump version 2018-08-19 13:45:05 +02:00
m2049r
b239a5094b Upgrade targetSdkVersion to Oreo (27) (#392)
* targetSdkVersion 27

* fix unescaped apostrophes in strings

* update Oreo notifications
2018-08-18 15:50:06 +02:00
m2049r
6a2de36578 prevent unregisterReceiver if not registered (#387) 2018-08-12 13:31:25 +02:00
m2049r
5aded68c53 Improve Send Workflow (#386)
* remove password query on initial spend screen

* report error if send tx fails

* better failed tx alert
2018-08-11 12:23:00 +02:00
m2049r
d78a2be120 send_qr_hint is not translatable (#385) 2018-08-10 16:59:39 +02:00
m2049r
e6c7800911 update gradle version 2018-08-10 16:52:14 +02:00
Attila
cbbe079f67 Hungarian update (#384)
NFC translation plus a minor fix added.
2018-08-10 16:52:48 +02:00
m2049r
7fc2dc3ba1 bump version code 2018-08-08 22:10:39 +02:00
m2049r
43204d64ef Interim merge of Ledger translations (#383)
* Ledger french translation (#359)

* zh-TW translation for Ledger (#368, #373)

* Hungarian Ledgers strings added (#372)

* German translation

* update help about entering height
2018-08-08 22:10:28 +02:00
m2049r
1433143a39 Use NFC for receive & send (#380)
* Use NFC Tag for receive & send

* prep translations
2018-08-06 22:18:57 +02:00
m2049r
a9a78393a9 clear amounts when typing (#379) 2018-08-05 23:26:01 +02:00
m2049r
fe7ab31050 getRestoreHeight (#378) 2018-08-05 23:25:41 +02:00
58 changed files with 3323 additions and 1284 deletions

View File

@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '27.0.3'
compileSdkVersion 27
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.m2049r.xmrwallet"
minSdkVersion 21
targetSdkVersion 25
versionCode 111
versionName "1.6.1 'Nano S'"
targetSdkVersion 27
versionCode 122
versionName "1.7.2 'OpenAlias'"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
@@ -70,11 +70,11 @@ android {
}
dependencies {
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:appcompat-v7:$rootProject.ext.supportVersion"
implementation "com.android.support:design:$rootProject.ext.supportVersion"
implementation "com.android.support:support-v4:$rootProject.ext.supportVersion"
implementation "com.android.support:recyclerview-v7:$rootProject.ext.supportVersion"
implementation "com.android.support:cardview-v7:$rootProject.ext.supportVersion"
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation "com.squareup.okhttp3:okhttp:$rootProject.ext.okHttpVersion"
@@ -82,6 +82,10 @@ dependencies {
implementation 'com.nulab-inc:zxcvbn:1.2.3'
implementation 'dnsjava:dnsjava:2.1.8'
implementation 'org.jitsi:dnssecjava:1.1.3'
implementation 'org.slf4j:slf4j-nop:1.7.25'
testImplementation "junit:junit:$rootProject.ext.junitVersion"
testImplementation "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
testImplementation "com.squareup.okhttp3:mockwebserver:$rootProject.ext.okHttpVersion"

View File

@@ -8,10 +8,11 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.NFC" />
<application
android:name=".XmrWalletApplication"
android:allowBackup="true"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
@@ -41,32 +42,12 @@
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/usb_device_filter" />
</activity>
<!--activity
android:name=".util.UsbEventReceiverActivity"
android:excludeFromRecents="true"
android:exported="false"
android:label="@string/app_name"
android:noHistory="true"
android:process=":UsbEventReceiverActivityProcess"
android:taskAffinity="com.m2049r.xmrwallet.taskAffinityUsbEventReceiver"
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/usb_device_filter" />
</activity-->
<service
android:name=".service.WalletService"
android:description="@string/service_description"
android:exported="false"
android:label="Monero Wallet Service" />
</application>
</manifest>

File diff suppressed because it is too large Load Diff

View File

@@ -417,8 +417,8 @@ Java_com_m2049r_xmrwallet_model_WalletManager_verifyWalletPassword(JNIEnv *env,
//virtual int queryWalletHardware(const std::string &keys_file_name, const std::string &password) const = 0;
JNIEXPORT jint JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_queryWalletHardware(JNIEnv *env, jobject instance,
jstring keys_file_name,
jstring password) {
jstring keys_file_name,
jstring password) {
const char *_keys_file_name = env->GetStringUTFChars(keys_file_name, NULL);
const char *_password = env->GetStringUTFChars(password, NULL);
int hardwareId =
@@ -686,7 +686,20 @@ Java_com_m2049r_xmrwallet_model_Wallet_initJ(JNIEnv *env, jobject instance,
}
// virtual bool createWatchOnly(const std::string &path, const std::string &password, const std::string &language) const = 0;
// virtual void setRefreshFromBlockHeight(uint64_t refresh_from_block_height) = 0;
JNIEXPORT void JNICALL
Java_com_m2049r_xmrwallet_model_Wallet_setRestoreHeight(JNIEnv *env, jobject instance,
jlong height) {
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
wallet->setRefreshFromBlockHeight((uint64_t) height);
}
JNIEXPORT jlong JNICALL
Java_com_m2049r_xmrwallet_model_Wallet_getRestoreHeight(JNIEnv *env, jobject instance) {
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
return wallet->getRefreshFromBlockHeight();
}
// virtual void setRecoveringFromSeed(bool recoveringFromSeed) = 0;
// virtual bool connectToDaemon() = 0;

View File

@@ -1,14 +1,33 @@
package com.m2049r.xmrwallet;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.nfc.FormatException;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.nfc.tech.Ndef;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.support.annotation.CallSuper;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.widget.Toast;
import com.m2049r.xmrwallet.data.BarcodeData;
import com.m2049r.xmrwallet.dialog.ProgressDialog;
import com.m2049r.xmrwallet.fragment.send.SendFragment;
import com.m2049r.xmrwallet.ledger.Ledger;
import com.m2049r.xmrwallet.ledger.LedgerProgressDialog;
import java.io.IOException;
import timber.log.Timber;
public class BaseActivity extends SecureActivity implements GenerateReviewFragment.ProgressListener {
@@ -102,4 +121,174 @@ public class BaseActivity extends SecureActivity implements GenerateReviewFragme
wl = null;
Timber.d("WakeLock released");
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initNfc();
}
@Override
protected void onPostResume() {
super.onPostResume();
if (nfcAdapter != null) {
nfcAdapter.enableForegroundDispatch(this, nfcPendingIntent, null, null);
// intercept all techs so we can tell the user their tag is no good
}
}
@Override
protected void onPause() {
Timber.d("onPause()");
if (nfcAdapter != null)
nfcAdapter.disableForegroundDispatch(this);
super.onPause();
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
processNfcIntent(intent);
}
// NFC stuff
private NfcAdapter nfcAdapter;
private PendingIntent nfcPendingIntent;
public void initNfc() {
nfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (nfcAdapter == null) // no NFC support
return;
nfcPendingIntent = PendingIntent.getActivity(this, 0,
new Intent(this, getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),
0);
}
private void processNfcIntent(Intent intent) {
String action = intent.getAction();
Timber.d("ACTION=%s", action);
if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_TAG_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)) {
Tag tag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
Ndef ndef = Ndef.get(tag);
if (ndef == null) {
Toast.makeText(this, getString(R.string.nfc_tag_unsupported), Toast.LENGTH_LONG).show();
return;
}
Fragment f = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
if (f instanceof ReceiveFragment) {
// We want to write a Tag from the ReceiveFragment
BarcodeData bc = ((ReceiveFragment) f).getBarcodeData();
if (bc != null) {
new AsyncWriteTag(ndef, bc.getUri()).execute();
} // else wallet is not loaded yet or receive is otherwise not ready - ignore
} else if (f instanceof SendFragment) {
// We want to read a Tag for the SendFragment
NdefMessage ndefMessage = ndef.getCachedNdefMessage();
if (ndefMessage == null) {
Toast.makeText(this, getString(R.string.nfc_tag_read_undef), Toast.LENGTH_LONG).show();
return;
}
NdefRecord firstRecord = ndefMessage.getRecords()[0];
Uri uri = firstRecord.toUri(); // we insist on the first record
if (uri == null) {
Toast.makeText(this, getString(R.string.nfc_tag_read_undef), Toast.LENGTH_LONG).show();
} else {
BarcodeData bc = BarcodeData.fromQrCode(uri.toString());
if (bc == null)
Toast.makeText(this, getString(R.string.nfc_tag_read_undef), Toast.LENGTH_LONG).show();
else
onUriScanned(bc);
}
}
}
}
// this gets called only if we get data
@CallSuper
void onUriScanned(BarcodeData barcodeData) {
// do nothing by default yet
}
private BarcodeData barcodeData = null;
private BarcodeData popBarcodeData() {
BarcodeData popped = barcodeData;
barcodeData = null;
return popped;
}
private class AsyncWriteTag extends AsyncTask<Void, Void, Boolean> {
Ndef ndef;
Uri uri;
String errorMessage = null;
AsyncWriteTag(Ndef ndef, Uri uri) {
this.ndef = ndef;
this.uri = uri;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
showProgressDialog(R.string.progress_nfc_write);
}
@Override
protected Boolean doInBackground(Void... params) {
if (params.length != 0) return false;
try {
writeNdef(ndef, uri);
return true;
} catch (IOException | FormatException ex) {
Timber.e(ex);
} catch (IllegalArgumentException ex) {
errorMessage = ex.getMessage();
Timber.d(errorMessage);
} finally {
try {
ndef.close();
} catch (IOException ex) {
Timber.e(ex);
}
}
return false;
}
@Override
protected void onPostExecute(Boolean result) {
super.onPostExecute(result);
if (isDestroyed()) {
return;
}
dismissProgressDialog();
if (!result) {
if (errorMessage != null)
Toast.makeText(getApplicationContext(), errorMessage, Toast.LENGTH_LONG).show();
else
Toast.makeText(getApplicationContext(), getString(R.string.nfc_write_failed), Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(), getString(R.string.nfc_write_successful), Toast.LENGTH_SHORT).show();
}
}
}
void writeNdef(Ndef ndef, Uri uri) throws IOException, FormatException {
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(this);
if (nfcAdapter == null) return; // no NFC support here
NdefRecord recordNFC = NdefRecord.createUri(uri);
NdefMessage message = new NdefMessage(recordNFC);
ndef.connect();
int tagSize = ndef.getMaxSize();
int msgSize = message.getByteArrayLength();
Timber.d("tagSize=%d, msgSIze=%d, uriSize=%d", tagSize, msgSize, uri.toString().length());
if (tagSize < msgSize)
throw new IllegalArgumentException(getString(R.string.nfc_tag_size, tagSize, msgSize));
ndef.writeNdefMessage(message);
}
}

View File

@@ -145,7 +145,8 @@ public class GenerateFragment extends Fragment {
etWalletName.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
if (checkName()) {
etWalletPassword.requestFocus();
} // otherwise ignore
@@ -183,7 +184,8 @@ public class GenerateFragment extends Fragment {
etWalletPassword.getEditText().setImeOptions(EditorInfo.IME_ACTION_DONE);
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
Helper.hideKeyboard(getActivity());
generateWallet();
return true;
@@ -195,7 +197,8 @@ public class GenerateFragment extends Fragment {
etWalletPassword.getEditText().setImeOptions(EditorInfo.IME_ACTION_DONE);
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
etWalletRestoreHeight.requestFocus();
return true;
}
@@ -205,7 +208,8 @@ public class GenerateFragment extends Fragment {
} else if (type.equals(TYPE_SEED)) {
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
etWalletMnemonic.requestFocus();
return true;
}
@@ -215,7 +219,8 @@ public class GenerateFragment extends Fragment {
etWalletMnemonic.setVisibility(View.VISIBLE);
etWalletMnemonic.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
if (checkMnemonic()) {
etWalletRestoreHeight.requestFocus();
}
@@ -227,7 +232,8 @@ public class GenerateFragment extends Fragment {
} else if (type.equals(TYPE_KEY) || type.equals(TYPE_VIEWONLY)) {
etWalletPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
etWalletAddress.requestFocus();
return true;
}
@@ -239,7 +245,8 @@ public class GenerateFragment extends Fragment {
{
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
if (checkAddress()) {
etWalletViewKey.requestFocus();
}
@@ -251,7 +258,8 @@ public class GenerateFragment extends Fragment {
etWalletViewKey.setVisibility(View.VISIBLE);
etWalletViewKey.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
if (checkViewKey()) {
if (type.equals(TYPE_KEY)) {
etWalletSpendKey.requestFocus();
@@ -271,7 +279,8 @@ public class GenerateFragment extends Fragment {
{
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_NEXT)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_NEXT)) {
if (checkSpendKey()) {
etWalletRestoreHeight.requestFocus();
}
@@ -285,7 +294,8 @@ public class GenerateFragment extends Fragment {
etWalletRestoreHeight.setVisibility(View.VISIBLE);
etWalletRestoreHeight.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
Helper.hideKeyboard(getActivity());
generateWallet();
return true;

View File

@@ -594,7 +594,8 @@ public class GenerateReviewFragment extends Fragment {
// accept keyboard "ok"
etPasswordB.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
String newPasswordA = etPasswordA.getEditText().getText().toString();
String newPasswordB = etPasswordB.getEditText().getText().toString();
// disallow empty passwords

View File

@@ -149,8 +149,7 @@ public class LoginActivity extends BaseActivity
} else {
Timber.i("Waiting for permissions");
}
processIntent(getIntent());
processUsbIntent(getIntent());
}
boolean checkServiceRunning() {
@@ -327,7 +326,8 @@ public class LoginActivity extends BaseActivity
// accept keyboard "ok"
etRename.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
Helper.hideKeyboardAlways(LoginActivity.this);
String newName = etRename.getText().toString();
dialog.cancel();
@@ -1255,10 +1255,10 @@ public class LoginActivity extends BaseActivity
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
processIntent(intent);
processUsbIntent(intent);
}
private void processIntent(Intent intent) {
private void processUsbIntent(Intent intent) {
String action = intent.getAction();
if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action)) {
synchronized (this) {
@@ -1277,7 +1277,10 @@ public class LoginActivity extends BaseActivity
BroadcastReceiver detachReceiver;
private void unregisterDetachReceiver() {
if (detachReceiver != null) unregisterReceiver(detachReceiver);
if (detachReceiver != null) {
unregisterReceiver(detachReceiver);
detachReceiver = null;
}
}
private void registerDetachReceiver() {

View File

@@ -206,7 +206,8 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
etDaemonAddress.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
Helper.hideKeyboard(getActivity());
etDummy.requestFocus();
return true;

View File

@@ -0,0 +1,23 @@
/*
* Copyright (c) 2017 m2049r
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.m2049r.xmrwallet;
import com.m2049r.xmrwallet.data.BarcodeData;
public interface OnUriScannedListener {
boolean onUriScanned(BarcodeData barcodeData);
}

View File

@@ -20,13 +20,12 @@ import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.nfc.NfcManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.Fragment;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
@@ -65,9 +64,8 @@ public class ReceiveFragment extends Fragment {
private ProgressBar pbProgress;
private TextView tvAddressLabel;
private TextView tvAddress;
private TextInputLayout etPaymentId;
private TextInputLayout etNotes;
private ExchangeView evAmount;
private Button bPaymentId;
private TextView tvQrCode;
private ImageView qrCode;
private ImageView qrCodeFull;
@@ -95,9 +93,8 @@ public class ReceiveFragment extends Fragment {
pbProgress = (ProgressBar) view.findViewById(R.id.pbProgress);
tvAddressLabel = (TextView) view.findViewById(R.id.tvAddressLabel);
tvAddress = (TextView) view.findViewById(R.id.tvAddress);
etPaymentId = (TextInputLayout) view.findViewById(R.id.etPaymentId);
etNotes = (TextInputLayout) view.findViewById(R.id.etNotes);
evAmount = (ExchangeView) view.findViewById(R.id.evAmount);
bPaymentId = (Button) view.findViewById(R.id.bPaymentId);
qrCode = (ImageView) view.findViewById(R.id.qrCode);
tvQrCode = (TextView) view.findViewById(R.id.tvQrCode);
qrCodeFull = (ImageView) view.findViewById(R.id.qrCodeFull);
@@ -105,7 +102,6 @@ public class ReceiveFragment extends Fragment {
bCopyAddress = (ImageButton) view.findViewById(R.id.bCopyAddress);
bSubaddress = (Button) view.findViewById(R.id.bSubaddress);
etPaymentId.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
etDummy.setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
bCopyAddress.setOnClickListener(new View.OnClickListener() {
@@ -134,41 +130,18 @@ public class ReceiveFragment extends Fragment {
}
});
etPaymentId.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
final EditText notesEdit = etNotes.getEditText();
notesEdit.setRawInputType(InputType.TYPE_CLASS_TEXT);
notesEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if (checkPaymentId()) { // && evAmount.checkXmrAmount(true)) {
generateQr();
}
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
generateQr();
return true;
}
return false;
}
});
etPaymentId.getEditText().addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable editable) {
clearQR();
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
});
bPaymentId.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
etPaymentId.getEditText().setText((Wallet.generatePaymentId()));
etPaymentId.getEditText().setSelection(etPaymentId.getEditText().getText().length());
if (checkPaymentId()) { //&& evAmount.checkXmrAmount(true)) {
generateQr();
}
}
});
bSubaddress.setOnClickListener(new View.OnClickListener() {
@Override
@@ -193,7 +166,7 @@ public class ReceiveFragment extends Fragment {
if (qrValid) {
qrCodeFull.setImageBitmap(((BitmapDrawable) qrCode.getDrawable()).getBitmap());
qrCodeFull.setVisibility(View.VISIBLE);
} else if (checkPaymentId()) {
} else {
evAmount.doExchange();
}
}
@@ -226,6 +199,12 @@ public class ReceiveFragment extends Fragment {
throw new IllegalStateException("no wallet info");
}
}
View tvNfc = view.findViewById(R.id.tvNfc);
NfcManager manager = (NfcManager) getContext().getSystemService(Context.NFC_SERVICE);
if ((manager != null) && (manager.getDefaultAdapter() != null))
tvNfc.setVisibility(View.VISIBLE);
return view;
}
@@ -257,7 +236,7 @@ public class ReceiveFragment extends Fragment {
void setQR(Bitmap qr) {
qrCode.setImageBitmap(qr);
qrValid = true;
tvQrCode.setVisibility(View.INVISIBLE);
tvQrCode.setVisibility(View.GONE);
Helper.hideKeyboard(getActivity());
etDummy.requestFocus();
}
@@ -284,8 +263,6 @@ public class ReceiveFragment extends Fragment {
listenerCallback.setTitle(wallet.getName());
listenerCallback.setSubtitle(wallet.getAccountLabel());
tvAddress.setText(wallet.getAddress());
etPaymentId.setEnabled(true);
bPaymentId.setEnabled(true);
enableCopyAddress(true);
hideProgress();
generateQr();
@@ -373,51 +350,29 @@ public class ReceiveFragment extends Fragment {
}
}
private boolean checkPaymentId() {
String paymentId = etPaymentId.getEditText().getText().toString();
boolean ok = paymentId.isEmpty() || Wallet.isPaymentIdValid(paymentId);
if (!ok) {
etPaymentId.setError(getString(R.string.receive_paymentid_invalid));
} else {
etPaymentId.setError(null);
}
return ok;
public BarcodeData getBarcodeData() {
if (qrValid)
return bcData;
else
return null;
}
private BarcodeData bcData = null;
private void generateQr() {
Timber.d("GENQR");
String address = tvAddress.getText().toString();
String paymentId = etPaymentId.getEditText().getText().toString();
String notes = etNotes.getEditText().getText().toString();
String xmrAmount = evAmount.getAmount();
Timber.d("%s/%s/%s", xmrAmount, paymentId, address);
Timber.d("%s/%s/%s", xmrAmount, notes, address);
if ((xmrAmount == null) || !Wallet.isAddressValid(address)) {
clearQR();
Timber.d("CLEARQR");
return;
}
StringBuffer sb = new StringBuffer();
sb.append(BarcodeData.XMR_SCHEME).append(address);
boolean first = true;
if (!paymentId.isEmpty()) {
if (first) {
sb.append("?");
first = false;
}
sb.append(BarcodeData.XMR_PAYMENTID).append('=').append(paymentId);
}
if (!xmrAmount.isEmpty()) {
if (first) {
sb.append("?");
} else {
sb.append("&");
}
sb.append(BarcodeData.XMR_AMOUNT).append('=').append(xmrAmount);
}
String text = sb.toString();
bcData = new BarcodeData(BarcodeData.Asset.XMR, address, null, notes, xmrAmount);
int size = Math.min(qrCode.getHeight(), qrCode.getWidth());
Bitmap qr = generate(text, size, size);
Bitmap qr = generate(bcData.getUriString(), size, size);
if (qr != null) {
setQR(qr);
Timber.d("SETQR");

View File

@@ -27,7 +27,6 @@ import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.IBinder;
import android.os.PowerManager;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
@@ -274,6 +273,7 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
break;
case Toolbar.BUTTON_CANCEL:
onDisposeRequest();
Helper.hideKeyboard(WalletActivity.this);
WalletActivity.super.onBackPressed();
break;
case Toolbar.BUTTON_CLOSE:
@@ -432,17 +432,7 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
@Override
public void onSendRequest() {
if (needVerifyIdentity) {
Helper.promptPassword(WalletActivity.this, getWallet().getName(), true, new Helper.PasswordAction() {
@Override
public void action(String walletName, String password, boolean fingerprintUsed) {
replaceFragment(new SendFragment(), null, null);
needVerifyIdentity = false;
}
});
} else {
replaceFragment(new SendFragment(), null, null);
}
replaceFragment(new SendFragment(), null, null);
}
@Override
@@ -841,26 +831,39 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
}
private BarcodeData scannedData = null;
@Override
public boolean onScanned(String qrCode) {
// #gurke
BarcodeData bcData = BarcodeData.fromQrCode(qrCode);
if (bcData != null) {
this.scannedData = bcData;
popFragmentStack(null);
Timber.d("AAA");
onUriScanned(bcData);
return true;
} else {
return false;
}
}
OnUriScannedListener onUriScannedListener = null;
@Override
public BarcodeData popScannedData() {
BarcodeData data = scannedData;
scannedData = null;
return data;
public void setOnUriScannedListener(OnUriScannedListener onUriScannedListener) {
this.onUriScannedListener = onUriScannedListener;
}
@Override
void onUriScanned(BarcodeData barcodeData) {
super.onUriScanned(barcodeData);
boolean processed = false;
if (onUriScannedListener != null) {
processed = onUriScannedListener.onUriScanned(barcodeData);
}
if (!processed || (onUriScannedListener == null)) {
Toast.makeText(this, getString(R.string.nfc_tag_read_what), Toast.LENGTH_LONG).show();
} else {
Toast.makeText(this, getString(R.string.nfc_tag_read_success), Toast.LENGTH_SHORT).show();
}
}
@Override
@@ -918,7 +921,6 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
drawer.closeDrawer(GravityCompat.START);
return;
}
final Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
if (fragment instanceof OnBackPressedListener) {
if (!((OnBackPressedListener) fragment).onBackPressed()) {
@@ -1024,7 +1026,8 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
// accept keyboard "ok"
etRename.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
Helper.hideKeyboardAlways(WalletActivity.this);
String newName = etRename.getText().toString();
dialog.cancel();

View File

@@ -18,10 +18,9 @@ package com.m2049r.xmrwallet.data;
import android.net.Uri;
import com.m2049r.xmrwallet.model.NetworkType;
import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.model.WalletManager;
import com.m2049r.xmrwallet.util.BitcoinAddressValidator;
import com.m2049r.xmrwallet.util.OpenAliasHelper;
import java.util.HashMap;
import java.util.Map;
@@ -29,9 +28,14 @@ import java.util.Map;
import timber.log.Timber;
public class BarcodeData {
public static final String XMR_SCHEME = "monero:";
public static final String XMR_PAYMENTID = "tx_payment_id";
public static final String XMR_AMOUNT = "tx_amount";
public static final String XMR_DESCRIPTION = "tx_description";
public static final String OA_XMR_ASSET = "xmr";
public static final String OA_BTC_ASSET = "btc";
static final String BTC_SCHEME = "bitcoin:";
static final String BTC_AMOUNT = "amount";
@@ -40,10 +44,24 @@ public class BarcodeData {
XMR, BTC
}
public enum Security {
NORMAL,
OA_NO_DNSSEC,
OA_DNSSEC
}
public Asset asset = null;
public String addressName = null;
public String address = null;
public String paymentId = null;
public String amount = null;
public String description = null;
public Security security = Security.NORMAL;
public BarcodeData(String uri) {
this.asset = asset;
this.address = address;
}
public BarcodeData(Asset asset, String address) {
this.asset = asset;
@@ -63,6 +81,48 @@ public class BarcodeData {
this.amount = amount;
}
public BarcodeData(Asset asset, String address, String paymentId, String description, String amount) {
this.asset = asset;
this.address = address;
this.paymentId = paymentId;
this.description = description;
this.amount = amount;
}
public void setAddressName(String name) {
addressName = name;
}
public void setSecurity(Security security) {
this.security = security;
}
public Uri getUri() {
return Uri.parse(getUriString());
}
public String getUriString() {
if (asset != Asset.XMR) throw new IllegalStateException("We can only do XMR stuff!");
StringBuilder sb = new StringBuilder();
sb.append(BarcodeData.XMR_SCHEME).append(address);
boolean first = true;
if ((paymentId != null) && !paymentId.isEmpty()) {
sb.append("?");
first = false;
sb.append(BarcodeData.XMR_PAYMENTID).append('=').append(paymentId);
}
if ((description != null) && !description.isEmpty()) {
sb.append(first ? "?" : "&");
first = false;
sb.append(BarcodeData.XMR_DESCRIPTION).append('=').append(Uri.encode(description));
}
if ((amount != null) && !amount.isEmpty()) {
sb.append(first ? "?" : "&");
sb.append(BarcodeData.XMR_AMOUNT).append('=').append(amount);
}
return sb.toString();
}
static public BarcodeData fromQrCode(String qrCode) {
// check for monero uri
BarcodeData bcData = parseMoneroUri(qrCode);
@@ -74,10 +134,14 @@ public class BarcodeData {
if (bcData == null) {
bcData = parseBitcoinUri(qrCode);
}
// check for naked btc addres
// check for naked btc address
if (bcData == null) {
bcData = parseBitcoinNaked(qrCode);
}
// check for OpenAlias
if (bcData == null) {
bcData = parseOpenAlias(qrCode);
}
return bcData;
}
@@ -112,6 +176,7 @@ public class BarcodeData {
}
String address = monero.getPath();
String paymentId = parms.get(XMR_PAYMENTID);
String description = parms.get(XMR_DESCRIPTION);
String amount = parms.get(XMR_AMOUNT);
if (amount != null) {
try {
@@ -130,7 +195,7 @@ public class BarcodeData {
Timber.d("address invalid");
return null;
}
return new BarcodeData(Asset.XMR, address, paymentId, amount);
return new BarcodeData(Asset.XMR, address, paymentId, description, amount);
}
static public BarcodeData parseMoneroNaked(String address) {
@@ -198,4 +263,61 @@ public class BarcodeData {
return new BarcodeData(BarcodeData.Asset.BTC, address);
}
static public BarcodeData parseOpenAlias(String oaString) {
Timber.d("parseOpenAlias=%s", oaString);
if (oaString == null) return null;
Map<String, String> oaAttrs = OpenAliasHelper.parse(oaString);
if (oaAttrs == null) return null;
String oaAsset = oaAttrs.get(OpenAliasHelper.OA1_ASSET);
if (oaAsset == null) return null;
String address = oaAttrs.get(OpenAliasHelper.OA1_ADDRESS);
if (address == null) return null;
Asset asset;
if (OA_XMR_ASSET.equals(oaAsset)) {
if (!Wallet.isAddressValid(address)) {
Timber.d("XMR address invalid");
return null;
}
asset = Asset.XMR;
} else if (OA_BTC_ASSET.equals(oaAsset)) {
if (!BitcoinAddressValidator.validate(address)) {
Timber.d("BTC address invalid");
return null;
}
asset = Asset.BTC;
} else {
Timber.i("Unsupported OpenAlias asset %s", oaAsset);
return null;
}
String paymentId = oaAttrs.get(OpenAliasHelper.OA1_PAYMENTID);
String description = oaAttrs.get(OpenAliasHelper.OA1_DESCRIPTION);
if (description == null) {
description = oaAttrs.get(OpenAliasHelper.OA1_NAME);
}
String amount = oaAttrs.get(OpenAliasHelper.OA1_AMOUNT);
String addressName = oaAttrs.get(OpenAliasHelper.OA1_NAME);
if (amount != null) {
try {
Double.parseDouble(amount);
} catch (NumberFormatException ex) {
Timber.d(ex.getLocalizedMessage());
return null; // we have an amount but its not a number!
}
}
if ((paymentId != null) && !Wallet.isPaymentIdValid(paymentId)) {
Timber.d("paymentId invalid");
return null;
}
BarcodeData bc = new BarcodeData(asset, address, paymentId, description, amount);
bc.setAddressName(addressName);
return bc;
}
}

View File

@@ -32,6 +32,14 @@ import android.widget.TextView;
import com.m2049r.xmrwallet.BuildConfig;
import com.m2049r.xmrwallet.R;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import timber.log.Timber;
public class AboutFragment extends DialogFragment {
static final String TAG = "AboutFragment";
@@ -52,7 +60,7 @@ public class AboutFragment extends DialogFragment {
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final View view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_about, null);
((TextView) view.findViewById(R.id.tvHelp)).setText(Html.fromHtml(getString(R.string.about_licenses)));
((TextView) view.findViewById(R.id.tvHelp)).setText(Html.fromHtml(getLicencesHtml()));
((TextView) view.findViewById(R.id.tvVersion)).setText(getString(R.string.about_version, BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE));
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
@@ -66,4 +74,18 @@ public class AboutFragment extends DialogFragment {
});
return builder.create();
}
private String getLicencesHtml() {
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(getContext().getAssets().open("licenses.html"), StandardCharsets.UTF_8))) {
StringBuilder sb = new StringBuilder();
String line;
while ((line = reader.readLine()) != null)
sb.append(line);
return sb.toString();
} catch (IOException ex) {
Timber.e(ex);
return ex.getLocalizedMessage();
}
}
}

View File

@@ -216,9 +216,9 @@ public class SendBtcConfirmWizardFragment extends SendWizardFragment implements
}
@Override
public void sendFailed() {
Timber.e("SEND FAILED");
public void sendFailed(String error) {
pbProgressSend.setVisibility(View.INVISIBLE);
Toast.makeText(getContext(), getString(R.string.status_transaction_failed, error), Toast.LENGTH_LONG).show();
}
@Override
@@ -421,7 +421,8 @@ public class SendBtcConfirmWizardFragment extends SendWizardFragment implements
// accept keyboard "ok"
etPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
String pass = etPassword.getEditText().getText().toString();
if (getActivityCallback().verifyWalletPassword(pass)) {
Helper.hideKeyboardAlways(activity);

View File

@@ -19,7 +19,7 @@ package com.m2049r.xmrwallet.fragment.send;
import com.m2049r.xmrwallet.model.PendingTransaction;
interface SendConfirm {
void sendFailed();
void sendFailed(String errorText);
void createTransactionFailed(String errorText);

View File

@@ -145,17 +145,22 @@ public class SendConfirmWizardFragment extends SendWizardFragment implements Sen
}
@Override
public void sendFailed() {
public void sendFailed(String errorText) {
pbProgressSend.setVisibility(View.INVISIBLE);
showAlert(getString(R.string.send_create_tx_error_title), errorText);
}
@Override
public void createTransactionFailed(String errorText) {
hideProgress();
showAlert(getString(R.string.send_create_tx_error_title), errorText);
}
private void showAlert(String title, String message) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setCancelable(true).
setTitle(getString(R.string.send_create_tx_error_title)).
setMessage(errorText).
setTitle(title).
setMessage(message).
create().
show();
}
@@ -297,7 +302,8 @@ public class SendConfirmWizardFragment extends SendWizardFragment implements Sen
// accept keyboard "ok"
etPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
String pass = etPassword.getEditText().getText().toString();
if (getActivityCallback().verifyWalletPassword(pass)) {
Helper.hideKeyboardAlways(activity);

View File

@@ -37,16 +37,15 @@ import android.widget.EditText;
import android.widget.Toast;
import com.m2049r.xmrwallet.OnBackPressedListener;
import com.m2049r.xmrwallet.OnUriScannedListener;
import com.m2049r.xmrwallet.R;
import com.m2049r.xmrwallet.data.BarcodeData;
import com.m2049r.xmrwallet.data.PendingTx;
import com.m2049r.xmrwallet.data.TxData;
import com.m2049r.xmrwallet.data.TxDataBtc;
import com.m2049r.xmrwallet.dialog.HelpFragment;
import com.m2049r.xmrwallet.layout.SpendViewPager;
import com.m2049r.xmrwallet.model.PendingTransaction;
import com.m2049r.xmrwallet.util.Helper;
import com.m2049r.xmrwallet.util.NodeList;
import com.m2049r.xmrwallet.util.Notice;
import com.m2049r.xmrwallet.util.UserNotes;
import com.m2049r.xmrwallet.widget.DotBar;
@@ -62,7 +61,7 @@ public class SendFragment extends Fragment
SendSettingsWizardFragment.Listener,
SendConfirmWizardFragment.Listener,
SendSuccessWizardFragment.Listener,
OnBackPressedListener {
OnBackPressedListener, OnUriScannedListener {
private Listener activityCallback;
@@ -86,6 +85,8 @@ public class SendFragment extends Fragment
void setTitle(String title);
void setSubtitle(String subtitle);
void setOnUriScannedListener(OnUriScannedListener onUriScannedListener);
}
private EditText etDummy;
@@ -99,10 +100,6 @@ public class SendFragment extends Fragment
private Button bDone;
private View llXmrToEnabled;
private View ibXmrToInfoClose;
static private int MAX_FALLBACK = Integer.MAX_VALUE;
@Override
@@ -121,7 +118,7 @@ public class SendFragment extends Fragment
arrowNext = getResources().getDrawable(R.drawable.ic_navigate_next_white_24dp);
ViewGroup llNotice = (ViewGroup) view.findViewById(R.id.llNotice);
Notice.showAll(llNotice,".*_send");
Notice.showAll(llNotice, ".*_send");
spendViewPager = (SpendViewPager) view.findViewById(R.id.pager);
pagerAdapter = new SpendPagerAdapter(getChildFragmentManager());
@@ -226,13 +223,20 @@ public class SendFragment extends Fragment
Timber.d("onAttach %s", context);
super.onAttach(context);
if (context instanceof Listener) {
this.activityCallback = (Listener) context;
activityCallback = (Listener) context;
activityCallback.setOnUriScannedListener(this);
} else {
throw new ClassCastException(context.toString()
+ " must implement Listener");
}
}
@Override
public void onDetach() {
activityCallback.setOnUriScannedListener(null);
super.onDetach();
}
private SpendViewPager spendViewPager;
private SpendPagerAdapter pagerAdapter;
@@ -247,6 +251,18 @@ public class SendFragment extends Fragment
}
}
@Override
public boolean onUriScanned(BarcodeData barcodeData) {
if (spendViewPager.getCurrentItem() == SpendPagerAdapter.POS_ADDRESS) {
final SendWizardFragment fragment = pagerAdapter.getFragment(SpendPagerAdapter.POS_ADDRESS);
if (fragment instanceof SendAddressWizardFragment) {
((SendAddressWizardFragment) fragment).processScannedData(barcodeData);
return true;
}
}
return false;
}
enum Mode {
XMR, BTC
}
@@ -414,8 +430,14 @@ public class SendFragment extends Fragment
barcodeData = data;
}
@Override
public BarcodeData getBarcodeData() {
return barcodeData;
}
@Override
public BarcodeData popBarcodeData() {
Timber.d("POPPED");
BarcodeData data = barcodeData;
barcodeData = null;
return data;
@@ -512,12 +534,11 @@ public class SendFragment extends Fragment
public void onSendTransactionFailed(final String error) {
Timber.d("error=%s", error);
committedTx = null;
Toast.makeText(getContext(), getString(R.string.status_transaction_failed, error), Toast.LENGTH_SHORT).show();
enableNavigation();
final SendConfirm fragment = getSendConfirm();
if (fragment != null) {
fragment.sendFailed();
final SendConfirm confirm = getSendConfirm();
if (confirm != null) {
confirm.sendFailed(getString(R.string.status_transaction_failed, error));
}
enableNavigation();
}
@Override

View File

@@ -62,10 +62,8 @@ public class SendSettingsWizardFragment extends SendWizardFragment {
PendingTransaction.Priority.Priority_High}; // must match the layout XML
private Spinner sPriority;
private EditText etNotes;
private EditText etDummy;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
@@ -77,19 +75,6 @@ public class SendSettingsWizardFragment extends SendWizardFragment {
sPriority = (Spinner) view.findViewById(R.id.sPriority);
etNotes = (EditText) view.findViewById(R.id.etNotes);
etNotes.setRawInputType(InputType.TYPE_CLASS_TEXT);
etNotes.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
etDummy.requestFocus();
Helper.hideKeyboard(getActivity());
return true;
}
return false;
}
});
etDummy = (EditText) view.findViewById(R.id.etDummy);
etDummy.setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
@@ -102,7 +87,6 @@ public class SendSettingsWizardFragment extends SendWizardFragment {
TxData txData = sendListener.getTxData();
txData.setPriority(Priorities[sPriority.getSelectedItemPosition()]);
txData.setMixin(MIXIN);
txData.setUserNotes(new UserNotes(etNotes.getText().toString()));
}
return true;
}

View File

@@ -150,7 +150,12 @@ public class Wallet {
// virtual bool createWatchOnly(const std::string &path, const std::string &password, const std::string &language) const = 0;
// virtual void setRefreshFromBlockHeight(uint64_t refresh_from_block_height) = 0;
// virtual void setRecoveringFromSeed(bool recoveringFromSeed) = 0;
public native void setRestoreHeight(long height);
public native long getRestoreHeight();
// virtual void setRecoveringFromSeed(bool recoveringFromSeed) = 0;
// virtual bool connectToDaemon() = 0;
public ConnectionStatus getConnectionStatus() {

View File

@@ -18,6 +18,7 @@ package com.m2049r.xmrwallet.model;
import com.m2049r.xmrwallet.data.WalletNode;
import com.m2049r.xmrwallet.ledger.Ledger;
import com.m2049r.xmrwallet.util.RestoreHeight;
import java.io.BufferedReader;
import java.io.File;
@@ -25,6 +26,7 @@ import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import timber.log.Timber;
@@ -76,6 +78,13 @@ public class WalletManager {
long walletHandle = createWalletJ(aFile.getAbsolutePath(), password, language, getNetworkType().getValue());
Wallet wallet = new Wallet(walletHandle);
manageWallet(wallet);
if (wallet.getStatus() == Wallet.Status.Status_Ok) {
// (Re-)Estimate restore height based on what we know
long oldHeight = wallet.getRestoreHeight();
wallet.setRestoreHeight(RestoreHeight.getInstance().getHeight(new Date()));
Timber.d("Changed Restore Height from %d to %d", oldHeight, wallet.getRestoreHeight());
wallet.setPassword(password); // this rewrites the keys file (which contains the restore height)
}
return wallet;
}

View File

@@ -17,17 +17,22 @@
package com.m2049r.xmrwallet.service;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.Process;
import android.support.annotation.RequiresApi;
import android.support.v4.app.NotificationCompat;
import com.m2049r.xmrwallet.R;
import com.m2049r.xmrwallet.WalletActivity;
@@ -45,6 +50,7 @@ public class WalletService extends Service {
public static boolean Running = false;
final static int NOTIFICATION_ID = 2049;
final static String CHANNEL_ID = "m_service";
public static final String REQUEST_WALLET = "wallet";
public static final String REQUEST = "request";
@@ -340,19 +346,21 @@ public class WalletService extends Service {
Wallet myWallet = getWallet();
Timber.d("SEND TX for wallet: %s", myWallet.getName());
PendingTransaction pendingTransaction = myWallet.getPendingTransaction();
if ((pendingTransaction == null)
|| (pendingTransaction.getStatus() != PendingTransaction.Status.Status_Ok)) {
if (pendingTransaction == null) {
throw new IllegalArgumentException("PendingTransaction is null"); // die
}
if (pendingTransaction.getStatus() != PendingTransaction.Status.Status_Ok) {
Timber.e("PendingTransaction is %s", pendingTransaction.getStatus());
final String error = pendingTransaction.getErrorString();
myWallet.disposePendingTransaction(); // it's broken anyway
if (observer != null) observer.onSendTransactionFailed(error);
return;
}
final String txid = pendingTransaction.getFirstTxId();
final String txid = pendingTransaction.getFirstTxId(); // tx ids vanish after commit()!
boolean success = pendingTransaction.commit("", true);
myWallet.disposePendingTransaction();
if (observer != null) observer.onTransactionSent(txid);
if (success) {
myWallet.disposePendingTransaction();
if (observer != null) observer.onTransactionSent(txid);
String notes = extras.getString(REQUEST_CMD_SEND_NOTES);
if ((notes != null) && (!notes.isEmpty())) {
myWallet.setUserNote(txid, notes);
@@ -364,6 +372,11 @@ public class WalletService extends Service {
}
if (observer != null) observer.onWalletStored(rc);
listener.updated = true;
} else {
final String error = pendingTransaction.getErrorString();
myWallet.disposePendingTransaction();
if (observer != null) observer.onSendTransactionFailed(error);
return;
}
} else if (cmd.equals(REQUEST_CMD_SETNOTE)) {
Wallet myWallet = getWallet();
@@ -559,11 +572,26 @@ public class WalletService extends Service {
private void startNotfication() {
Intent notificationIntent = new Intent(this, WalletActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
Notification notification = new Notification.Builder(this)
String channelId = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? createNotificationChannel() : "";
Notification notification = new NotificationCompat.Builder(this, channelId)
.setContentTitle(getString(R.string.service_description))
.setOngoing(true)
.setSmallIcon(R.drawable.ic_monerujo)
.setPriority(NotificationCompat.PRIORITY_MIN)
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setContentIntent(pendingIntent)
.build();
startForeground(NOTIFICATION_ID, notification);
}
@RequiresApi(Build.VERSION_CODES.O)
private String createNotificationChannel() {
NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, getString(R.string.service_description),
NotificationManager.IMPORTANCE_LOW);
channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
notificationManager.createNotificationChannel(channel);
return CHANNEL_ID;
}
}

View File

@@ -563,7 +563,8 @@ public class Helper {
// accept keyboard "ok"
etPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
String pass = etPassword.getEditText().getText().toString();
if (loginTask == null) {
loginTask = new LoginWalletTask(pass, false);

View File

@@ -0,0 +1,245 @@
/*
* Copyright (c) 2018 m2049r
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Specs from https://openalias.org/
package com.m2049r.xmrwallet.util;
import android.os.AsyncTask;
import com.m2049r.xmrwallet.data.BarcodeData;
import org.jitsi.dnssec.validator.ValidatingResolver;
import org.xbill.DNS.DClass;
import org.xbill.DNS.Flags;
import org.xbill.DNS.Message;
import org.xbill.DNS.Name;
import org.xbill.DNS.RRset;
import org.xbill.DNS.Rcode;
import org.xbill.DNS.Record;
import org.xbill.DNS.Section;
import org.xbill.DNS.SimpleResolver;
import org.xbill.DNS.TXTRecord;
import org.xbill.DNS.Type;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import timber.log.Timber;
public class OpenAliasHelper {
public static final String OA1_SCHEME = "oa1:";
public static final String OA1_ASSET = "asset";
public static final String OA1_ADDRESS = "recipient_address";
public static final String OA1_NAME = "recipient_name";
public static final String OA1_DESCRIPTION = "tx_description";
public static final String OA1_AMOUNT = "tx_amount";
public static final String OA1_PAYMENTID = "tx_payment_id";
public static final int DNS_LOOKUP_TIMEOUT = 2500; // ms
public static void resolve(String name, OnResolvedListener resolvedListener) {
new DnsTxtResolver(resolvedListener).execute(name);
}
public static Map<String, String> parse(String oaString) {
return new OpenAliasParser(oaString).parse();
}
public interface OnResolvedListener {
void onResolved(Map<BarcodeData.Asset, BarcodeData> dataMap);
void onFailure();
}
private static class DnsTxtResolver extends AsyncTask<String, Void, Boolean> {
List<String> txts = new ArrayList<>();
boolean dnssec = false;
private final OnResolvedListener resolvedListener;
private DnsTxtResolver(OnResolvedListener resolvedListener) {
this.resolvedListener = resolvedListener;
}
// trust anchor of the root zone
// http://data.iana.org/root-anchors/root-anchors.xml
final String ROOT =
". IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5\n" +
". IN DS 20326 8 2 E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D";
final String[] DNSSEC_SERVERS = {
"4.2.2.1", // Level3
"4.2.2.2", // Level3
"4.2.2.6", // Level3
"1.1.1.1", // cloudflare
"9.9.9.9", // quad9
"8.8.4.4", // google
"8.8.8.8" // google
};
@Override
protected Boolean doInBackground(String... args) {
//main();
if (args.length != 1) return false;
String name = args[0];
if ((name == null) || (name.isEmpty()))
return false; //pointless trying to lookup nothing
Timber.d("Resolving %s", name);
try {
SimpleResolver sr = new SimpleResolver(DNSSEC_SERVERS[new Random().nextInt(DNSSEC_SERVERS.length)]);
ValidatingResolver vr = new ValidatingResolver(sr);
vr.setTimeout(0, DNS_LOOKUP_TIMEOUT);
vr.loadTrustAnchors(new ByteArrayInputStream(ROOT.getBytes("ASCII")));
Record qr = Record.newRecord(Name.fromConstantString(name + "."), Type.TXT, DClass.IN);
Message response = vr.send(Message.newQuery(qr));
final int rcode = response.getRcode();
if (rcode != Rcode.NOERROR) {
Timber.i("Rcode: %s", Rcode.string(rcode));
for (RRset set : response.getSectionRRsets(Section.ADDITIONAL)) {
if (set.getName().equals(Name.root) && set.getType() == Type.TXT
&& set.getDClass() == ValidatingResolver.VALIDATION_REASON_QCLASS) {
Timber.i("Reason: %s", ((TXTRecord) set.first()).getStrings().get(0));
}
}
return false;
} else {
dnssec = response.getHeader().getFlag(Flags.AD);
for (Record record : response.getSectionArray(Section.ANSWER)) {
if (record.getType() == Type.TXT) {
txts.addAll(((TXTRecord) record).getStrings());
}
}
}
} catch (IOException | IllegalArgumentException ex) {
return false;
}
return true;
}
@Override
public void onPostExecute(Boolean success) {
if (resolvedListener != null)
if (success) {
Map<BarcodeData.Asset, BarcodeData> dataMap = new HashMap<>();
for (String txt : txts) {
BarcodeData bc = BarcodeData.parseOpenAlias(txt);
if (bc != null) {
bc.setSecurity(dnssec ? BarcodeData.Security.OA_DNSSEC : BarcodeData.Security.OA_NO_DNSSEC);
if (!dataMap.containsKey(bc.asset)) {
dataMap.put(bc.asset, bc);
}
}
}
resolvedListener.onResolved(dataMap);
} else {
resolvedListener.onFailure();
}
}
}
private static class OpenAliasParser {
int currentPos = 0;
final String oaString;
StringBuilder sb = new StringBuilder();
OpenAliasParser(String oaString) {
this.oaString = oaString;
}
Map<String, String> parse() {
if ((oaString == null) || !oaString.startsWith(OA1_SCHEME)) return null;
if (oaString.charAt(oaString.length() - 1) != ';') return null;
Map<String, String> oaAttributes = new HashMap<>();
final int assetEnd = oaString.indexOf(' ');
if (assetEnd > 20) return null; // random sanity check
String asset = oaString.substring(OA1_SCHEME.length(), assetEnd);
oaAttributes.put(OA1_ASSET, asset);
boolean inQuote = false;
boolean inKey = true;
String key = null;
for (currentPos = assetEnd; currentPos < oaString.length() - 1; currentPos++) {
char c = currentChar();
if (inKey) {
if ((sb.length() == 0) && Character.isWhitespace(c)) continue;
if ((c == '\\') || (c == ';')) return null;
if (c == '=') {
key = sb.toString();
if (oaAttributes.containsKey(key)) return null; // no duplicate keys allowed
sb.setLength(0);
inKey = false;
} else {
sb.append(c);
}
continue;
}
// now we are in the value
if ((sb.length() == 0) && (c == '"')) {
inQuote = true;
continue;
}
if ((!inQuote || ((sb.length() > 0) && (c == '"'))) && (nextChar() == ';')) {
if (!inQuote) appendCurrentEscapedChar();
oaAttributes.put(key, sb.toString());
sb.setLength(0);
currentPos++; // skip the next ;
inQuote = false;
inKey = true;
key = null;
continue;
}
appendCurrentEscapedChar();
}
if (inQuote) return null;
if (key != null) {
oaAttributes.put(key, sb.toString());
}
return oaAttributes;
}
char currentChar() {
return oaString.charAt(currentPos);
}
char nextChar() throws IndexOutOfBoundsException {
int pos = currentPos;
char c = oaString.charAt(pos);
if (c == '\\') {
pos++;
}
return oaString.charAt(pos + 1);
}
void appendCurrentEscapedChar() throws IndexOutOfBoundsException {
char c = oaString.charAt(currentPos);
if (c == '\\') {
c = oaString.charAt(++currentPos);
}
sb.append(c);
}
}
}

View File

@@ -94,6 +94,7 @@ public class RestoreHeight {
blockheight.put("2018-06-01", 1585135L);
blockheight.put("2018-07-01", 1606715L);
blockheight.put("2018-08-01", 1629017L);
blockheight.put("2018-09-01", 1651347L);
}
public long getHeight(String date) {

View File

@@ -226,7 +226,8 @@ public class ExchangeView extends LinearLayout
etAmount.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
doExchange();
return true;
}
@@ -239,7 +240,7 @@ public class ExchangeView extends LinearLayout
@Override
public void afterTextChanged(Editable editable) {
etAmount.setError(null);
//doExchange();
clearAmounts();
}
@Override

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,2L4,2c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM20,20L4,20L4,4h16v16zM18,6h-5c-1.1,0 -2,0.9 -2,2v2.28c-0.6,0.35 -1,0.98 -1,1.72 0,1.1 0.9,2 2,2s2,-0.9 2,-2c0,-0.74 -0.4,-1.38 -1,-1.72L13,8h3v8L8,16L8,8h2L10,6L6,6v12h12L18,6z" />
</vector>

View File

@@ -89,76 +89,53 @@
android:layout_marginTop="16dp"
android:orientation="vertical" />
<LinearLayout
<android.support.design.widget.TextInputLayout
android:id="@+id/etNotes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="10">
android:layout_height="wrap_content">
<android.support.design.widget.TextInputLayout
android:id="@+id/etPaymentId"
android:layout_width="0dp"
<EditText
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="10"
app:counterEnabled="true"
app:counterMaxLength="16"
app:errorEnabled="true">
android:hint="@string/receive_desc_hint"
android:imeOptions="actionDone"
android:inputType="textMultiLine"
android:textAlignment="textStart" />
<android.support.design.widget.TextInputEditText
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/moneroGray"
android:hint="@string/receive_paymentid_hint"
android:imeOptions="actionDone"
android:inputType="textMultiLine"
android:textAlignment="textStart" />
</android.support.design.widget.TextInputLayout>
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/bPaymentId"
style="@style/MoneroText.Button.Small"
android:layout_width="56dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:drawableTop="@drawable/ic_settings_orange_24dp"
android:text="@string/send_generate_paymentid_hint"
android:textColor="@color/moneroGray"
android:visibility="visible" />
</LinearLayout>
<FrameLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvQrCode"
style="@style/MoneroFab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="4dp"
android:drawableStart="@drawable/ic_info_outline_gray_24dp"
android:text="@string/label_receive_info_gen_qr_code"
android:textAlignment="center"
android:textSize="16sp"
android:visibility="invisible" />
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_above="@id/tvNfc"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_margin="16dp"
android:clickable="true"
android:focusable="true"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardCornerRadius="2dp"
card_view:cardElevation="8dp"
card_view:contentPadding="4dp">
<TextView
android:id="@+id/tvQrCode"
style="@style/MoneroFab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawablePadding="4dp"
android:drawableStart="@drawable/ic_info_outline_gray_24dp"
android:text="@string/label_receive_info_gen_qr_code"
android:textAlignment="center"
android:textSize="16sp"
android:visibility="gone" />
<ImageView
android:id="@+id/qrCode"
android:layout_width="match_parent"
@@ -166,7 +143,19 @@
android:adjustViewBounds="true"
android:background="#00000000" />
</android.support.v7.widget.CardView>
</FrameLayout>
<TextView
android:id="@+id/tvNfc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_nfc_black_24dp"
android:gravity="center"
android:text="@string/nfc_tag_tap"
android:visibility="visible" />
</RelativeLayout>
</LinearLayout>
<ImageView

File diff suppressed because it is too large Load Diff

View File

@@ -43,27 +43,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:gravity="center"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_info_outline_gray_24dp"
android:gravity="center"
android:text="@string/info_send_prio_fees" />
<android.support.design.widget.TextInputLayout
android:id="@+id/etAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp">
<EditText
android:id="@+id/etNotes"
style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/send_notes_hint"
android:imeOptions="actionDone"
android:inputType="textMultiLine"
android:textAlignment="textStart" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>

View File

@@ -27,9 +27,9 @@
<p>Gib einen eindeutigen Walletnamen und Passwort ein. Das Passwort schützt deine Walletdaten auf dem Gerät.
Benutze ein starkes Passwort - noch besser ist eine Passwortphrase.</p>
<p>Trage deinen Seed in das Feld \"Mnemonischer Seed\" ein.<p>
<p>Falls du die Blocknummer der ersten Transaktion dieser Adresse kennst gib sie in das Feld
\"Restore Height\" ein - dieses Feld leer zu lassen bedeutet die <em>gesamte</em> Blockchain
nach Transaktionen zu und von dieser Adresse zu durchsuchen. Das dauert <em>sehr lang</em>.</p>
<p>Gib die Blocknummer der ersten Transaktion dieser Adresse in das Feld \"Restore Height\" ein.
Du kannst auch ein Datum im Format JJJJ-MM-DD eingeben. Falls du nicht sicher bist, gib ein
ungefähres Datum oder Blockhöhe <em>bevor</em> du diese Adresse zum ersten mal benutzt hast ein.<p>
]]></string>
<string name="help_create_keys"><![CDATA[
@@ -38,9 +38,9 @@
<p>Gib einen eindeutigen Walletnamen und Passwort ein. Das Passwort schützt deine Walletdaten auf dem Gerät.
Benutze ein starkes Passwort - noch besser ist eine Passwortphrase.<p>
<p>Gib deine Monero Adresse im Feld \"Öffentliche Adresse\" ein und fülle die Felder \"View Key\" und \"Spend Key\" aus.</p>
<p>Falls du die Blocknummer der ersten Transaktion dieser Adresse kennst gib sie in das Feld
\"Restore Height\" ein - dieses Feld leer zu lassen bedeutet die <em>gesamte</em> Blockchain
nach Transaktionen zu und von dieser Adresse zu durchsuchen. Das dauert <em>sehr lang</em>.</p>
<p>Gib die Blocknummer der ersten Transaktion dieser Adresse in das Feld \"Restore Height\" ein.
Du kannst auch ein Datum im Format JJJJ-MM-DD eingeben. Falls du nicht sicher bist, gib ein
ungefähres Datum oder Blockhöhe <em>bevor</em> du diese Adresse zum ersten mal benutzt hast ein.<p>
]]></string>
<string name="help_create_view"><![CDATA[
@@ -49,9 +49,9 @@
<p>Gib einen eindeutigen Walletnamen und Passwort ein. Das Passwort schützt deine Walletdaten auf dem Gerät.
Benutze ein starkes Passwort - noch besser ist eine Passwortphrase.<p>
<p>Gib deine Monero Adresse im Feld \"Öffentliche Adresse\" ein und fülle das Feld \"View Key\" aus.</p>
<p>Falls du die Blocknummer der ersten Transaktion dieser Adresse kennst gib sie in das Feld
\"Restore Height\" ein - dieses Feld leer zu lassen bedeutet die <em>gesamte</em> Blockchain
nach Transaktionen zu und von dieser Adresse zu durchsuchen. Das dauert <em>sehr lang</em>.</p>
<p>Gib die Blocknummer der ersten Transaktion dieser Adresse in das Feld \"Restore Height\" ein.
Du kannst auch ein Datum im Format JJJJ-MM-DD eingeben. Falls du nicht sicher bist, gib ein
ungefähres Datum oder Blockhöhe <em>bevor</em> du diese Adresse zum ersten mal benutzt hast ein.<p>
]]></string>
<string name="help_details"><![CDATA[
@@ -228,14 +228,14 @@
]]></string>
<string name="help_create_ledger"><![CDATA[
<h1>Create Wallet - Ledger</h1>
<p>You want to recover your wallet from your Ledger Nano S device.</p>
<p>Your secret keys never leave the Ledger device, so you need it plugged in every
time you want to access your wallet.</p>
<p>Enter a unique wallet name and password. The password is used for securing your wallet data on the Android
device. Use a strong password - even better use a passphrase.</p>
<p>Enter the block number of the first transaction used for this address in the
field \"Restore Height\". You can also use a date in the format YYYY-MM-DD. If you are not sure,
enter an approximate date/blockheight <em>before</em> you first used this wallet address.</p>
<h1>Wallet erstellen - Ledger</h1>
<p>Falls du dein Wallet mit einem Ledger Nano S wiederherstellen willst!</p>
<p>Dein geheimer Schüssel verlässt nie das Ledger-Gerät, also muss es immer eingesteckt sein,
wenn du dieses Wallet benutzt.</p>
<p>Gib einen eindeutigen Walletnamen und Passwort ein. Das Passwort schützt deine Walletdaten auf dem Gerät.
Benutze ein starkes Passwort - noch besser ist eine Passwortphrase.<p>
<p>Gib die Blocknummer der ersten Transaktion dieser Adresse in das Feld \"Restore Height\" ein.
Du kannst auch ein Datum im Format JJJJ-MM-DD eingeben. Falls du nicht sicher bist, gib ein
ungefähres Datum oder Blockhöhe, <em>bevor</em> du diese Adresse zum ersten Mal benutzt hast, ein.<p>
]]></string>
</resources>

Some files were not shown because too many files have changed in this diff Show More