Updated on 2026-08-14

This commit is contained in:
Tangem 2019-03-05 00:00:31 +03:00
commit 4a8825cf91
772 changed files with 7251 additions and 9265 deletions

6
.idea/gradle.xml generated
View file

@ -9,9 +9,9 @@
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/tangemcard-android" />
<option value="$PROJECT_DIR$/tangemcommon" />
<option value="$PROJECT_DIR$/tangemserver-android" />
<option value="$PROJECT_DIR$/card-android" />
<option value="$PROJECT_DIR$/card-common" />
<option value="$PROJECT_DIR$/server-android" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />

35
.idea/misc.xml generated
View file

@ -5,41 +5,6 @@
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="androidx.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="10">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
<item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="9">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>

View file

@ -44,11 +44,13 @@ android {
}
dependencies {
implementation project(':tangemcommon')
// implementation 'com.github.TangemCash.tangemcard-common:tangemcard-android:0.1.0'
implementation project(':card-common')
implementation project(':card-android')
implementation project(':server-android')
implementation project(':tangemcard-android')
implementation project(':tangemserver-android')
// implementation 'com.github.TangemCash:card-common:0.1.2'
// implementation 'com.github.TangemCash:card-android:0.1.3'
// implementation 'com.github.TangemCash:server-android:0.1.4'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

View file

@ -37,7 +37,7 @@
android:grantUriPermissions="true" />
<activity
android:name="com.tangem.presentation.activity.LogoActivity"
android:name="com.tangem.ui.activity.LogoActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
@ -48,7 +48,7 @@
</activity>
<activity
android:name="com.tangem.presentation.activity.MainActivity"
android:name="com.tangem.ui.activity.MainActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
@ -69,82 +69,82 @@
</activity>
<activity
android:name="com.tangem.presentation.activity.PinRequestActivity"
android:name="com.tangem.ui.activity.PinRequestActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.EmptyWalletActivity"
android:name="com.tangem.ui.activity.EmptyWalletActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.PinSaveActivity"
android:name="com.tangem.ui.activity.PinSaveActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.LoadedWalletActivity"
android:name="com.tangem.ui.activity.LoadedWalletActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.VerifyCardActivity"
android:name="com.tangem.ui.activity.VerifyCardActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.CreateNewWalletActivity"
android:name="com.tangem.ui.activity.CreateNewWalletActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.PrepareTransactionActivity"
android:name="com.tangem.ui.activity.PrepareTransactionActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.ConfirmTransactionActivity"
android:name="com.tangem.ui.activity.ConfirmTransactionActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.SignTransactionActivity"
android:name="com.tangem.ui.activity.SignTransactionActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.PurgeActivity"
android:name="com.tangem.ui.activity.PurgeActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.PinSwapActivity"
android:name="com.tangem.ui.activity.PinSwapActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.QrScanActivity"
android:name="com.tangem.ui.activity.QrScanActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.SendTransactionActivity"
android:name="com.tangem.ui.activity.SendTransactionActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.PrepareCryptonitWithdrawalActivity"
android:name="com.tangem.ui.activity.PrepareCryptonitWithdrawalActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.PrepareCryptonitOtherApiWithdrawalActivity"
android:name="com.tangem.ui.activity.PrepareCryptonitOtherApiWithdrawalActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name="com.tangem.presentation.activity.PrepareKrakenWithdrawalActivity"
android:name="com.tangem.ui.activity.PrepareKrakenWithdrawalActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />

View file

@ -9,10 +9,10 @@ import com.tangem.di.DaggerNavigatorComponent
import com.tangem.di.DaggerNetworkComponent
import com.tangem.di.NavigatorComponent
import com.tangem.di.NetworkComponent
import com.tangem.tangemcard.android.data.Firmwares
import com.tangem.tangemcard.android.data.PINStorage
import com.tangem.tangemcommon.data.Issuer
import com.tangem.tangemserver.android.data.LocalStorage
import com.tangem.card_android.android.data.Firmwares
import com.tangem.card_android.android.data.PINStorage
import com.tangem.card_common.data.Issuer
import com.tangem.server_android.data.LocalStorage
import java.io.InputStreamReader
import java.nio.charset.StandardCharsets

View file

@ -1,6 +1,6 @@
package com.tangem.data;
import com.tangem.tangemcard.R;
import com.tangem.card_android.R;
/**
* Created by dvol on 06.08.2017.

View file

@ -3,7 +3,7 @@ package com.tangem.data;
import android.content.Context;
import android.util.Log;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.util.Util;
import java.io.BufferedReader;
import java.io.BufferedWriter;

View file

@ -3,7 +3,7 @@ package com.tangem.data.fingerprint;
import android.os.AsyncTask;
import android.widget.Toast;
import com.tangem.presentation.activity.PinSaveActivity;
import com.tangem.ui.activity.PinSaveActivity;
import com.tangem.wallet.R;
import java.lang.ref.WeakReference;

View file

@ -9,8 +9,8 @@ import android.security.keystore.KeyPermanentlyInvalidatedException;
import android.security.keystore.KeyProperties;
import com.tangem.Constant;
import com.tangem.tangemcard.android.data.PINStorage;
import com.tangem.presentation.activity.PinRequestActivity;
import com.tangem.card_android.android.data.PINStorage;
import com.tangem.ui.activity.PinRequestActivity;
import com.tangem.util.LOG;
import java.io.IOException;

View file

@ -3,7 +3,7 @@ package com.tangem.data.local
import android.content.Context
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.card_common.data.TangemCard
import java.io.File
import java.util.*
import kotlin.collections.HashMap

View file

@ -11,7 +11,7 @@ import com.google.gson.annotations.SerializedName;
import com.google.gson.internal.LinkedTreeMap;
import com.jakewharton.retrofit2.adapter.rxjava2.HttpException;
import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.util.Util;
import com.tangem.wallet.R;
import java.io.IOException;

View file

@ -6,7 +6,7 @@ import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.util.Util;
import com.tangem.wallet.R;
import org.spongycastle.util.encoders.Base64;

View file

@ -17,7 +17,10 @@ data class AddressData(
var caAddress: String? = null,
@SerializedName("caBalance")
var caBalance: AdaliteCoins? = null
var caBalance: AdaliteCoins? = null,
@SerializedName("caTxList")
var caTxList: List<TxData>
)
data class AdaliteCoins(
@ -34,4 +37,9 @@ data class UtxoData(
@SerializedName("cuCoins")
var cuCoins: AdaliteCoins? = null
)
data class TxData(
@SerializedName("ctbId")
var ctbId: String? = null
)

View file

@ -4,7 +4,7 @@ import android.app.Activity
import android.nfc.Tag
import com.tangem.Constant
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.activity.*
import com.tangem.ui.activity.*
class Navigator {

View file

@ -1,14 +1,14 @@
package com.tangem.di
import com.tangem.presentation.activity.EmptyWalletActivity
import com.tangem.presentation.activity.LoadedWalletActivity
import com.tangem.presentation.activity.LogoActivity
import com.tangem.presentation.activity.MainActivity
import com.tangem.presentation.activity.PrepareCryptonitOtherApiWithdrawalActivity
import com.tangem.presentation.activity.PrepareKrakenWithdrawalActivity
import com.tangem.presentation.activity.PrepareTransactionActivity
import com.tangem.presentation.activity.PurgeActivity
import com.tangem.presentation.activity.VerifyCardActivity
import com.tangem.ui.activity.EmptyWalletActivity
import com.tangem.ui.activity.LoadedWalletActivity
import com.tangem.ui.activity.LogoActivity
import com.tangem.ui.activity.MainActivity
import com.tangem.ui.activity.PrepareCryptonitOtherApiWithdrawalActivity
import com.tangem.ui.activity.PrepareKrakenWithdrawalActivity
import com.tangem.ui.activity.PrepareTransactionActivity
import com.tangem.ui.activity.PurgeActivity
import com.tangem.ui.activity.VerifyCardActivity
import javax.inject.Singleton

View file

@ -1,6 +1,6 @@
package com.tangem.di
import com.tangem.presentation.dialog.WaitSecurityDelayDialogNew
import com.tangem.ui.dialog.WaitSecurityDelayDialogNew
import javax.inject.Singleton

View file

@ -11,7 +11,7 @@ import com.tangem.domain.wallet.btc.BitcoinOutputStream;
import com.tangem.domain.wallet.btc.BtcData;
import com.tangem.util.CryptoUtil;
import com.tangem.util.FormatUtil;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.util.Util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View file

@ -11,7 +11,7 @@ import com.tangem.domain.wallet.btc.BitcoinOutputStream;
import com.tangem.domain.wallet.btc.BtcData;
import com.tangem.util.CryptoUtil;
import com.tangem.util.FormatUtil;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.util.Util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View file

@ -1,7 +1,7 @@
package com.tangem.domain.wallet;
import com.tangem.App;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.card_common.data.TangemCard;
import com.tangem.wallet.R;
public class BalanceValidator {

View file

@ -3,8 +3,8 @@ package com.tangem.domain.wallet;
import android.net.Uri;
import android.text.InputFilter;
import com.tangem.tangemcommon.reader.CardProtocol;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.card_common.reader.CardProtocol;
import com.tangem.card_common.tasks.SignTask;
import java.io.IOException;
import java.math.BigDecimal;

View file

@ -6,8 +6,8 @@ import android.os.Bundle;
import com.tangem.Constant;
import com.tangem.data.Blockchain;
import com.tangem.tangemcard.data.TangemCardExtensionsKt;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.card_android.data.TangemCardExtensionsKt;
import com.tangem.card_common.data.TangemCard;
public class TangemContext {
// public static final String EXTRA_BLOCKCHAIN_DATA = "BLOCKCHAIN_DATA";

View file

@ -8,20 +8,20 @@ import com.tangem.data.network.ElectrumRequest;
import com.tangem.data.network.ServerApiElectrum;
import com.tangem.domain.wallet.BCHUtils;
import com.tangem.domain.wallet.BTCUtils;
import com.tangem.tangemcommon.reader.CardProtocol;
import com.tangem.card_common.reader.CardProtocol;
import com.tangem.domain.wallet.BalanceValidator;
import com.tangem.domain.wallet.btc.BtcData;
import com.tangem.domain.wallet.CoinData;
import com.tangem.domain.wallet.CoinEngine;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.card_common.data.TangemCard;
import com.tangem.domain.wallet.TangemContext;
import com.tangem.domain.wallet.Transaction;
import com.tangem.domain.wallet.UnspentOutputInfo;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.util.CryptoUtil;
import com.tangem.util.DecimalDigitsInputFilter;
import com.tangem.util.DerEncodingUtil;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.util.Util;
import com.tangem.wallet.R;
import org.json.JSONArray;

View file

@ -4,27 +4,28 @@ import android.net.Uri;
import android.text.InputFilter;
import android.util.Log;
import com.tangem.App;
import com.tangem.card_common.data.TangemCard;
import com.tangem.card_common.reader.CardProtocol;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.card_common.util.Util;
import com.tangem.data.Blockchain;
import com.tangem.data.local.PendingTransactionsStorage;
import com.tangem.data.network.ElectrumRequest;
import com.tangem.data.network.ServerApiCommon;
import com.tangem.tangemcommon.reader.CardProtocol;
import com.tangem.data.network.ServerApiElectrum;
import com.tangem.domain.wallet.BTCUtils;
import com.tangem.domain.wallet.BalanceValidator;
import com.tangem.domain.wallet.Base58;
import com.tangem.data.Blockchain;
import com.tangem.domain.wallet.CoinData;
import com.tangem.domain.wallet.CoinEngine;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.domain.wallet.TangemContext;
import com.tangem.domain.wallet.Transaction;
import com.tangem.domain.wallet.UnspentOutputInfo;
import com.tangem.domain.wallet.BTCUtils;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.util.CryptoUtil;
import com.tangem.util.DecimalDigitsInputFilter;
import com.tangem.util.DerEncodingUtil;
import com.tangem.tangemcommon.util.Util;
import com.tangem.wallet.R;
import com.tangem.data.network.ElectrumRequest;
import com.tangem.data.network.ServerApiElectrum;
import org.json.JSONArray;
import org.json.JSONException;
@ -311,9 +312,7 @@ public class BtcEngine extends CoinEngine {
// }
return true;
}
catch (Exception e)
{
} catch (Exception e) {
e.printStackTrace();
return false;
}
@ -477,7 +476,8 @@ public class BtcEngine extends CoinEngine {
@Override
public byte[][] getHashesToSign() throws Exception {
byte[][] dataForSign = new byte[unspentOutputs.size()][];
if (txForSign.length > 10) throw new Exception("To much hashes in one transaction!");
if (txForSign.length > 10)
throw new Exception("To much hashes in one transaction!");
for (int i = 0; i < unspentOutputs.size(); ++i) {
dataForSign[i] = bodyDoubleHash[i];
}
@ -530,7 +530,7 @@ public class BtcEngine extends CoinEngine {
ServerApiElectrum.ResponseListener electrumListener = new ServerApiElectrum.ResponseListener() {
@Override
public void onSuccess(ElectrumRequest electrumRequest) {
Log.i(TAG, "onSuccess: "+electrumRequest.getMethod());
Log.i(TAG, "onSuccess: " + electrumRequest.getMethod());
if (electrumRequest.isMethod(ElectrumRequest.METHOD_GetBalance)) {
try {
String walletAddress = electrumRequest.getParams().getString(0);
@ -544,6 +544,7 @@ public class BtcEngine extends CoinEngine {
coinData.setBalanceConfirmed(confBalance);
coinData.setBalanceUnconfirmed(unconfirmedBalance);
coinData.setValidationNodeDescription(serverApiElectrum.getValidationNodeDescription());
checkPending(blockchainRequestsCallbacks);
} catch (JSONException e) {
e.printStackTrace();
Log.e(TAG, "FAIL METHOD_GetBalance JSONException");
@ -600,19 +601,19 @@ public class BtcEngine extends CoinEngine {
if (serverApiElectrum.isRequestsSequenceCompleted()) {
blockchainRequestsCallbacks.onComplete(!ctx.hasError());
}else{
} else {
blockchainRequestsCallbacks.onProgress();
}
}
@Override
public void onFail(ElectrumRequest electrumRequest) {
Log.i(TAG, "onFail: "+electrumRequest.getMethod()+" "+electrumRequest.getError());
Log.i(TAG, "onFail: " + electrumRequest.getMethod() + " " + electrumRequest.getError());
ctx.setError(electrumRequest.getError());
// ctx.setError(R.string.cannot_obtain_data_from_blockchain);
if (serverApiElectrum.isRequestsSequenceCompleted()) {
blockchainRequestsCallbacks.onComplete(false);//serverApiElectrum.isErrorOccurred(), serverApiElectrum.getError());
}else{
} else {
blockchainRequestsCallbacks.onProgress();
}
}
@ -624,6 +625,50 @@ public class BtcEngine extends CoinEngine {
serverApiElectrum.requestData(ctx, ElectrumRequest.listUnspent(coinData.getWallet()));
}
private void checkPending(BlockchainRequestsCallbacks blockchainRequestsCallbacks) {
if (App.pendingTransactionsStorage.hasTransactions(ctx.getCard())) {
ServerApiElectrum serverApiElectrum = new ServerApiElectrum();
ServerApiElectrum.ResponseListener electrumListener = new ServerApiElectrum.ResponseListener() {
@Override
public void onSuccess(ElectrumRequest electrumRequest) {
Log.i(TAG, "onSuccess: " + electrumRequest.getMethod());
try {
if (electrumRequest.getResultString() != null) {
App.pendingTransactionsStorage.removeTransaction(ctx.getCard(), electrumRequest.txHash);
}
} catch (Exception e) {
Log.e(TAG, "onFail: " + electrumRequest.getMethod() + " " + electrumRequest.getError());
}
if (serverApiElectrum.isRequestsSequenceCompleted()) {
blockchainRequestsCallbacks.onComplete(!ctx.hasError());
} else {
blockchainRequestsCallbacks.onProgress();
}
}
@Override
public void onFail(ElectrumRequest electrumRequest) {
Log.i(TAG, "onFail: " + electrumRequest.getMethod() + " " + electrumRequest.getError());
// ctx.setError(R.string.cannot_obtain_data_from_blockchain);
if (serverApiElectrum.isRequestsSequenceCompleted()) {
blockchainRequestsCallbacks.onComplete(false);//serverApiElectrum.isErrorOccurred(), serverApiElectrum.getError());
} else {
blockchainRequestsCallbacks.onProgress();
}
}
};
serverApiElectrum.setResponseListener(electrumListener);
for (PendingTransactionsStorage.TransactionInfo pendingTx : App.pendingTransactionsStorage.getTransactions(ctx.getCard()).getTransactions()) {
String txHash = BTCUtils.toHex(CryptoUtil.doubleSha256(BTCUtils.fromHex(pendingTx.getTx())));
serverApiElectrum.requestData(ctx, ElectrumRequest.getTransaction(ctx.getCoinData().getWallet(), txHash));
}
}
}
protected Integer calculateEstimatedTransactionSize(String outputAddress, String outAmount) {
//todo - правильней было бы использовать constructTransaction
try {
@ -686,15 +731,16 @@ public class BtcEngine extends CoinEngine {
//
// byte[] realTX = BTCUtils.buildTXForSend(outputAddress, myAddress, unspentOutputs, amount, change);
SignTask.TransactionToSign ps= constructTransaction(new Amount(outAmount, getBalanceCurrency()),new Amount("0.00",getFeeCurrency()), true, outputAddress );
SignTask.TransactionToSign ps = constructTransaction(new Amount(outAmount, getBalanceCurrency()), new Amount("0.00", getFeeCurrency()), true, outputAddress);
OnNeedSendTransaction onNeedSendTransactionBackup = onNeedSendTransaction;
onNeedSendTransaction =(tx)->{}; // empty function to bypass exception
onNeedSendTransaction = (tx) -> {
}; // empty function to bypass exception
byte[][] hashesToSign=ps.getHashesToSign();
byte[][] hashesToSign = ps.getHashesToSign();
byte[] signFromCard = new byte[64 * hashesToSign.length];
byte[] txForSend=ps.onSignCompleted(signFromCard);
byte[] txForSend = ps.onSignCompleted(signFromCard);
onNeedSendTransaction = onNeedSendTransactionBackup;
Log.e(TAG,"txForSend.length="+String.valueOf(txForSend.length));
Log.e(TAG, "txForSend.length=" + String.valueOf(txForSend.length));
return txForSend.length;
// Log.e(TAG,"txForSend.length="+String.valueOf(txForSend.length)+" realTX.length="+String.valueOf(realTX.length));
@ -753,9 +799,9 @@ public class BtcEngine extends CoinEngine {
break;
}
if(coinData.minFee!=null && coinData.normalFee!=null && coinData.maxFee!=null ) {
if (coinData.minFee != null && coinData.normalFee != null && coinData.maxFee != null) {
blockchainRequestsCallbacks.onComplete(true);
}else{
} else {
blockchainRequestsCallbacks.onProgress();
}
}
@ -793,7 +839,7 @@ public class BtcEngine extends CoinEngine {
if (resultString == null || resultString.isEmpty()) {
ctx.setError("Rejected by node: " + electrumRequest.getError());
blockchainRequestsCallbacks.onComplete(false);
}else {
} else {
ctx.setError(null);
blockchainRequestsCallbacks.onComplete(true);
}

View file

@ -5,9 +5,12 @@ import android.text.InputFilter;
import android.util.Base64;
import android.util.Log;
import com.tangem.App;
import com.tangem.data.local.PendingTransactionsStorage;
import com.tangem.data.network.ServerApiAdalite;
import com.tangem.data.network.model.AdaliteResponse;
import com.tangem.data.network.model.AdaliteResponseUtxo;
import com.tangem.data.network.model.TxData;
import com.tangem.data.network.model.UtxoData;
import com.tangem.domain.wallet.BTCUtils;
import com.tangem.domain.wallet.BalanceValidator;
@ -15,10 +18,10 @@ import com.tangem.domain.wallet.Base58;
import com.tangem.domain.wallet.CoinData;
import com.tangem.domain.wallet.CoinEngine;
import com.tangem.domain.wallet.TangemContext;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.tangemcommon.reader.CardProtocol;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.data.TangemCard;
import com.tangem.card_common.reader.CardProtocol;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.card_common.util.Util;
import com.tangem.util.DecimalDigitsInputFilter;
import com.tangem.wallet.R;
@ -617,6 +620,20 @@ public class CardanoEngine extends CoinEngine {
coinData.setBalanceReceived(true);
coinData.setBalance(adaliteResponse.getRight().getCaBalance().getGetCoin());
coinData.setValidationNodeDescription(ServerApiAdalite.lastNode);
//check pending
if (App.pendingTransactionsStorage.hasTransactions(ctx.getCard())) {
for (PendingTransactionsStorage.TransactionInfo pendingTx : App.pendingTransactionsStorage.getTransactions(ctx.getCard()).getTransactions()) {
String pendingId = CalculateTxHash(pendingTx.getTx());
int x = 0;
for (TxData walletTx : adaliteResponse.getRight().getCaTxList()) {
if (walletTx.getCtbId().equals(pendingId)) {
App.pendingTransactionsStorage.removeTransaction(ctx.getCard(), pendingTx.getTx());
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
Log.e(TAG, "FAIL ADALITE_ADDRESS Exception");
@ -756,4 +773,19 @@ public class CardanoEngine extends CoinEngine {
public boolean allowSelectFeeLevel() {
return false;
}
@Override
public int pendingTransactionTimeoutInSeconds() { return 60; }
private String CalculateTxHash(String tx) throws CborException {
Array txArray = (Array) CborDecoder.decode(BTCUtils.fromHex(tx)).get(0);
DataItem txBodyItem = txArray.getDataItems().get(0);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
new CborEncoder(baos).encode(txBodyItem);
byte[] txBody = baos.toByteArray();
final Blake2b blake2b = Blake2b.Digest.newInstance(32);
return BTCUtils.toHex(blake2b.digest(txBody));
}
}

View file

@ -15,10 +15,10 @@ import com.tangem.domain.wallet.Transaction;
import com.tangem.domain.wallet.UnspentOutputInfo;
import com.tangem.domain.wallet.btc.BtcData;
import com.tangem.domain.wallet.btc.BtcEngine;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.tangemcommon.reader.CardProtocol;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.data.TangemCard;
import com.tangem.card_common.reader.CardProtocol;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.card_common.util.Util;
import com.tangem.util.CryptoUtil;
import com.tangem.util.DecimalDigitsInputFilter;
import com.tangem.util.DerEncodingUtil;

View file

@ -15,8 +15,8 @@ import com.tangem.domain.wallet.ECDSASignatureETH;
import com.tangem.domain.wallet.EthTransaction;
import com.tangem.domain.wallet.Keccak256;
import com.tangem.domain.wallet.TangemContext;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.card_common.data.TangemCard;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.util.CryptoUtil;
import com.tangem.util.DecimalDigitsInputFilter;
import com.tangem.wallet.R;
@ -608,6 +608,7 @@ public class EthEngine extends CoinEngine {
serverApiInfura.setResponseListener(responseListener);
serverApiInfura.requestData(ServerApiInfura.INFURA_ETH_SEND_RAW_TRANSACTION, 67, coinData.getWallet(), "", txStr);
}
public int pendingTransactionTimeoutInSeconds() { return 10; }
}

View file

@ -3,11 +3,9 @@ package com.tangem.domain.wallet.ltc
enum class LitecoinNode(val host: String, val port: Int, val proto: String) {
N_001("backup.electrum-ltc.org", 443, "ssl"),
N_002("electrum-ltc.petrkr.net", 60002, "ssl"),
N_003("technetium.network", 50003, "ssl"),
N_004("167.99.146.166", 50002, "ssl"),
N_005("electrum-ltc.bysh.me", 50002, "ssl"),
N_006("e-3.claudioboxx.com", 50004, "ssl"),
N_007("e-1.claudioboxx.com", 50004, "ssl"),
N_008("e-2.claudioboxx.com", 50004, "ssl"),
N_009("electrum.ltc.xurious.com", 50002, "ssl"),
N_003("electrum-ltc.bysh.me", 50002, "ssl"),
N_004("e-3.claudioboxx.com", 50004, "ssl"),
N_005("e-1.claudioboxx.com", 50004, "ssl"),
N_006("e-2.claudioboxx.com", 50004, "ssl"),
N_007("electrum.ltc.xurious.com", 50002, "ssl"),
}

View file

@ -16,10 +16,10 @@ import com.tangem.domain.wallet.Transaction;
import com.tangem.domain.wallet.UnspentOutputInfo;
import com.tangem.domain.wallet.btc.BtcData;
import com.tangem.domain.wallet.btc.BtcEngine;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.tangemcommon.reader.CardProtocol;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.data.TangemCard;
import com.tangem.card_common.reader.CardProtocol;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.card_common.util.Util;
import com.tangem.util.CryptoUtil;
import com.tangem.util.DecimalDigitsInputFilter;
import com.tangem.util.DerEncodingUtil;
@ -557,9 +557,4 @@ public class LtcEngine extends BtcEngine {
serverApiElectrum.requestData(ctx, ElectrumRequest.getFee());
}
@Override
public boolean allowSelectFeeLevel() {
return false;
}
}

View file

@ -16,8 +16,8 @@ import com.tangem.domain.wallet.Keccak256;
import com.tangem.domain.wallet.TangemContext;
import com.tangem.domain.wallet.eth.EthData;
import com.tangem.domain.wallet.token.TokenData;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.card_common.data.TangemCard;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.wallet.R;
import java.math.BigInteger;

View file

@ -201,8 +201,8 @@ public class RskEngine extends EthEngine {
serverApiRootstock.setResponseListener(responseListener);
serverApiRootstock.requestData(ServerApiRootstock.ROOTSTOCK_ETH_SEND_RAW_TRANSACTION, 67, coinData.getWallet(), "", txStr);
}
public int pendingTransactionTimeoutInSeconds() { return 10; }
}

View file

@ -162,19 +162,19 @@ public class RskTokenEngine extends TokenEngine {
gasPrice = gasPrice.substring(2);
// rounding gas price to integer gwei
BigInteger l = new BigInteger(gasPrice, 16);
BigInteger gasPriceBI = new BigInteger(gasPrice, 16).divide(BigInteger.valueOf(10000000)).multiply(BigInteger.valueOf(10000000));
Log.i(TAG, "Rootstock gas price: " + gasPrice + " (" + l.toString() + ")");
BigInteger m;
Log.i(TAG, "Rootstock gas price: " + gasPrice + " (" + gasPriceBI.toString() + ")");
BigInteger gasUsed;
if (!amount.getCurrency().equals(Blockchain.Rootstock.getCurrency()))
m = BigInteger.valueOf(60000);
else m = BigInteger.valueOf(21000);
gasUsed = BigInteger.valueOf(60000);
else gasUsed = BigInteger.valueOf(21000);
Log.i(TAG, "fee multiplier: " + m.toString());
Log.i(TAG, "fee multiplier: " + gasUsed.toString());
CoinEngine.InternalAmount weiMinFee = new CoinEngine.InternalAmount(l.multiply(m), "wei");
CoinEngine.InternalAmount weiNormalFee = new CoinEngine.InternalAmount(l.multiply(BigInteger.valueOf(12)).divide(BigInteger.valueOf(10)).multiply(m), "wei");
CoinEngine.InternalAmount weiMaxFee = new CoinEngine.InternalAmount(l.multiply(BigInteger.valueOf(15)).divide(BigInteger.valueOf(10)).multiply(m), "wei");
CoinEngine.InternalAmount weiMinFee = new CoinEngine.InternalAmount(gasPriceBI.multiply(gasUsed), "wei");
CoinEngine.InternalAmount weiNormalFee = new CoinEngine.InternalAmount(gasPriceBI.multiply(BigInteger.valueOf(12)).divide(BigInteger.valueOf(10)).multiply(gasUsed), "wei");
CoinEngine.InternalAmount weiMaxFee = new CoinEngine.InternalAmount(gasPriceBI.multiply(BigInteger.valueOf(15)).divide(BigInteger.valueOf(10)).multiply(gasUsed), "wei");
Log.i(TAG, "min fee : " + weiMinFee.toValueString() + " wei");
Log.i(TAG, "normal fee: " + weiNormalFee.toValueString() + " wei");
Log.i(TAG, "max fee : " + weiMaxFee.toValueString() + " wei");
@ -251,4 +251,6 @@ public class RskTokenEngine extends TokenEngine {
public boolean allowSelectFeeInclusion() {
return getBalance().getCurrency().equals(Blockchain.Rootstock.getCurrency());
}
public int pendingTransactionTimeoutInSeconds() { return 10; }
}

View file

@ -18,8 +18,8 @@ import com.tangem.domain.wallet.EthTransaction;
import com.tangem.domain.wallet.Keccak256;
import com.tangem.domain.wallet.TangemContext;
import com.tangem.domain.wallet.eth.EthData;
import com.tangem.tangemcommon.data.TangemCard;
import com.tangem.tangemcommon.tasks.SignTask;
import com.tangem.card_common.data.TangemCard;
import com.tangem.card_common.tasks.SignTask;
import com.tangem.util.CryptoUtil;
import com.tangem.util.DecimalDigitsInputFilter;
import com.tangem.wallet.R;
@ -827,4 +827,6 @@ public class TokenEngine extends CoinEngine {
public boolean allowSelectFeeInclusion() {
return getBalance().getCurrency().equals(Blockchain.Ethereum.getCurrency());
}
public int pendingTransactionTimeoutInSeconds() { return 10; }
}

View file

@ -1,3 +0,0 @@
package com.tangem.presentation.event
class DeletingWalletFinish

View file

@ -1,3 +0,0 @@
package com.tangem.presentation.event
class ReadAfterRequest

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.app.Activity
import android.content.Intent
@ -18,11 +18,11 @@ import com.tangem.data.Blockchain
import com.tangem.domain.wallet.CoinEngine
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.event.TransactionFinishWithError
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.data.loadFromBundle
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.ui.event.TransactionFinishWithError
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.data.loadFromBundle
import com.tangem.card_common.data.TangemCard
import com.tangem.util.UtilHelper
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_confirm_transaction.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.app.Activity
import android.content.Context
@ -15,16 +15,16 @@ import androidx.appcompat.app.AppCompatActivity
import com.tangem.App
import com.tangem.Constant
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
import com.tangem.tangemcard.android.nfc.NfcDeviceAntennaLocation
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.android.reader.NfcReader
import com.tangem.tangemcard.data.asBundle
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.tangemcommon.tasks.CreateNewWalletTask
import com.tangem.tangemcommon.util.Util
import com.tangem.ui.dialog.NoExtendedLengthSupportDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialog
import com.tangem.card_android.android.nfc.NfcDeviceAntennaLocation
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcReader
import com.tangem.card_android.data.asBundle
import com.tangem.card_common.reader.CardProtocol
import com.tangem.card_common.tasks.CreateNewWalletTask
import com.tangem.card_common.util.Util
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_create_new_wallet.*
import kotlinx.android.synthetic.main.layout_progress_horizontal.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.app.Activity
import android.content.Context
@ -18,17 +18,17 @@ import com.tangem.App
import com.tangem.Constant
import com.tangem.di.Navigator
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.android.reader.NfcReader
import com.tangem.tangemcard.data.asBundle
import com.tangem.tangemcard.data.loadFromBundle
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.tangemcommon.tasks.VerifyCardTask
import com.tangem.tangemcommon.util.Util
import com.tangem.ui.dialog.NoExtendedLengthSupportDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialog
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcReader
import com.tangem.card_android.data.asBundle
import com.tangem.card_android.data.loadFromBundle
import com.tangem.card_common.data.TangemCard
import com.tangem.card_common.reader.CardProtocol
import com.tangem.card_common.tasks.VerifyCardTask
import com.tangem.card_common.util.Util
import com.tangem.util.LOG
import com.tangem.util.UtilHelper
import com.tangem.wallet.R

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.content.Context
import android.content.Intent
@ -10,7 +10,7 @@ import com.tangem.App
import com.tangem.Constant
import com.tangem.di.Navigator
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.fragment.LoadedWallet
import com.tangem.ui.fragment.LoadedWallet
import com.tangem.wallet.R
import javax.inject.Inject

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.annotation.SuppressLint
import android.content.Context

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.Manifest
import android.app.Activity
@ -27,18 +27,18 @@ import com.tangem.data.network.ServerApiCommon
import com.tangem.di.Navigator
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
import com.tangem.presentation.dialog.RootFoundDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
import com.tangem.tangemcard.android.nfc.NfcDeviceAntennaLocation
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.android.reader.NfcReader
import com.tangem.tangemcard.data.loadFromBundle
import com.tangem.tangemcard.data.saveToBundle
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.tangemcommon.tasks.ReadCardInfoTask
import com.tangem.ui.dialog.NoExtendedLengthSupportDialog
import com.tangem.ui.dialog.RootFoundDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialog
import com.tangem.card_android.android.nfc.NfcDeviceAntennaLocation
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcReader
import com.tangem.card_android.data.loadFromBundle
import com.tangem.card_android.data.saveToBundle
import com.tangem.card_common.data.TangemCard
import com.tangem.card_common.reader.CardProtocol
import com.tangem.card_common.tasks.ReadCardInfoTask
import com.tangem.util.CommonUtil
import com.tangem.util.LOG
import com.tangem.util.PhoneUtility

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.Manifest
import android.annotation.SuppressLint
@ -21,15 +21,15 @@ import android.view.View
import android.widget.Button
import com.tangem.Constant
import com.tangem.data.fingerprint.StartFingerprintReaderTask
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.data.fingerprint.FingerprintHelper
import com.tangem.domain.wallet.TangemContext
import com.tangem.tangemcard.android.data.PINStorage
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.data.loadFromBundle
import com.tangem.tangemcard.data.EXTRA_TANGEM_CARD
import com.tangem.tangemcard.data.EXTRA_TANGEM_CARD_UID
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.card_android.android.data.PINStorage
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.data.loadFromBundle
import com.tangem.card_android.data.EXTRA_TANGEM_CARD
import com.tangem.card_android.data.EXTRA_TANGEM_CARD_UID
import com.tangem.card_common.data.TangemCard
import com.tangem.util.LOG
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_pin_request.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.Manifest
import android.annotation.SuppressLint
@ -23,7 +23,7 @@ import android.widget.Toast
import com.tangem.Constant
import com.tangem.data.fingerprint.ConfirmWithFingerprintTask
import com.tangem.data.fingerprint.FingerprintHelper
import com.tangem.tangemcard.android.data.PINStorage
import com.tangem.card_android.android.data.PINStorage
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_pin_save.*
import kotlinx.android.synthetic.main.layout_pin_buttons.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.app.Activity
import android.content.Context
@ -15,16 +15,16 @@ import android.widget.ProgressBar
import android.widget.Toast
import com.tangem.App
import com.tangem.Constant
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.android.reader.NfcReader
import com.tangem.tangemcard.data.*
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.tangemcommon.tasks.SwapPINTask
import com.tangem.tangemcommon.util.Util
import com.tangem.ui.dialog.NoExtendedLengthSupportDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialog
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcReader
import com.tangem.card_android.data.*
import com.tangem.card_common.data.TangemCard
import com.tangem.card_common.reader.CardProtocol
import com.tangem.card_common.tasks.SwapPINTask
import com.tangem.card_common.util.Util
import com.tangem.util.LOG
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_pin_swap.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.annotation.SuppressLint
import android.app.Activity
@ -16,8 +16,8 @@ import com.tangem.data.network.CryptonitOtherApi
import com.tangem.di.Navigator
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_prepare_cryptonit_other_api_withdrawal.*
import java.io.IOException

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.annotation.SuppressLint
import android.content.Context
@ -13,11 +13,11 @@ import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.Toast
import com.tangem.data.network.Cryptonit
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.data.Blockchain
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.util.DecimalDigitsInputFilter
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_prepare_cryptonit_withdrawal.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.annotation.SuppressLint
import android.app.Activity
@ -18,12 +18,12 @@ import android.widget.Toast
import com.tangem.App
import com.tangem.Constant
import com.tangem.data.network.Kraken
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.data.Blockchain
import com.tangem.di.Navigator
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_prepare_kraken_withdrawal.*
import java.io.IOException

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.app.Activity
import android.content.Context
@ -19,8 +19,8 @@ import com.tangem.data.Blockchain
import com.tangem.di.Navigator
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.util.UtilHelper
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_prepare_transaction.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.app.Activity
import android.content.Context
@ -15,18 +15,18 @@ import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.tangem.App
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialogNew
import com.tangem.presentation.event.DeletingWalletFinish
import com.tangem.tangemcard.android.nfc.NfcDeviceAntennaLocation
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.android.reader.NfcReader
import com.tangem.tangemcard.data.asBundle
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.tangemcommon.tasks.PurgeTask
import com.tangem.tangemcommon.util.Util
import com.tangem.ui.dialog.NoExtendedLengthSupportDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialogNew
import com.tangem.ui.event.DeletingWalletFinish
import com.tangem.card_android.android.nfc.NfcDeviceAntennaLocation
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcReader
import com.tangem.card_android.data.asBundle
import com.tangem.card_common.reader.CardProtocol
import com.tangem.card_common.tasks.PurgeTask
import com.tangem.card_common.util.Util
import com.tangem.util.LOG
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_purge.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.Manifest
import android.app.Activity

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.content.Intent
import android.nfc.NfcAdapter
@ -12,11 +12,11 @@ import com.tangem.Constant
import com.tangem.domain.wallet.CoinEngine
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.event.TransactionFinishWithError
import com.tangem.presentation.event.TransactionFinishWithSuccess
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcommon.util.Util
import com.tangem.ui.event.TransactionFinishWithError
import com.tangem.ui.event.TransactionFinishWithSuccess
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_common.util.Util
import com.tangem.util.UtilHelper
import com.tangem.wallet.R
import org.greenrobot.eventbus.EventBus

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.app.Activity
import android.content.Intent
@ -18,16 +18,16 @@ import com.tangem.Constant
import com.tangem.domain.wallet.CoinEngine
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
import com.tangem.tangemcard.android.nfc.NfcDeviceAntennaLocation
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.android.reader.NfcReader
import com.tangem.tangemcard.data.asBundle
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.tangemcommon.tasks.SignTask
import com.tangem.tangemcommon.util.Util
import com.tangem.ui.dialog.NoExtendedLengthSupportDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialog
import com.tangem.card_android.android.nfc.NfcDeviceAntennaLocation
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcReader
import com.tangem.card_android.data.asBundle
import com.tangem.card_common.reader.CardProtocol
import com.tangem.card_common.tasks.SignTask
import com.tangem.card_common.util.Util
import com.tangem.util.LOG
import com.tangem.wallet.R
import kotlinx.android.synthetic.main.activity_sign_transaction.*

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.activity
package com.tangem.ui.activity
import android.content.Context
import android.content.Intent
@ -8,7 +8,7 @@ import com.tangem.App
import com.tangem.Constant
import com.tangem.di.Navigator
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.fragment.VerifyCard
import com.tangem.ui.fragment.VerifyCard
import com.tangem.wallet.R
import javax.inject.Inject

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.dialog
package com.tangem.ui.dialog
import android.app.AlertDialog
import android.app.Dialog

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.dialog;
package com.tangem.ui.dialog;
import android.app.AlertDialog;
import android.app.Dialog;

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.dialog
package com.tangem.ui.dialog
import android.app.AlertDialog
import android.app.Dialog

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.dialog;
package com.tangem.ui.dialog;
import android.app.AlertDialog;
import android.app.Dialog;

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.dialog;
package com.tangem.ui.dialog;
import android.app.Activity;
import android.app.AlertDialog;

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.dialog
package com.tangem.ui.dialog
import android.annotation.SuppressLint
import android.app.AlertDialog
@ -6,9 +6,9 @@ import android.app.Dialog
import android.os.Bundle
import androidx.appcompat.app.AppCompatDialogFragment
import android.widget.ProgressBar
import com.tangem.presentation.event.ReadAfterRequest
import com.tangem.presentation.event.ReadBeforeRequest
import com.tangem.presentation.event.ReadWait
import com.tangem.ui.event.ReadAfterRequest
import com.tangem.ui.event.ReadBeforeRequest
import com.tangem.ui.event.ReadWait
import com.tangem.util.LOG
import com.tangem.wallet.R
import org.greenrobot.eventbus.EventBus

View file

@ -0,0 +1,3 @@
package com.tangem.ui.event
class DeletingWalletFinish

View file

@ -0,0 +1,3 @@
package com.tangem.ui.event
class ReadAfterRequest

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.event
package com.tangem.ui.event
class ReadBeforeRequest {
var timeout: Int? = null

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.event
package com.tangem.ui.event
class ReadWait {
var msec: Int? = null

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.event
package com.tangem.ui.event
class TransactionFinishWithError {
var message: String? = null

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.event
package com.tangem.ui.event
class TransactionFinishWithSuccess {
var message: String? = null

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.fragment
package com.tangem.ui.fragment
import android.app.Activity
import android.app.AlertDialog
@ -28,29 +28,29 @@ import com.tangem.domain.wallet.BalanceValidator
import com.tangem.domain.wallet.CoinEngine
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.activity.LoadedWalletActivity
import com.tangem.presentation.activity.PinRequestActivity
import com.tangem.presentation.activity.PrepareCryptonitWithdrawalActivity
import com.tangem.presentation.activity.PrepareKrakenWithdrawalActivity
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
import com.tangem.presentation.dialog.PINSwapWarningDialog
import com.tangem.presentation.dialog.ShowQRCodeDialog
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
import com.tangem.presentation.event.DeletingWalletFinish
import com.tangem.presentation.event.TransactionFinishWithError
import com.tangem.presentation.event.TransactionFinishWithSuccess
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.android.reader.NfcReader
import com.tangem.tangemcard.data.EXTRA_TANGEM_CARD
import com.tangem.tangemcard.data.EXTRA_TANGEM_CARD_UID
import com.tangem.tangemcard.data.loadFromBundle
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.tangemcommon.tasks.VerifyCardTask
import com.tangem.tangemcommon.util.Util
import com.tangem.tangemserver.android.ServerApiTangem
import com.tangem.tangemserver.android.model.CardVerifyAndGetInfo
import com.tangem.ui.activity.LoadedWalletActivity
import com.tangem.ui.activity.PinRequestActivity
import com.tangem.ui.activity.PrepareCryptonitWithdrawalActivity
import com.tangem.ui.activity.PrepareKrakenWithdrawalActivity
import com.tangem.ui.dialog.NoExtendedLengthSupportDialog
import com.tangem.ui.dialog.PINSwapWarningDialog
import com.tangem.ui.dialog.ShowQRCodeDialog
import com.tangem.ui.dialog.WaitSecurityDelayDialog
import com.tangem.ui.event.DeletingWalletFinish
import com.tangem.ui.event.TransactionFinishWithError
import com.tangem.ui.event.TransactionFinishWithSuccess
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.android.reader.NfcReader
import com.tangem.card_android.data.EXTRA_TANGEM_CARD
import com.tangem.card_android.data.EXTRA_TANGEM_CARD_UID
import com.tangem.card_android.data.loadFromBundle
import com.tangem.card_common.data.TangemCard
import com.tangem.card_common.reader.CardProtocol
import com.tangem.card_common.tasks.VerifyCardTask
import com.tangem.card_common.util.Util
import com.tangem.server_android.ServerApiTangem
import com.tangem.server_android.model.CardVerifyAndGetInfo
import com.tangem.util.LOG
import com.tangem.util.UtilHelper
import com.tangem.wallet.R

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.fragment
package com.tangem.ui.fragment
import android.app.Activity
import android.content.Intent
@ -19,15 +19,15 @@ import com.tangem.Constant
import com.tangem.data.Blockchain
import com.tangem.domain.wallet.CoinEngineFactory
import com.tangem.domain.wallet.TangemContext
import com.tangem.presentation.activity.*
import com.tangem.presentation.dialog.PINSwapWarningDialog
import com.tangem.presentation.event.DeletingWalletFinish
import com.tangem.tangemcard.android.data.PINStorage
import com.tangem.tangemcard.android.nfc.NfcLifecycleObserver
import com.tangem.tangemcard.android.reader.NfcManager
import com.tangem.tangemcard.data.loadFromBundle
import com.tangem.tangemcommon.data.TangemCard
import com.tangem.tangemcommon.reader.CardProtocol
import com.tangem.ui.activity.*
import com.tangem.ui.dialog.PINSwapWarningDialog
import com.tangem.ui.event.DeletingWalletFinish
import com.tangem.card_android.android.data.PINStorage
import com.tangem.card_android.android.nfc.NfcLifecycleObserver
import com.tangem.card_android.android.reader.NfcManager
import com.tangem.card_android.data.loadFromBundle
import com.tangem.card_common.data.TangemCard
import com.tangem.card_common.reader.CardProtocol
import com.tangem.util.LOG
import com.tangem.wallet.BuildConfig
import com.tangem.wallet.R

View file

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tangem.presentation.viewmodel
package com.tangem.ui.viewmodel
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

View file

@ -1,4 +1,4 @@
package com.tangem.presentation.viewmodel
package com.tangem.ui.viewmodel
import androidx.lifecycle.MutableLiveData
import com.tangem.data.network.exception.Failure

View file

@ -3,7 +3,7 @@ package com.tangem.util;
import android.util.Log;
import com.tangem.domain.wallet.ECDSASignatureETH;
import com.tangem.tangemcommon.util.Util;
import com.tangem.card_common.util.Util;
import org.spongycastle.asn1.ASN1EncodableVector;
import org.spongycastle.asn1.ASN1Integer;

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.ConfirmTransactionActivity"
tools:context="com.tangem.ui.activity.ConfirmTransactionActivity"
tools:ignore="Autofill">
<TextView
@ -278,7 +278,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintWidth_min="130dp" />
app:layout_constraintWidth_min="100dp" />
<TextView
android:id="@+id/tvCurrency2"

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.CreateNewWalletActivity">
tools:context="com.tangem.ui.activity.CreateNewWalletActivity">
<include
layout="@layout/layout_touch_card"

View file

@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context="com.tangem.presentation.activity.EmptyWalletActivity"
tools:context="com.tangem.ui.activity.EmptyWalletActivity"
tools:ignore="contentDescription">
<include

View file

@ -5,14 +5,14 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.LoadedWalletActivity">
tools:context="com.tangem.ui.activity.LoadedWalletActivity">
<fragment
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/loaded_wallet_fragment"
android:name="com.tangem.presentation.fragment.LoadedWallet"
android:name="com.tangem.ui.fragment.LoadedWallet"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

View file

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
tools:context="com.tangem.presentation.activity.LogoActivity"
tools:context="com.tangem.ui.activity.LogoActivity"
tools:ignore="contentDescription">
<ImageView

View file

@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.MainActivity"
tools:context="com.tangem.ui.activity.MainActivity"
tools:ignore="contentDescription">
<LinearLayout

View file

@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context="com.tangem.presentation.activity.PinRequestActivity">
tools:context="com.tangem.ui.activity.PinRequestActivity">
<TextView
android:id="@+id/tvPin"

View file

@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context="com.tangem.presentation.activity.PinSaveActivity">
tools:context="com.tangem.ui.activity.PinSaveActivity">
<TextView
android:id="@+id/tvPin"

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.PurgeActivity">
tools:context="com.tangem.ui.activity.PurgeActivity">
<LinearLayout
android:layout_width="match_parent"

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.PrepareCryptonitOtherApiWithdrawalActivity">
tools:context="com.tangem.ui.activity.PrepareCryptonitOtherApiWithdrawalActivity">
<TextView
android:id="@+id/textView"

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.PrepareCryptonitWithdrawalActivity">
tools:context="com.tangem.ui.activity.PrepareCryptonitWithdrawalActivity">
<TextView
android:id="@+id/textView"

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.PrepareKrakenWithdrawalActivity">
tools:context="com.tangem.ui.activity.PrepareKrakenWithdrawalActivity">
<TextView
android:id="@+id/textView"

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.PrepareTransactionActivity"
tools:context="com.tangem.ui.activity.PrepareTransactionActivity"
tools:ignore="contentDescription">
<TextView

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.PurgeActivity">
tools:context="com.tangem.ui.activity.PurgeActivity">
<include
layout="@layout/layout_touch_card"

View file

@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.SendTransactionActivity">
tools:context="com.tangem.ui.activity.SendTransactionActivity">
<ProgressBar
android:id="@+id/progressBar"

View file

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.SignTransactionActivity">
tools:context="com.tangem.ui.activity.SignTransactionActivity">
<include
layout="@layout/layout_touch_card"

View file

@ -5,11 +5,11 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tangem.presentation.activity.VerifyCardActivity">
tools:context="com.tangem.ui.activity.VerifyCardActivity">
<fragment
android:id="@+id/verify_card_fragment"
android:name="com.tangem.presentation.fragment.VerifyCard"
android:name="com.tangem.ui.fragment.VerifyCard"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

View file

@ -7,7 +7,7 @@
android:background="@color/white"
android:orientation="vertical"
android:padding="0dp"
tools:context="com.tangem.presentation.fragment.LoadedWallet"
tools:context="com.tangem.ui.fragment.LoadedWallet"
tools:ignore="contentDescription"
tools:showIn="@layout/activity_loaded_wallet">

View file

@ -6,7 +6,7 @@
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
tools:context="com.tangem.presentation.fragment.VerifyCard"
tools:context="com.tangem.ui.fragment.VerifyCard"
tools:ignore="contentDescription"
tools:showIn="@layout/activity_verify_card">

View file

@ -2,7 +2,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.tangem.presentation.activity.LoadedWalletActivity">
tools:context="com.tangem.ui.activity.LoadedWalletActivity">
<item
android:id="@+id/action_set_PIN1"

View file

@ -15,7 +15,7 @@ allprojects {
repositories {
google()
jcenter()
// maven { url 'https://jitpack.io' }
maven { url 'https://jitpack.io' }
}
}

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