Updated on 2026-08-14
This commit is contained in:
parent
61c4f7047d
commit
52ce16bb09
86 changed files with 9207 additions and 9295 deletions
|
|
@ -10,8 +10,8 @@ import android.support.v7.app.AppCompatActivity;
|
|||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
import com.tangem.presentation.fragment.WalletInfoFragment;
|
||||
|
||||
public class CardInfoActivity extends AppCompatActivity implements WalletInfoFragment.OnFragmentInteractionListener {
|
||||
|
|
@ -32,7 +32,7 @@ public class CardInfoActivity extends AppCompatActivity implements WalletInfoFra
|
|||
private ViewPager mViewPager;
|
||||
|
||||
|
||||
private Tangem_Card mCard;
|
||||
private TangemCard mCard;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
|
|
@ -51,7 +51,7 @@ public class CardInfoActivity extends AppCompatActivity implements WalletInfoFra
|
|||
tabLayout.setupWithViewPager(mViewPager);
|
||||
|
||||
String UID = getIntent().getStringExtra("UID");
|
||||
mCard = new Tangem_Card(UID);
|
||||
mCard = new TangemCard(UID);
|
||||
mCard.LoadFromBundle(getIntent().getBundleExtra("Card"));
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,25 +22,25 @@ import android.widget.RadioGroup;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.tangem.data.network.request.ElectrumRequest;
|
||||
import com.tangem.domain.cardReader.NfcManager;
|
||||
import com.tangem.domain.cardReader.Util;
|
||||
import com.tangem.wallet.BTCUtils;
|
||||
import com.tangem.wallet.Blockchain;
|
||||
import com.tangem.wallet.CoinEngine;
|
||||
import com.tangem.wallet.CoinEngineFactory;
|
||||
import com.tangem.wallet.DerEncodingUtil;
|
||||
import com.tangem.data.network.request.Electrum_Request;
|
||||
import com.tangem.data.network.task.Electrum_Task;
|
||||
import com.tangem.wallet.Fee_Request;
|
||||
import com.tangem.data.network.task.Fee_Task;
|
||||
import com.tangem.wallet.FormatUtil;
|
||||
import com.tangem.wallet.Infura_Request;
|
||||
import com.tangem.data.network.task.Infura_Task;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.util.Util;
|
||||
import com.tangem.domain.wallet.BTCUtils;
|
||||
import com.tangem.domain.wallet.Blockchain;
|
||||
import com.tangem.domain.wallet.CoinEngine;
|
||||
import com.tangem.domain.wallet.CoinEngineFactory;
|
||||
import com.tangem.domain.wallet.DerEncodingUtil;
|
||||
import com.tangem.data.network.task.ElectrumTask;
|
||||
import com.tangem.data.network.request.FeeRequest;
|
||||
import com.tangem.data.network.task.FeeTask;
|
||||
import com.tangem.domain.wallet.FormatUtil;
|
||||
import com.tangem.domain.wallet.Infura_Request;
|
||||
import com.tangem.data.network.task.InfuraTask;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.SharedData;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
import com.tangem.wallet.Transaction;
|
||||
import com.tangem.wallet.UnspentOutputInfo;
|
||||
import com.tangem.domain.wallet.SharedData;
|
||||
import com.tangem.domain.wallet.Transaction;
|
||||
import com.tangem.domain.wallet.UnspentOutputInfo;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
|
|
@ -65,7 +65,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
EditText etAmount;
|
||||
EditText etFee;
|
||||
ImageView ivCamera;
|
||||
Tangem_Card mCard;
|
||||
TangemCard mCard;
|
||||
RadioGroup rgFee;
|
||||
String minFee = null, maxFee = null, normalFee = null;
|
||||
Long minFeeInInternalUnits = 0L;
|
||||
|
|
@ -83,7 +83,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
MainActivity.commonInit(getApplicationContext());
|
||||
mNfcManager = new NfcManager(this, this);
|
||||
|
||||
mCard = new Tangem_Card(getIntent().getStringExtra("UID"));
|
||||
mCard = new TangemCard(getIntent().getStringExtra("UID"));
|
||||
mCard.LoadFromBundle(getIntent().getExtras().getBundle("Card"));
|
||||
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
|
|
@ -269,8 +269,8 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
//ConnectTask connectTaskEx = new ConnectTask(Blockchain.getNextServiceHost(mCard), Blockchain.getNextServicePort(mCard), data);
|
||||
ConnectTask connectTaskEx = new ConnectTask(nodeAddress, nodePort, data);
|
||||
|
||||
//connectTaskEx.execute(Electrum_Request.CheckBalance(mCard.getWallet()));
|
||||
connectTaskEx.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, Electrum_Request.CheckBalance(mCard.getWallet()));
|
||||
//connectTaskEx.execute(ElectrumRequest.CheckBalance(mCard.getWallet()));
|
||||
connectTaskEx.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, ElectrumRequest.CheckBalance(mCard.getWallet()));
|
||||
}
|
||||
|
||||
String nodeAddress = engineCoin.GetNode(mCard);
|
||||
|
|
@ -279,7 +279,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
|
||||
//ConnectTask connectTask = new ConnectTask(Blockchain.getServiceHost(mCard), Blockchain.getServicePort(mCard));
|
||||
|
||||
connectTask.execute(/*Electrum_Request.CheckBalance(mCard.getWallet()), */Electrum_Request.GetFee(mCard.getWallet()));
|
||||
connectTask.execute(/*ElectrumRequest.CheckBalance(mCard.getWallet()), */ElectrumRequest.GetFee(mCard.getWallet()));
|
||||
|
||||
int calcSize = 256;
|
||||
try {
|
||||
|
|
@ -295,9 +295,9 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
|
||||
ConnectFeeTask feeTask = new ConnectFeeTask(sharedFee);
|
||||
|
||||
feeTask.execute(Fee_Request.GetFee(mCard.getWallet(), calcSize, Fee_Request.NORMAL),
|
||||
Fee_Request.GetFee(mCard.getWallet(), calcSize, Fee_Request.MINIMAL),
|
||||
Fee_Request.GetFee(mCard.getWallet(), calcSize, Fee_Request.PRIORITY));
|
||||
feeTask.execute(FeeRequest.GetFee(mCard.getWallet(), calcSize, FeeRequest.NORMAL),
|
||||
FeeRequest.GetFee(mCard.getWallet(), calcSize, FeeRequest.MINIMAL),
|
||||
FeeRequest.GetFee(mCard.getWallet(), calcSize, FeeRequest.PRIORITY));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == REQUEST_CODE_SIGN_PAYMENT) {
|
||||
if (data != null && data.getExtras().containsKey("UID") && data.getExtras().containsKey("Card")) {
|
||||
Tangem_Card updatedCard = new Tangem_Card(data.getStringExtra("UID"));
|
||||
TangemCard updatedCard = new TangemCard(data.getStringExtra("UID"));
|
||||
updatedCard.LoadFromBundle(data.getBundleExtra("Card"));
|
||||
mCard = updatedCard;
|
||||
}
|
||||
|
|
@ -377,7 +377,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
byte[] pbComprKey = mCard.getWalletPublicKeyRar();
|
||||
|
||||
// Build script for our address
|
||||
List<Tangem_Card.UnspentTransaction> rawTxList = mCard.getUnspentTransactions();
|
||||
List<TangemCard.UnspentTransaction> rawTxList = mCard.getUnspentTransactions();
|
||||
byte[] outputScriptWeAreAbleToSpend = Transaction.Script.buildOutput(myAddress).bytes;
|
||||
|
||||
// Collect unspent
|
||||
|
|
@ -437,7 +437,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
return realTX.length;
|
||||
}
|
||||
|
||||
private class ConnectTask extends Electrum_Task {
|
||||
private class ConnectTask extends ElectrumTask {
|
||||
public ConnectTask(String host, int port) {
|
||||
super(host, port);
|
||||
}
|
||||
|
|
@ -452,12 +452,12 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(List<Electrum_Request> requests) {
|
||||
protected void onPostExecute(List<ElectrumRequest> requests) {
|
||||
super.onPostExecute(requests);
|
||||
for (Electrum_Request request : requests) {
|
||||
for (ElectrumRequest request : requests) {
|
||||
try {
|
||||
if (request.error == null) {
|
||||
if (request.isMethod(Electrum_Request.METHOD_GetBalance)) {
|
||||
if (request.isMethod(ElectrumRequest.METHOD_GetBalance)) {
|
||||
try {
|
||||
etFee.setText("--");
|
||||
|
||||
|
|
@ -490,7 +490,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
FinishActivityWithError(Activity.RESULT_CANCELED, "Cannot check balance! No connection with blockchain nodes");
|
||||
}
|
||||
}
|
||||
} else if (request.isMethod(Electrum_Request.METHOD_GetFee)) {
|
||||
} else if (request.isMethod(ElectrumRequest.METHOD_GetFee)) {
|
||||
if (request.getResultString() == "-1") {
|
||||
etFee.setText("3");
|
||||
}
|
||||
|
|
@ -526,7 +526,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
}
|
||||
}
|
||||
|
||||
private class ETHRequestTask extends Infura_Task {
|
||||
private class ETHRequestTask extends InfuraTask {
|
||||
ETHRequestTask(Blockchain blockchain) {
|
||||
super(blockchain);
|
||||
}
|
||||
|
|
@ -577,15 +577,15 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
}
|
||||
}
|
||||
|
||||
private class ConnectFeeTask extends Fee_Task {
|
||||
private class ConnectFeeTask extends FeeTask {
|
||||
public ConnectFeeTask(SharedData sharedData) {
|
||||
super(sharedData);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(List<Fee_Request> requests) {
|
||||
protected void onPostExecute(List<FeeRequest> requests) {
|
||||
super.onPostExecute(requests);
|
||||
for (Fee_Request request : requests) {
|
||||
for (FeeRequest request : requests) {
|
||||
if (request.error == null) {
|
||||
long minFeeRate = 0;
|
||||
|
||||
|
|
@ -651,12 +651,12 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
|
||||
finalFee = Math.round(finalFee) / (float) 10000;
|
||||
|
||||
if (request.getBlockCount() == Fee_Request.MINIMAL) {
|
||||
if (request.getBlockCount() == FeeRequest.MINIMAL) {
|
||||
minFee = String.valueOf(finalFee);
|
||||
minFeeInInternalUnits = mCard.InternalUnitsFromString(String.valueOf(finalFee));
|
||||
} else if (request.getBlockCount() == Fee_Request.NORMAL) {
|
||||
} else if (request.getBlockCount() == FeeRequest.NORMAL) {
|
||||
normalFee = String.valueOf(finalFee);
|
||||
} else if (request.getBlockCount() == Fee_Request.PRIORITY) {
|
||||
} else if (request.getBlockCount() == FeeRequest.PRIORITY) {
|
||||
maxFee = String.valueOf(finalFee);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,17 +17,17 @@ import android.widget.Toast;
|
|||
|
||||
import com.tangem.domain.cardReader.CardProtocol;
|
||||
import com.tangem.domain.cardReader.NfcManager;
|
||||
import com.tangem.domain.cardReader.Util;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.util.Util;
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog;
|
||||
import com.tangem.wallet.PINStorage;
|
||||
import com.tangem.domain.wallet.PINStorage;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog;
|
||||
|
||||
public class CreateNewWalletActivity extends AppCompatActivity implements NfcAdapter.ReaderCallback, CardProtocol.Notifications {
|
||||
|
||||
public static final int RESULT_INVALID_PIN = Activity.RESULT_FIRST_USER;
|
||||
private Tangem_Card mCard;
|
||||
private TangemCard mCard;
|
||||
private TextView tvCardID;
|
||||
private NfcManager mNfcManager;
|
||||
private static final String logTag = "CreateNewActivity";
|
||||
|
|
@ -41,7 +41,7 @@ public class CreateNewWalletActivity extends AppCompatActivity implements NfcAda
|
|||
setContentView(R.layout.activity_create_new_wallet);
|
||||
|
||||
MainActivity.commonInit(getApplicationContext());
|
||||
mCard = new Tangem_Card(getIntent().getStringExtra("UID"));
|
||||
mCard = new TangemCard(getIntent().getStringExtra("UID"));
|
||||
mCard.LoadFromBundle(getIntent().getExtras().getBundle("Card"));
|
||||
|
||||
tvCardID = (TextView) findViewById(R.id.tvCardID);
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ import android.widget.Toast;
|
|||
|
||||
import com.tangem.domain.cardReader.CardProtocol;
|
||||
import com.tangem.domain.cardReader.NfcManager;
|
||||
import com.tangem.domain.cardReader.Util;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.util.Util;
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
import com.tangem.wallet.VerifyCardTask;
|
||||
import com.tangem.data.network.task.VerifyCardTask;
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog;
|
||||
|
||||
public class EmptyWalletActivity extends AppCompatActivity implements NfcAdapter.ReaderCallback, CardProtocol.Notifications {
|
||||
|
|
@ -31,7 +31,7 @@ public class EmptyWalletActivity extends AppCompatActivity implements NfcAdapter
|
|||
private static final int REQUEST_CODE_CREATE_NEW_WALLET_ACTIVITY = 2;
|
||||
private static final int REQUEST_CODE_REQUEST_PIN2 = 3;
|
||||
private static final int REQUEST_CODE_VERIFY_CARD = 4;
|
||||
Tangem_Card mCard;
|
||||
TangemCard mCard;
|
||||
TextView tvCardID, tvIssuer, tvIssuerData, tvBlockchain;
|
||||
ProgressBar progressBar;
|
||||
ImageView ivBlockchain, ivPIN, ivPIN2orSecurityDelay, ivDeveloperVersion;
|
||||
|
|
@ -51,7 +51,7 @@ public class EmptyWalletActivity extends AppCompatActivity implements NfcAdapter
|
|||
MainActivity.commonInit(getApplicationContext());
|
||||
mNfcManager = new NfcManager(this, this);
|
||||
|
||||
mCard = new Tangem_Card(getIntent().getStringExtra("UID"));
|
||||
mCard = new TangemCard(getIntent().getStringExtra("UID"));
|
||||
mCard.LoadFromBundle(getIntent().getExtras().getBundle("Card"));
|
||||
|
||||
tvCardID = findViewById(R.id.tvCardID);
|
||||
|
|
@ -181,7 +181,7 @@ public class EmptyWalletActivity extends AppCompatActivity implements NfcAdapter
|
|||
finish();
|
||||
} else {
|
||||
if (data != null && data.getExtras().containsKey("UID") && data.getExtras().containsKey("Card")) {
|
||||
Tangem_Card updatedCard = new Tangem_Card(data.getStringExtra("UID"));
|
||||
TangemCard updatedCard = new TangemCard(data.getStringExtra("UID"));
|
||||
updatedCard.LoadFromBundle(data.getBundleExtra("Card"));
|
||||
mCard = updatedCard;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import android.nfc.Tag;
|
|||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.tangem.presentation.fragment.LoadedWalletActivityFragment;
|
||||
import com.tangem.presentation.fragment.LoadedWalletFragment;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ public class LoadedWalletActivity extends AppCompatActivity {
|
|||
{
|
||||
Tag tag=getIntent().getParcelableExtra(NfcAdapter.EXTRA_TAG);
|
||||
if (tag != null ) {
|
||||
LoadedWalletActivityFragment fragment=(LoadedWalletActivityFragment)(getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment));
|
||||
LoadedWalletFragment fragment=(LoadedWalletFragment)(getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment));
|
||||
fragment.onTagDiscovered(tag);
|
||||
}
|
||||
}
|
||||
|
|
@ -31,8 +31,8 @@ public class LoadedWalletActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
LoadedWalletActivityFragment loadedWalletActivityFragment=(LoadedWalletActivityFragment) getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment);
|
||||
Intent data= loadedWalletActivityFragment.prepareResultIntent();
|
||||
LoadedWalletFragment loadedWalletFragment =(LoadedWalletFragment) getSupportFragmentManager().findFragmentById(R.id.loaded_wallet_fragment);
|
||||
Intent data= loadedWalletFragment.prepareResultIntent();
|
||||
data.putExtra("modification", "update");
|
||||
setResult(Activity.RESULT_OK, data);
|
||||
finish();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package com.tangem.presentation.activity;
|
|||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
|
@ -23,39 +22,33 @@ public class LogoActivity extends AppCompatActivity {
|
|||
}
|
||||
};
|
||||
|
||||
ImageView imgLogo;
|
||||
private ImageView imgLogo;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_logo);
|
||||
|
||||
imgLogo= (ImageView) findViewById(R.id.imgLogo);
|
||||
// Set up the user interaction to manually show or hide the system UI.
|
||||
imgLogo.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {hide();
|
||||
}
|
||||
});
|
||||
imgLogo = findViewById(R.id.imgLogo);
|
||||
|
||||
// set up the user interaction to manually show or hide the system UI.
|
||||
imgLogo.setOnClickListener(view -> hide());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
|
||||
// Trigger the initial hide() shortly after the activity has been
|
||||
// created, to briefly hint to the user that UI controls
|
||||
// are available.
|
||||
TextView AppVersion = (TextView) findViewById(R.id.AppVersion);
|
||||
// trigger the initial hide() shortly after the activity has been created, to briefly hint to the user that UI controls are available.
|
||||
TextView AppVersion = findViewById(R.id.AppVersion);
|
||||
AppVersion.setText("BETA v." + BuildConfig.VERSION_NAME);
|
||||
if( !getIntent().getBooleanExtra("skipAutoHide",false)) {
|
||||
if (!getIntent().getBooleanExtra("skipAutoHide", false)) {
|
||||
delayedHide(1000);
|
||||
}
|
||||
}
|
||||
|
||||
private void hide() {
|
||||
Intent intent=new Intent(getBaseContext(),MainActivity.class);
|
||||
Intent intent = new Intent(getBaseContext(), MainActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@ import android.widget.TextView;
|
|||
|
||||
import com.scottyab.rootbeer.RootBeer;
|
||||
import com.skyfishjy.library.RippleBackground;
|
||||
import com.tangem.LogFileProvider;
|
||||
import com.tangem.domain.wallet.DeviceNFCAntennaLocation;
|
||||
import com.tangem.domain.wallet.LastSignStorage;
|
||||
import com.tangem.domain.wallet.Logger;
|
||||
import com.tangem.domain.wallet.PINStorage;
|
||||
import com.tangem.util.PhoneUtility;
|
||||
import com.tangem.presentation.fragment.MainFragment;
|
||||
import com.tangem.wallet.BuildConfig;
|
||||
import com.tangem.wallet.DeviceNFCAntennaLocation;
|
||||
import com.tangem.wallet.LastSignStorage;
|
||||
import com.tangem.wallet.LogFileProvider;
|
||||
import com.tangem.wallet.Logger;
|
||||
import com.tangem.presentation.fragment.MainActivityFragment;
|
||||
import com.tangem.wallet.PINStorage;
|
||||
import com.tangem.wallet.PhoneUtility;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
|
|
@ -165,8 +165,8 @@ public class MainActivity extends AppCompatActivity implements PopupMenu.OnMenuI
|
|||
}
|
||||
});
|
||||
|
||||
MainActivityFragment mainActivityFragment=(MainActivityFragment)getSupportFragmentManager().findFragmentById(R.id.fragmentMain);
|
||||
if( mainActivityFragment.getCardListAdapter().getItemCount()>0 )
|
||||
MainFragment mainFragment =(MainFragment)getSupportFragmentManager().findFragmentById(R.id.fragmentMain);
|
||||
if( mainFragment.getCardListAdapter().getItemCount()>0 )
|
||||
{
|
||||
showCleanButton();
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.tangem.domain.cardReader.NfcManager;
|
||||
import com.tangem.wallet.Blockchain;
|
||||
import com.tangem.wallet.CoinEngine;
|
||||
import com.tangem.wallet.CoinEngineFactory;
|
||||
import com.tangem.wallet.FormatUtil;
|
||||
import com.tangem.domain.wallet.Blockchain;
|
||||
import com.tangem.domain.wallet.CoinEngine;
|
||||
import com.tangem.domain.wallet.CoinEngineFactory;
|
||||
import com.tangem.domain.wallet.FormatUtil;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ public class PreparePaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
TextView tvCardId, tvBalance, tvBalanceEquivalent, tvAmountEquivalent;
|
||||
ImageView ivCamera;
|
||||
boolean use_mCurrency;
|
||||
Tangem_Card mCard;
|
||||
TangemCard mCard;
|
||||
private NfcManager mNfcManager;
|
||||
|
||||
@Override
|
||||
|
|
@ -50,7 +50,7 @@ public class PreparePaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
|
||||
mNfcManager = new NfcManager(this, this);
|
||||
|
||||
mCard = new Tangem_Card(getIntent().getStringExtra("UID"));
|
||||
mCard = new TangemCard(getIntent().getStringExtra("UID"));
|
||||
mCard.LoadFromBundle(getIntent().getExtras().getBundle("Card"));
|
||||
|
||||
btnVerify = (Button) findViewById(R.id.btnVerify);
|
||||
|
|
|
|||
|
|
@ -17,18 +17,18 @@ import android.widget.Toast;
|
|||
|
||||
import com.tangem.domain.cardReader.CardProtocol;
|
||||
import com.tangem.domain.cardReader.NfcManager;
|
||||
import com.tangem.domain.cardReader.Util;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.util.Util;
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog;
|
||||
import com.tangem.wallet.PINStorage;
|
||||
import com.tangem.domain.wallet.PINStorage;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog;
|
||||
|
||||
public class PurgeActivity extends AppCompatActivity implements NfcAdapter.ReaderCallback, CardProtocol.Notifications {
|
||||
|
||||
public static final int RESULT_INVALID_PIN = Activity.RESULT_FIRST_USER;
|
||||
|
||||
private Tangem_Card mCard;
|
||||
private TangemCard mCard;
|
||||
private TextView tvCardID;
|
||||
private NfcManager mNfcManager;
|
||||
private static final String logTag = "Purge";
|
||||
|
|
@ -42,7 +42,7 @@ public class PurgeActivity extends AppCompatActivity implements NfcAdapter.Reade
|
|||
|
||||
MainActivity.commonInit(getApplicationContext());
|
||||
|
||||
mCard = new Tangem_Card(getIntent().getStringExtra("UID"));
|
||||
mCard = new TangemCard(getIntent().getStringExtra("UID"));
|
||||
mCard.LoadFromBundle(getIntent().getExtras().getBundle("Card"));
|
||||
|
||||
tvCardID = (TextView) findViewById(R.id.tvCardID);
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.tangem.domain.cardReader.NfcManager;
|
||||
import com.tangem.wallet.FingerprintHelper;
|
||||
import com.tangem.wallet.PINStorage;
|
||||
import com.tangem.domain.wallet.FingerprintHelper;
|
||||
import com.tangem.domain.wallet.PINStorage;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.KeyStore;
|
||||
|
|
@ -149,10 +149,10 @@ public class RequestPINActivity extends AppCompatActivity implements NfcAdapter.
|
|||
tvPrompt.setText("Confirm new PIN2");
|
||||
} else if (mode == Mode.RequestPIN2) {
|
||||
String UID = getIntent().getStringExtra("UID");
|
||||
Tangem_Card mCard = new Tangem_Card(UID);
|
||||
TangemCard mCard = new TangemCard(UID);
|
||||
mCard.LoadFromBundle(getIntent().getBundleExtra("Card"));
|
||||
|
||||
if (mCard.PIN2 == Tangem_Card.PIN2_Mode.DefaultPIN2 || mCard.PIN2 == Tangem_Card.PIN2_Mode.Unchecked) {
|
||||
if (mCard.PIN2 == TangemCard.PIN2_Mode.DefaultPIN2 || mCard.PIN2 == TangemCard.PIN2_Mode.Unchecked) {
|
||||
// if we know PIN2 or not try default previously - use it
|
||||
PINStorage.setPIN2(PINStorage.getDefaultPIN2());
|
||||
setResult(Activity.RESULT_OK);
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import android.widget.CheckBox;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.tangem.wallet.FingerprintHelper;
|
||||
import com.tangem.wallet.PINStorage;
|
||||
import com.tangem.domain.wallet.FingerprintHelper;
|
||||
import com.tangem.domain.wallet.PINStorage;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
|
|||
|
|
@ -8,17 +8,17 @@ import android.view.KeyEvent;
|
|||
import android.widget.ProgressBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.tangem.wallet.Blockchain;
|
||||
import com.tangem.wallet.CoinEngine;
|
||||
import com.tangem.wallet.CoinEngineFactory;
|
||||
import com.tangem.data.network.request.Electrum_Request;
|
||||
import com.tangem.data.network.task.Electrum_Task;
|
||||
import com.tangem.wallet.Infura_Request;
|
||||
import com.tangem.data.network.task.Infura_Task;
|
||||
import com.tangem.wallet.LastSignStorage;
|
||||
import com.tangem.domain.wallet.Blockchain;
|
||||
import com.tangem.domain.wallet.CoinEngine;
|
||||
import com.tangem.domain.wallet.CoinEngineFactory;
|
||||
import com.tangem.data.network.request.ElectrumRequest;
|
||||
import com.tangem.data.network.task.ElectrumTask;
|
||||
import com.tangem.domain.wallet.Infura_Request;
|
||||
import com.tangem.data.network.task.InfuraTask;
|
||||
import com.tangem.domain.wallet.LastSignStorage;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.SharedData;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
import com.tangem.domain.wallet.SharedData;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
|
@ -29,7 +29,7 @@ import java.util.List;
|
|||
public class SendTransactionActivity extends AppCompatActivity {
|
||||
|
||||
ProgressBar progressBar;
|
||||
private Tangem_Card mCard;
|
||||
private TangemCard mCard;
|
||||
private String tx;
|
||||
|
||||
@Override
|
||||
|
|
@ -42,7 +42,7 @@ public class SendTransactionActivity extends AppCompatActivity {
|
|||
progressBar = findViewById(R.id.progressBar);
|
||||
|
||||
Intent intent = getIntent();
|
||||
mCard = new Tangem_Card(getIntent().getStringExtra("UID"));
|
||||
mCard = new TangemCard(getIntent().getStringExtra("UID"));
|
||||
mCard.LoadFromBundle(intent.getExtras().getBundle("Card"));
|
||||
tx = intent.getStringExtra("TX");
|
||||
|
||||
|
|
@ -57,13 +57,13 @@ public class SendTransactionActivity extends AppCompatActivity {
|
|||
String nodeAddress = engine.GetNode(mCard);
|
||||
int nodePort = engine.GetNodePort(mCard);
|
||||
ConnectTask connectTask = new ConnectTask(nodeAddress, nodePort);
|
||||
connectTask.execute(Electrum_Request.Broadcast(mCard.getWallet(), tx));
|
||||
connectTask.execute(ElectrumRequest.Broadcast(mCard.getWallet(), tx));
|
||||
}
|
||||
else if (mCard.getBlockchain() == Blockchain.BitcoinCash || mCard.getBlockchain() == Blockchain.BitcoinCashTestNet ) {
|
||||
String nodeAddress = engine.GetNode(mCard);
|
||||
int nodePort = engine.GetNodePort(mCard);
|
||||
ConnectTask connectTask = new ConnectTask(nodeAddress, nodePort);
|
||||
connectTask.execute(Electrum_Request.Broadcast(mCard.getWallet(), tx));
|
||||
connectTask.execute(ElectrumRequest.Broadcast(mCard.getWallet(), tx));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ public class SendTransactionActivity extends AppCompatActivity {
|
|||
finish();
|
||||
}
|
||||
|
||||
private class ETHRequestTask extends Infura_Task {
|
||||
private class ETHRequestTask extends InfuraTask {
|
||||
ETHRequestTask(Blockchain blockchain){
|
||||
super(blockchain);
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ public class SendTransactionActivity extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
private class ConnectTask extends Electrum_Task {
|
||||
private class ConnectTask extends ElectrumTask {
|
||||
public ConnectTask(String host, int port) {
|
||||
super(host, port);
|
||||
}
|
||||
|
|
@ -167,14 +167,14 @@ public class SendTransactionActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(List<Electrum_Request> requests) {
|
||||
protected void onPostExecute(List<ElectrumRequest> requests) {
|
||||
super.onPostExecute(requests);
|
||||
CoinEngine engine = CoinEngineFactory.Create(Blockchain.Bitcoin);
|
||||
|
||||
for (Electrum_Request request : requests) {
|
||||
for (ElectrumRequest request : requests) {
|
||||
try {
|
||||
if (request.error == null) {
|
||||
if (request.isMethod(Electrum_Request.METHOD_SendTransaction)) {
|
||||
if (request.isMethod(ElectrumRequest.METHOD_SendTransaction)) {
|
||||
try {
|
||||
String hashTX = request.getResultString();
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -17,17 +17,17 @@ import android.widget.Toast;
|
|||
|
||||
import com.tangem.domain.cardReader.CardProtocol;
|
||||
import com.tangem.domain.cardReader.NfcManager;
|
||||
import com.tangem.domain.cardReader.Util;
|
||||
import com.tangem.domain.wallet.TangemCard;
|
||||
import com.tangem.util.Util;
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog;
|
||||
import com.tangem.wallet.PINStorage;
|
||||
import com.tangem.domain.wallet.PINStorage;
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.wallet.Tangem_Card;
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog;
|
||||
|
||||
public class SwapPINActivity extends AppCompatActivity implements NfcAdapter.ReaderCallback, CardProtocol.Notifications {
|
||||
|
||||
public static final int RESULT_INVALID_PIN = Activity.RESULT_FIRST_USER;
|
||||
private Tangem_Card mCard;
|
||||
private TangemCard mCard;
|
||||
private NfcManager mNfcManager;
|
||||
private static final String logTag = "SwapPIN";
|
||||
private ProgressBar progressBar;
|
||||
|
|
@ -42,7 +42,7 @@ public class SwapPINActivity extends AppCompatActivity implements NfcAdapter.Rea
|
|||
|
||||
MainActivity.commonInit(getApplicationContext());
|
||||
|
||||
mCard = new Tangem_Card(getIntent().getStringExtra("UID"));
|
||||
mCard = new TangemCard(getIntent().getStringExtra("UID"));
|
||||
mCard.LoadFromBundle(getIntent().getExtras().getBundle("Card"));
|
||||
|
||||
newPIN = getIntent().getStringExtra("newPIN");
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import android.os.Bundle;
|
|||
import android.support.v7.app.AppCompatActivity;
|
||||
|
||||
import com.tangem.wallet.R;
|
||||
import com.tangem.presentation.fragment.VerifyCardActivityFragment;
|
||||
import com.tangem.presentation.fragment.VerifyCardFragment;
|
||||
|
||||
public class VerifyCardActivity extends AppCompatActivity {
|
||||
|
||||
|
|
@ -21,8 +21,8 @@ public class VerifyCardActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
VerifyCardActivityFragment verifyCardActivityFragment = (VerifyCardActivityFragment) getSupportFragmentManager().findFragmentById(R.id.verify_card_fragment);
|
||||
Intent data = verifyCardActivityFragment.prepareResultIntent();
|
||||
VerifyCardFragment verifyCardFragment = (VerifyCardFragment) getSupportFragmentManager().findFragmentById(R.id.verify_card_fragment);
|
||||
Intent data = verifyCardFragment.prepareResultIntent();
|
||||
data.putExtra("modification", "update");
|
||||
setResult(Activity.RESULT_OK, data);
|
||||
finish();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue