mirror of
https://github.com/m2049r/xmrwallet
synced 2025-09-04 00:53:36 +02:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2c3e73b540 | ||
![]() |
830d9dadb9 | ||
![]() |
331d88ebba | ||
![]() |
7cc2f6fafb | ||
![]() |
9a3ee0eda8 | ||
![]() |
6e898939a3 | ||
![]() |
40ae39d647 | ||
![]() |
ca81e652e5 | ||
![]() |
796048be4e | ||
![]() |
441bf995c8 | ||
![]() |
e8860ab8eb | ||
![]() |
525b38ff53 | ||
![]() |
ba79bf87aa | ||
![]() |
3fe6571e7d | ||
![]() |
364e6a8137 | ||
![]() |
cb69ce99d6 | ||
![]() |
1f976872fc | ||
![]() |
27f266b6f7 | ||
![]() |
168928d54a | ||
![]() |
b3f61072aa | ||
![]() |
ccb64aded0 | ||
![]() |
e98fa089f2 | ||
![]() |
884878b7a7 | ||
![]() |
4e23f0ef3a | ||
![]() |
6ea4e3d998 | ||
![]() |
971c90f35b | ||
![]() |
f0523c403c | ||
![]() |
966ed23b87 | ||
![]() |
95f2ca74a6 | ||
![]() |
81d94478f2 |
@@ -7,8 +7,8 @@ android {
|
||||
applicationId "com.m2049r.xmrwallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 173
|
||||
versionName "1.11.3 'Chernushka'"
|
||||
versionCode 177
|
||||
versionName "1.11.7 'Chernushka'"
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
externalNativeBuild {
|
||||
|
@@ -929,8 +929,11 @@ public class LoginActivity extends BaseActivity
|
||||
|
||||
@Override
|
||||
public boolean createWallet(File aFile, String password) {
|
||||
NodeInfo currentNode = getNode();
|
||||
final long restoreHeight =
|
||||
(currentNode != null) ? currentNode.getHeight() - 20 : -1;
|
||||
Wallet newWallet = WalletManager.getInstance()
|
||||
.createWallet(aFile, password, MNEMONIC_LANGUAGE);
|
||||
.createWallet(aFile, password, MNEMONIC_LANGUAGE, restoreHeight);
|
||||
boolean success = (newWallet.getStatus() == Wallet.Status.Status_Ok);
|
||||
if (!success) {
|
||||
Timber.e(newWallet.getErrorString());
|
||||
|
@@ -440,7 +440,7 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
|
||||
Collections.sort(nodesToTest, NodeInfo.BestNodeComparator);
|
||||
NodeInfo bestNode = nodesToTest.get(0);
|
||||
if (bestNode.isValid())
|
||||
return nodesToTest.get(0);
|
||||
return bestNode;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
@@ -302,7 +302,7 @@ public class ReceiveFragment extends Fragment {
|
||||
File imagePath = new File(getActivity().getCacheDir(), "images");
|
||||
File png = new File(imagePath, "QR.png");
|
||||
Uri contentUri = FileProvider.getUriForFile(getActivity(),
|
||||
"com.m2049r.xmrwallet.fileprovider", png);
|
||||
BuildConfig.APPLICATION_ID + ".fileprovider", png);
|
||||
if (contentUri != null) {
|
||||
Intent shareIntent = new Intent();
|
||||
shareIntent.setAction(Intent.ACTION_SEND);
|
||||
@@ -574,6 +574,7 @@ public class ReceiveFragment extends Fragment {
|
||||
@Override
|
||||
public void onPause() {
|
||||
Timber.d("onPause()");
|
||||
Helper.hideKeyboard(getActivity());
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
|
@@ -71,7 +71,6 @@ public class TxFragment extends Fragment {
|
||||
private TextView tvTxFee;
|
||||
private TextView tvTxTransfers;
|
||||
private TextView etTxNotes;
|
||||
private Button bTxNotes;
|
||||
|
||||
// XMRTO stuff
|
||||
private View cvXmrTo;
|
||||
@@ -102,21 +101,9 @@ public class TxFragment extends Fragment {
|
||||
tvTxFee = view.findViewById(R.id.tvTxFee);
|
||||
tvTxTransfers = view.findViewById(R.id.tvTxTransfers);
|
||||
etTxNotes = view.findViewById(R.id.etTxNotes);
|
||||
bTxNotes = view.findViewById(R.id.bTxNotes);
|
||||
|
||||
etTxNotes.setRawInputType(InputType.TYPE_CLASS_TEXT);
|
||||
|
||||
bTxNotes.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
info.notes = null; // force reload on next view
|
||||
bTxNotes.setEnabled(false);
|
||||
etTxNotes.setEnabled(false);
|
||||
userNotes.setNote(etTxNotes.getText().toString());
|
||||
activityCallback.onSetNote(info.hash, userNotes.txNotes);
|
||||
}
|
||||
});
|
||||
|
||||
tvTxXmrToKey.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -131,14 +118,6 @@ public class TxFragment extends Fragment {
|
||||
return view;
|
||||
}
|
||||
|
||||
public void onNotesSet(boolean reload) {
|
||||
bTxNotes.setEnabled(true);
|
||||
etTxNotes.setEnabled(true);
|
||||
if (reload) {
|
||||
loadNotes(this.info);
|
||||
}
|
||||
}
|
||||
|
||||
void shareTxInfo() {
|
||||
if (this.info == null) return;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
@@ -315,7 +294,6 @@ public class TxFragment extends Fragment {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -337,9 +315,9 @@ public class TxFragment extends Fragment {
|
||||
|
||||
String getTxNotes(String hash);
|
||||
|
||||
String getTxAddress(int major, int minor);
|
||||
boolean setTxNotes(String txId, String txNotes);
|
||||
|
||||
void onSetNote(String txId, String notes);
|
||||
String getTxAddress(int major, int minor);
|
||||
|
||||
void setToolbarButton(int type);
|
||||
|
||||
@@ -357,4 +335,16 @@ public class TxFragment extends Fragment {
|
||||
+ " must implement Listener");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
if (!etTxNotes.getText().toString().equals(userNotes.note)) { // notes have changed
|
||||
// save them
|
||||
userNotes.setNote(etTxNotes.getText().toString());
|
||||
info.notes = userNotes.txNotes;
|
||||
activityCallback.setTxNotes(info.hash, info.notes);
|
||||
}
|
||||
Helper.hideKeyboard(getActivity());
|
||||
super.onPause();
|
||||
}
|
||||
}
|
@@ -150,8 +150,13 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
final WalletFragment walletFragment = (WalletFragment)
|
||||
getSupportFragmentManager().findFragmentByTag(WalletFragment.class.getName());
|
||||
if (walletFragment != null) walletFragment.resetDismissedTransactions();
|
||||
updateAccountsBalance();
|
||||
forceUpdate();
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
updateAccountsBalance();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,6 +179,11 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
return getWallet().getUserNote(txId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setTxNotes(String txId, String txNotes) {
|
||||
return getWallet().setUserNote(txId, txNotes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTxAddress(int major, int minor) {
|
||||
return getWallet().getSubaddress(major, minor);
|
||||
@@ -713,26 +723,6 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetNotes(final boolean success) {
|
||||
try {
|
||||
final TxFragment txFragment = (TxFragment)
|
||||
getSupportFragmentManager().findFragmentById(R.id.fragment_container);
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (!success) {
|
||||
Toast.makeText(WalletActivity.this, getString(R.string.tx_notes_set_failed), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
txFragment.onNotesSet(success);
|
||||
}
|
||||
});
|
||||
} catch (ClassCastException ex) {
|
||||
// not in tx fragment
|
||||
Timber.d(ex.getLocalizedMessage());
|
||||
// never mind
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(final String text) {
|
||||
try {
|
||||
@@ -794,21 +784,6 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSetNote(String txId, String notes) {
|
||||
if (mIsBound) { // no point in talking to unbound service
|
||||
Intent intent = new Intent(getApplicationContext(), WalletService.class);
|
||||
intent.putExtra(WalletService.REQUEST, WalletService.REQUEST_CMD_SETNOTE);
|
||||
intent.putExtra(WalletService.REQUEST_CMD_SETNOTE_TX, txId);
|
||||
intent.putExtra(WalletService.REQUEST_CMD_SETNOTE_NOTES, notes);
|
||||
startService(intent);
|
||||
Timber.d("SET NOTE request sent");
|
||||
} else {
|
||||
Timber.e("Service not bound");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepareSend(final String tag, final TxData txData) {
|
||||
if (mIsBound) { // no point in talking to unbound service
|
||||
@@ -1062,6 +1037,7 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
} else {
|
||||
tvBalance.setText(null);
|
||||
}
|
||||
updateAccountsList();
|
||||
}
|
||||
|
||||
void updateAccountsHeader() {
|
||||
@@ -1075,8 +1051,11 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
Menu menu = accountsView.getMenu();
|
||||
menu.removeGroup(R.id.accounts_list);
|
||||
final int n = wallet.getNumAccounts();
|
||||
final boolean showBalances = (n > 1) && !isStreetMode();
|
||||
for (int i = 0; i < n; i++) {
|
||||
final String label = wallet.getAccountLabel(i);
|
||||
final String label = (showBalances ?
|
||||
getString(R.string.label_account, wallet.getAccountLabel(i), Helper.getDisplayAmount(wallet.getBalance(i), 2))
|
||||
: wallet.getAccountLabel(i));
|
||||
final MenuItem item = menu.add(R.id.accounts_list, getAccountId(i), 2 * i, label);
|
||||
item.setIcon(R.drawable.ic_account_balance_wallet_black_24dp);
|
||||
if (i == wallet.getAccountIndex())
|
||||
|
@@ -219,7 +219,7 @@ public class WalletFragment extends Fragment
|
||||
if (isExchanging) return; // wait for exchange to finish - it will fire this itself then.
|
||||
// at this point selection is XMR in case of error
|
||||
String displayB;
|
||||
double amountA = Double.parseDouble(Wallet.getDisplayAmount(unlockedBalance)); // crash if this fails!
|
||||
double amountA = Helper.getDecimalAmount(unlockedBalance).doubleValue();
|
||||
if (!Helper.CRYPTO.equals(balanceCurrency)) { // not XMR
|
||||
double amountB = amountA * balanceRate;
|
||||
displayB = Helper.getFormattedAmount(amountB, false);
|
||||
@@ -235,10 +235,10 @@ public class WalletFragment extends Fragment
|
||||
private final ExchangeApi exchangeApi = Helper.getExchangeApi();
|
||||
|
||||
void refreshBalance() {
|
||||
double unconfirmedXmr = Double.parseDouble(Helper.getDisplayAmount(balance - unlockedBalance));
|
||||
double unconfirmedXmr = Helper.getDecimalAmount(balance - unlockedBalance).doubleValue();
|
||||
showUnconfirmed(unconfirmedXmr);
|
||||
if (sCurrency.getSelectedItemPosition() == 0) { // XMR
|
||||
double amountXmr = Double.parseDouble(Wallet.getDisplayAmount(unlockedBalance)); // assume this cannot fail!
|
||||
double amountXmr = Helper.getDecimalAmount(unlockedBalance).doubleValue();
|
||||
showBalance(Helper.getFormattedAmount(amountXmr, true));
|
||||
} else { // not XMR
|
||||
String currency = (String) sCurrency.getSelectedItem();
|
||||
@@ -294,7 +294,7 @@ public class WalletFragment extends Fragment
|
||||
|
||||
public void exchangeFailed() {
|
||||
sCurrency.setSelection(0, true); // default to XMR
|
||||
double amountXmr = Double.parseDouble(Wallet.getDisplayAmount(unlockedBalance)); // assume this cannot fail!
|
||||
double amountXmr = Helper.getDecimalAmount(unlockedBalance).doubleValue();
|
||||
showBalance(Helper.getFormattedAmount(amountXmr, true));
|
||||
hideExchanging();
|
||||
}
|
||||
|
@@ -46,7 +46,8 @@ import okhttp3.ResponseBody;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class NodeInfo extends Node {
|
||||
final static public int MIN_MAJOR_VERSION = 9;
|
||||
final static public int MIN_MAJOR_VERSION = 11;
|
||||
final static public String RPC_VERSION = "2.0";
|
||||
|
||||
private long height = 0;
|
||||
private long timestamp = 0;
|
||||
@@ -228,9 +229,12 @@ public class NodeInfo extends Node {
|
||||
responseCode = response.code();
|
||||
if (response.isSuccessful()) {
|
||||
ResponseBody respBody = response.body(); // closed through Response object
|
||||
if ((respBody != null) && (respBody.contentLength() < 1000)) { // sanity check
|
||||
if ((respBody != null) && (respBody.contentLength() < 2000)) { // sanity check
|
||||
final JSONObject json = new JSONObject(
|
||||
respBody.string());
|
||||
String rpcVersion = json.getString("jsonrpc");
|
||||
if (!RPC_VERSION.equals(rpcVersion))
|
||||
return false;
|
||||
final JSONObject header = json.getJSONObject(
|
||||
"result").getJSONObject("block_header");
|
||||
height = header.getLong("height");
|
||||
|
@@ -33,7 +33,9 @@ import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.m2049r.xmrwallet.R;
|
||||
import com.m2049r.xmrwallet.data.BarcodeData;
|
||||
@@ -92,6 +94,7 @@ public class SendAddressWizardFragment extends SendWizardFragment {
|
||||
private View llPaymentId;
|
||||
private TextView tvXmrTo;
|
||||
private View llXmrTo;
|
||||
private ImageButton bPasteAddress;
|
||||
|
||||
private boolean resolvingOA = false;
|
||||
private boolean resolvingPP = false;
|
||||
@@ -197,6 +200,21 @@ public class SendAddressWizardFragment extends SendWizardFragment {
|
||||
}
|
||||
});
|
||||
|
||||
bPasteAddress = view.findViewById(R.id.bPasteAddress);
|
||||
bPasteAddress.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final String clip = Helper.getClipBoardText(getActivity());
|
||||
if (clip == null) return;
|
||||
// clean it up
|
||||
final String address = clip.replaceAll("[^0-9A-Z-a-z]", "");
|
||||
if (Wallet.isAddressValid(address) || BitcoinAddressValidator.validate(address))
|
||||
etAddress.getEditText().setText(address);
|
||||
else
|
||||
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
etPaymentId = view.findViewById(R.id.etPaymentId);
|
||||
etPaymentId.getEditText().setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
|
||||
etPaymentId.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
|
@@ -30,6 +30,7 @@ import com.m2049r.xmrwallet.model.TransactionInfo;
|
||||
import com.m2049r.xmrwallet.util.Helper;
|
||||
import com.m2049r.xmrwallet.data.UserNotes;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
@@ -154,7 +155,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
|
||||
}
|
||||
|
||||
if ((infoItem.fee > 0)) {
|
||||
String fee = Helper.getDisplayAmount(infoItem.fee, 5);
|
||||
String fee = Helper.getDisplayAmount(infoItem.fee, Helper.DISPLAY_DIGITS_INFO);
|
||||
tvFee.setText(context.getString(R.string.tx_list_fee, fee));
|
||||
tvFee.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
|
@@ -34,7 +34,7 @@ import java.io.IOException;
|
||||
import timber.log.Timber;
|
||||
|
||||
public class Ledger {
|
||||
static final public boolean ENABLED = false;
|
||||
static final public boolean ENABLED = true;
|
||||
// 5:20 is same as wallet2.cpp::restore()
|
||||
static public final int LOOKAHEAD_ACCOUNTS = 5;
|
||||
static public final int LOOKAHEAD_SUBADDRESSES = 20;
|
||||
|
@@ -173,5 +173,4 @@ public class TransactionInfo implements Parcelable, Comparable<TransactionInfo>
|
||||
return this.hash.compareTo(another.hash);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -353,9 +353,10 @@ public class Wallet {
|
||||
if (label.equals(NEW_ACCOUNT_NAME)) {
|
||||
String address = getAddress(accountIndex);
|
||||
int len = address.length();
|
||||
return address.substring(0, 6) +
|
||||
label = address.substring(0, 6) +
|
||||
"\u2026" + address.substring(len - 6, len);
|
||||
} else return label;
|
||||
}
|
||||
return label;
|
||||
}
|
||||
|
||||
public String getSubaddressLabel(int addressIndex) {
|
||||
|
@@ -91,14 +91,16 @@ public class WalletManager {
|
||||
managedWallet = null;
|
||||
}
|
||||
|
||||
public Wallet createWallet(File aFile, String password, String language) {
|
||||
public Wallet createWallet(File aFile, String password, String language, long height) {
|
||||
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()));
|
||||
final long oldHeight = wallet.getRestoreHeight();
|
||||
final long restoreHeight =
|
||||
(height > -1) ? height : RestoreHeight.getInstance().getHeight(new Date());
|
||||
wallet.setRestoreHeight(restoreHeight);
|
||||
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)
|
||||
}
|
||||
|
@@ -69,10 +69,6 @@ public class WalletService extends Service {
|
||||
public static final String REQUEST_CMD_SEND = "send";
|
||||
public static final String REQUEST_CMD_SEND_NOTES = "notes";
|
||||
|
||||
public static final String REQUEST_CMD_SETNOTE = "setnote";
|
||||
public static final String REQUEST_CMD_SETNOTE_TX = "tx";
|
||||
public static final String REQUEST_CMD_SETNOTE_NOTES = "notes";
|
||||
|
||||
public static final int START_SERVICE = 1;
|
||||
public static final int STOP_SERVICE = 2;
|
||||
|
||||
@@ -224,8 +220,6 @@ public class WalletService extends Service {
|
||||
|
||||
void onSendTransactionFailed(String error);
|
||||
|
||||
void onSetNotes(boolean success);
|
||||
|
||||
void onWalletStarted(Wallet.ConnectionStatus walletStatus);
|
||||
|
||||
void onWalletOpen(Wallet.Device device);
|
||||
@@ -378,26 +372,6 @@ public class WalletService extends Service {
|
||||
if (observer != null) observer.onSendTransactionFailed(error);
|
||||
return;
|
||||
}
|
||||
} else if (cmd.equals(REQUEST_CMD_SETNOTE)) {
|
||||
Wallet myWallet = getWallet();
|
||||
Timber.d("SET NOTE for wallet: %s", myWallet.getName());
|
||||
String txId = extras.getString(REQUEST_CMD_SETNOTE_TX);
|
||||
String notes = extras.getString(REQUEST_CMD_SETNOTE_NOTES);
|
||||
if ((txId != null) && (notes != null)) {
|
||||
boolean success = myWallet.setUserNote(txId, notes);
|
||||
if (!success) {
|
||||
Timber.e(myWallet.getErrorString());
|
||||
}
|
||||
if (observer != null) observer.onSetNotes(success);
|
||||
if (success) {
|
||||
boolean rc = myWallet.store();
|
||||
Timber.d("wallet stored: %s with rc=%b", myWallet.getName(), rc);
|
||||
if (!rc) {
|
||||
Timber.w("Wallet store failed: %s", myWallet.getErrorString());
|
||||
}
|
||||
if (observer != null) observer.onWalletStored(rc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -21,6 +21,7 @@ import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.ClipData;
|
||||
import android.content.ClipDescription;
|
||||
import android.content.ClipboardManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
@@ -64,6 +65,7 @@ import com.m2049r.xmrwallet.service.exchange.api.ExchangeApi;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.SocketTimeoutException;
|
||||
@@ -186,28 +188,23 @@ public class Helper {
|
||||
act.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
|
||||
}
|
||||
|
||||
static public BigDecimal getDecimalAmount(long amount) {
|
||||
return new BigDecimal(amount).scaleByPowerOfTen(-12);
|
||||
}
|
||||
|
||||
static public String getDisplayAmount(long amount) {
|
||||
return getDisplayAmount(amount, 12);
|
||||
}
|
||||
|
||||
static public String getDisplayAmount(long amount, int maxDecimals) {
|
||||
return getDisplayAmount(Wallet.getDisplayAmount(amount), maxDecimals);
|
||||
}
|
||||
|
||||
// amountString must have '.' as decimal point
|
||||
private static String getDisplayAmount(String amountString, int maxDecimals) {
|
||||
int lastZero = 0;
|
||||
int decimal = 0;
|
||||
for (int i = amountString.length() - 1; i >= 0; i--) {
|
||||
if ((lastZero == 0) && (amountString.charAt(i) != '0')) lastZero = i + 1;
|
||||
// TODO i18n
|
||||
if (amountString.charAt(i) == '.') {
|
||||
decimal = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
int cutoff = Math.min(Math.max(lastZero, decimal + 2), decimal + maxDecimals);
|
||||
return amountString.substring(0, cutoff);
|
||||
// a Java bug does not strip zeros properly if the value is 0
|
||||
if (amount == 0) return "0.00";
|
||||
BigDecimal d = getDecimalAmount(amount)
|
||||
.setScale(maxDecimals, BigDecimal.ROUND_HALF_UP)
|
||||
.stripTrailingZeros();
|
||||
if (d.scale() < 2)
|
||||
d = d.setScale(2, BigDecimal.ROUND_UNNECESSARY);
|
||||
return d.toPlainString();
|
||||
}
|
||||
|
||||
static public String getFormattedAmount(double amount, boolean isXmr) {
|
||||
@@ -285,6 +282,16 @@ public class Helper {
|
||||
clipboardManager.setPrimaryClip(clip);
|
||||
}
|
||||
|
||||
static public String getClipBoardText(Context context) {
|
||||
final ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||
if (clipboardManager.hasPrimaryClip()
|
||||
&& clipboardManager.getPrimaryClipDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) {
|
||||
final ClipData.Item item = clipboardManager.getPrimaryClip().getItemAt(0);
|
||||
return item.getText().toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static private Animation ShakeAnimation;
|
||||
|
||||
static public Animation getShakeAnimation(Context context) {
|
||||
@@ -556,6 +563,8 @@ public class Helper {
|
||||
tvOpenPrompt.setText(context.getText(R.string.prompt_fingerprint_auth));
|
||||
tvOpenPrompt.setVisibility(View.VISIBLE);
|
||||
FingerprintHelper.authenticate(context, cancelSignal, fingerprintAuthCallback);
|
||||
} else {
|
||||
etPassword.requestFocus();
|
||||
}
|
||||
Button button = ((AlertDialog) dialog).getButton(AlertDialog.BUTTON_POSITIVE);
|
||||
button.setOnClickListener(new View.OnClickListener() {
|
||||
|
@@ -101,6 +101,8 @@ public class RestoreHeight {
|
||||
blockheight.put("2019-01-01", 1738923L);
|
||||
blockheight.put("2019-02-01", 1761435L);
|
||||
blockheight.put("2019-03-01", 1781681L);
|
||||
blockheight.put("2019-04-01", 1803081L);
|
||||
blockheight.put("2019-05-01", 1824671L);
|
||||
}
|
||||
|
||||
public long getHeight(String date) {
|
||||
|
@@ -28,6 +28,7 @@ import java.security.spec.ECPoint;
|
||||
|
||||
public class ECsecp256k1 {
|
||||
static private final BigInteger TWO = new BigInteger("2");
|
||||
static private final BigInteger THREE = new BigInteger("3");
|
||||
static public final BigInteger p = new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16);
|
||||
static public final BigInteger a = new BigInteger("0000000000000000000000000000000000000000000000000000000000000000", 16);
|
||||
static public final BigInteger b = new BigInteger("0000000000000000000000000000000000000000000000000000000000000007", 16);
|
||||
@@ -61,19 +62,18 @@ public class ECsecp256k1 {
|
||||
return s;
|
||||
else if (s.equals(ECPoint.POINT_INFINITY))
|
||||
return r;
|
||||
BigInteger slope = (r.getAffineY().subtract(s.getAffineY())).multiply(r.getAffineX().subtract(s.getAffineX()).modInverse(p)).mod(p);
|
||||
BigInteger slope = (r.getAffineY().subtract(s.getAffineY()))
|
||||
.multiply(r.getAffineX().subtract(s.getAffineX()).modInverse(p));
|
||||
BigInteger Xout = (slope.modPow(TWO, p).subtract(r.getAffineX())).subtract(s.getAffineX()).mod(p);
|
||||
BigInteger Yout = s.getAffineY().negate().mod(p);
|
||||
Yout = Yout.add(slope.multiply(s.getAffineX().subtract(Xout))).mod(p);
|
||||
BigInteger Yout = s.getAffineY().negate().add(slope.multiply(s.getAffineX().subtract(Xout))).mod(p);
|
||||
return new ECPoint(Xout, Yout);
|
||||
}
|
||||
|
||||
public static ECPoint doublePoint(ECPoint r) {
|
||||
if (r.equals(ECPoint.POINT_INFINITY))
|
||||
return r;
|
||||
BigInteger slope = (r.getAffineX().pow(2)).multiply(new BigInteger("3"));
|
||||
slope = slope.add(a);
|
||||
slope = slope.multiply((r.getAffineY().multiply(TWO)).modInverse(p));
|
||||
BigInteger slope = (r.getAffineX().pow(2)).multiply(THREE).add(a)
|
||||
.multiply((r.getAffineY().multiply(TWO)).modInverse(p));
|
||||
BigInteger Xout = slope.pow(2).subtract(r.getAffineX().multiply(TWO)).mod(p);
|
||||
BigInteger Yout = (r.getAffineY().negate()).add(slope.multiply(r.getAffineX().subtract(Xout))).mod(p);
|
||||
return new ECPoint(Xout, Yout);
|
||||
|
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/gradientOrange"
|
||||
android:pathData="M19,2h-4.18C14.4,0.84 13.3,0 12,0c-1.3,0 -2.4,0.84 -2.82,2L5,2c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,4c0,-1.1 -0.9,-2 -2,-2zM12,2c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM19,20L5,20L5,4h2v3h10L17,4h2v16z" />
|
||||
</vector>
|
@@ -37,8 +37,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_toStartOf="@+id/ibOption"
|
||||
android:layout_toEndOf="@id/ibBookmark">
|
||||
android:layout_toStartOf="@+id/ibOption">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pbNode"
|
||||
|
@@ -20,21 +20,46 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp" />
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/etAddress"
|
||||
<RelativeLayout
|
||||
android:id="@+id/llAddress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:errorEnabled="true">
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:id="@+id/etAddress"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/send_address_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="textStart" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@+id/bPasteAddress"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="16"
|
||||
app:errorEnabled="true">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="10"
|
||||
android:hint="@string/send_address_hint"
|
||||
android:imeOptions="actionNext"
|
||||
android:inputType="textMultiLine"
|
||||
android:textAlignment="textStart" />
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/bPasteAddress"
|
||||
style="@style/MoneroText.Button.Small"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="?android:selectableItemBackgroundBorderless"
|
||||
android:src="@drawable/ic_content_paste_orange_24dp" />
|
||||
</RelativeLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@@ -225,34 +225,14 @@
|
||||
android:padding="8sp"
|
||||
android:text="@string/tx_notes" />
|
||||
|
||||
<RelativeLayout
|
||||
<EditText
|
||||
android:id="@+id/etTxNotes"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etTxNotes"
|
||||
style="@style/MoneroEdit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@+id/bTxNotes"
|
||||
android:backgroundTint="@color/moneroGray"
|
||||
android:hint="@string/tx_notes_hint"
|
||||
android:inputType="textMultiLine" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/bTxNotes"
|
||||
style="@style/MoneroButton.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:enabled="true"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@string/tx_button_notes" />
|
||||
</RelativeLayout>
|
||||
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/moneroGray"
|
||||
android:hint="@string/tx_notes_hint"
|
||||
android:inputType="textMultiLine" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow>
|
||||
|
@@ -17,7 +17,7 @@
|
||||
<h1>Datenschutzerklärung</h1>
|
||||
<p>Diese Seite informiert dich über unsere Richtlinien bezüglich der Sammlung,
|
||||
Nutzung und Weitergabe persönlicher Informationen, die wir von Nutzern unserer
|
||||
App erhalten (monerujo: Monero Wallet).
|
||||
App erhalten (monerujo: Monero-Wallet).
|
||||
</p>
|
||||
<p>Mit der Nutzung der App stimmst du der Erfassung und Nutzung von Informationen in
|
||||
Übereinstimmung mit dieser Erklärung zu.
|
||||
@@ -29,21 +29,21 @@
|
||||
von Transaktionen lokal gesammelt und verarbeitet und verschlüsselt in das Monero-Netzwerk übertragen.
|
||||
</p>
|
||||
<p>Andere persönliche Daten werden von der App nicht gesammelt.</p>
|
||||
<p>Wenn du den Umrechner (optional) nutzt fragt Monerujo
|
||||
<p>Wenn du den Umrechner (optional) nutzt, fragt Monerujo
|
||||
den aktuellen Kurs über die öffentliche Schnittstelle von coinmarketcap.com ab.
|
||||
Siehe dir ihre Datenschutzerklärung unter https://coinmarketcap.com/privacy für
|
||||
Details darüber an, wie Daten in deinen Anfragen gesammelt werden.</p>
|
||||
<p>Wenn du die App zum Bezahlen an BTC-Adressen verwendest, verwendest du den Dienst XMR.TO.
|
||||
Weitere Informationen findest du in den Datenschutzerklärung unter https://xmr.to/.
|
||||
Monerujo schickt dem Anbieter die BTC Zieladresse und den Betrag.
|
||||
Weitere Informationen findest du in der Datenschutzerklärung unter https://xmr.to/.
|
||||
Monerujo schickt dem Anbieter die BTC-Zieladresse und den Betrag.
|
||||
Deine IP-Adresse kann dabei aufgezeichnet werden.</p>
|
||||
<h2>App-Berechtigungen</h2>
|
||||
<ul>
|
||||
<li>INTERNET : Verbinde zum Monero Netzwerk über eine Monero Daemon Node</li>
|
||||
<li>READ_EXTERNAL_STORAGE : Liest die auf dem Gerät gespeicherten Wallet Dateien aus</li>
|
||||
<li>WRITE_EXTERNAL_STORAGE : Schreibt Wallet Dateien auf dem Gerät</li>
|
||||
<li>INTERNET : Verbinde zum Monero-Netzwerk über einen Monero-Hintergrunddienst-Node</li>
|
||||
<li>READ_EXTERNAL_STORAGE : Lese die auf dem Gerät gespeicherten Wallet-Dateien aus</li>
|
||||
<li>WRITE_EXTERNAL_STORAGE : Schreibe Wallet-Dateien auf das Gerät</li>
|
||||
<li>WAKE_LOCK : Halte das Gerät während der Synchronisation wach</li>
|
||||
<li>CAMERA : Scanne QR-Codes um Monero zu erhalten</li>
|
||||
<li>CAMERA : Scanne QR-Codes, um Monero zu erhalten</li>
|
||||
</ul>
|
||||
<h2>Änderungen an dieser Datenschutzerklärung</h2>
|
||||
<p>Wir können diese Datenschutzerklärung von Zeit zu Zeit aktualisieren.
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -380,5 +380,5 @@
|
||||
<string name="prompt_ledger_seed">Ledger Seed Words</string>
|
||||
<string name="prompt_ledger_phrase">Ledger Passphrase (optional)</string>
|
||||
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering you Ledger Seed here is a major security risk!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
|
||||
</resources>
|
||||
|
@@ -380,5 +380,5 @@
|
||||
<string name="prompt_ledger_seed">Ledger Seed Words</string>
|
||||
<string name="prompt_ledger_phrase">Ledger Passphrase (optional)</string>
|
||||
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering you Ledger Seed here is a major security risk!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
|
||||
</resources>
|
||||
|
@@ -370,5 +370,5 @@
|
||||
<string name="prompt_ledger_seed">Ledger Seed Words</string>
|
||||
<string name="prompt_ledger_phrase">Ledger Passphrase (optional)</string>
|
||||
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering you Ledger Seed here is a major security risk!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
|
||||
</resources>
|
||||
|
@@ -378,5 +378,5 @@
|
||||
<string name="prompt_ledger_seed">Ledger Seed Words</string>
|
||||
<string name="prompt_ledger_phrase">Ledger Passphrase (optional)</string>
|
||||
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering you Ledger Seed here is a major security risk!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
|
||||
</resources>
|
||||
|
@@ -382,5 +382,5 @@
|
||||
<string name="prompt_ledger_seed">Ledger Seed Words</string>
|
||||
<string name="prompt_ledger_phrase">Ledger Passphrase (optional)</string>
|
||||
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering you Ledger Seed here is a major security risk!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering your Ledger Seed here is a major security risk!</string>
|
||||
</resources>
|
||||
|
@@ -366,22 +366,22 @@
|
||||
<string name="node_nobookmark">Aggiunti automaticamente ai segnalibri i %1$d nodi migliori</string>
|
||||
<string name="label_test">Effettua Test</string><!--note: as in "Test a network connection"-->
|
||||
|
||||
<string name="send_address_resolve_bip70">Resolving Payment URI…</string>
|
||||
<string name="send_address_not_bip70">Could not resolve Payment URI</string>
|
||||
<string name="send_address_bip70">Resolved Payment URI ✔</string>
|
||||
<string name="send_address_resolve_bip70">Risolvendo URI pagamento…</string>
|
||||
<string name="send_address_not_bip70">Impossibile risolvere pagamento URI</string>
|
||||
<string name="send_address_bip70">Risolto URI pagamento✔</string>
|
||||
<!-- please verify this means "Receiver" or "Recipient" as in "Receiver in the transaction" -->
|
||||
<string name="send_address_hint">Ricevitore</string>
|
||||
<string name="send_address_hint">Ricevente</string>
|
||||
|
||||
<string name="xmrto_error_001">XMR.TO offline - try again later</string>
|
||||
<string name="xmrto_error_004">BTC amount out of bounds</string>
|
||||
<string name="xmrto_error_010">Invalid or outdated Payment URL</string>
|
||||
<string name="xmrto_error_012">Too many requests</string>
|
||||
<string name="xmrto_error_001">XMR.TO è offline - prova più tardi</string>
|
||||
<string name="xmrto_error_004">Ammontare in BTC fuori dai limiti</string>
|
||||
<string name="xmrto_error_010">URL di pagamento obsoleto o invalido</string>
|
||||
<string name="xmrto_error_012">Troppe richieste</string>
|
||||
|
||||
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
|
||||
<string name="street_sweep_amount">TUTTO!</string> <!-- as in: "everything in the account" = "all the money" -->
|
||||
|
||||
<string name="menu_ledger_seed">Convert Ledger Seed</string>
|
||||
<string name="prompt_ledger_seed">Ledger Seed Words</string>
|
||||
<string name="prompt_ledger_phrase">Ledger Passphrase (optional)</string>
|
||||
<string name="bad_ledger_seed">Invalid Ledger Seed!</string>
|
||||
<string name="prompt_ledger_seed_warn">Entering you Ledger Seed here is a major security risk!</string>
|
||||
<string name="menu_ledger_seed">Converti seed Ledger</string>
|
||||
<string name="prompt_ledger_seed">Parole del seed Ledger</string>
|
||||
<string name="prompt_ledger_phrase">Frase d\'accesso Ledger (opzionale)</string>
|
||||
<string name="bad_ledger_seed">Seed di Ledger invalido!</string>
|
||||
<string name="prompt_ledger_seed_warn">Inserire il tuo seed di Ledger qui è un grosso rischio!</string>
|
||||
</resources>
|
||||
|
@@ -239,14 +239,14 @@
|
||||
コピーするか、QRコードから読み取るか、直接入力することができます。
|
||||
間違ったアドレスにコインが送金されないように、
|
||||
このアドレスは確実に間違いがないことを確認してください。</p>
|
||||
<p>In addition to using an XMR address, you can also use
|
||||
<p>XMRアドレスを使用することに加えて、あなたはまた使用することがあります
|
||||
<ul>
|
||||
<li>an OpenAlias for XMR or BTC</li>
|
||||
<li>a BTC address</li>
|
||||
<li>a bitcoin: URI (including BIP70 like bitpay)</li>
|
||||
<li>XMRやBTCのOpenAlias</li>
|
||||
<li>BTCアドレス</li>
|
||||
<li>bitcoin: URI (bitpayのようなBIP70もいい)</li>
|
||||
</u>
|
||||
Please note, that sending BTC is processed through the XMR.TO service (see https://xmr.to
|
||||
for details). See the section on sending BTC below.</p>
|
||||
BTCの送信はXMR.TOサービス(https://xmr.to)を介して処理されることに注意してください。
|
||||
下記のBTCの送信に関するセクションを参照してください。</p>
|
||||
<h2>ペイメントID(Payment ID)</h2>
|
||||
<p>あなたは2者間でモネロを送金した理由を特定するために
|
||||
ペイメントIDを使うことができます。
|
||||
@@ -431,15 +431,15 @@
|
||||
<!-- Note for translators: new/changed text also in help_send -->
|
||||
|
||||
<string name="help_uri"><![CDATA[
|
||||
<h1>Using a payment link</h1>
|
||||
<p>You have started monerujo with a payment link. In order to send funds, please do the following:</p>
|
||||
<h1>ペイメントリンクを使用すること</h1>
|
||||
<p>ペイメントリンクでmonerujoを始めました。 送金するには、次の手順に従ってください。</p>
|
||||
<p>
|
||||
1. Open the wallet you want to spend from<br>
|
||||
2. Wait until the wallet is synced & the "Give" button appears<br>
|
||||
3. Touch the "Give" button
|
||||
1. 使いたいウォレットを開け<br>
|
||||
2. 同期されて「送金」ボタンを見える時に待て<br>
|
||||
3. 「送金」ボタンをタップし て
|
||||
</p>
|
||||
<p>The payment details will be filled in. Check them and proceed like for any other transaction.</p>
|
||||
<p>支払詳細を記入します。それからチェックして、他の取引と同じように進めてください。</p>
|
||||
]]></string>
|
||||
|
||||
<string name="help_ok">Got it!</string> <!-- Note: "Got it" as in "I understand this" -->
|
||||
<string name="help_ok">分かりました!</string> <!-- Note: "Got it" as in "I understand this" -->
|
||||
</resources>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user