Updated on 2026-08-14
This commit is contained in:
parent
7d26bd34d3
commit
9c6d9bc6f9
19 changed files with 64 additions and 102 deletions
|
|
@ -6,8 +6,7 @@ object Constant {
|
|||
|
||||
const val EXTRA_BLOCKCHAIN_DATA = "BLOCKCHAIN_DATA"
|
||||
|
||||
const val MESSAGE = "Message"
|
||||
const val ERROR = "Error"
|
||||
const val EXTRA_MESSAGE = "message"
|
||||
|
||||
const val EXTRA_MODIFICATION = "modification"
|
||||
const val EXTRA_MODIFICATION_DELETE = "delete"
|
||||
|
|
@ -42,6 +41,9 @@ object Constant {
|
|||
const val KEY_ALIAS = "pinKey"
|
||||
const val KEYSTORE = "AndroidKeyStore"
|
||||
|
||||
// QrScanActivity
|
||||
const val EXTRA_QR_CODE = "QRCode"
|
||||
|
||||
// PinSwapActivity
|
||||
const val EXTRA_CONFIRM_PIN = "confirmPIN"
|
||||
const val EXTRA_CONFIRM_PIN_2 = "confirmPIN2"
|
||||
|
|
@ -59,6 +61,9 @@ object Constant {
|
|||
const val REQUEST_CODE_SIGN_PAYMENT = 1
|
||||
const val REQUEST_CODE_REQUEST_PIN2_ = 2
|
||||
|
||||
// SendTransactionActivity
|
||||
const val EXTRA_TX: String = "TX"
|
||||
|
||||
// SignPaymentActivity
|
||||
const val EXTRA_AMOUNT = "Amount"
|
||||
const val EXTRA_AMOUNT_CURRENCY = "AmountCurrency"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import com.tangem.presentation.event.TransactionFinishWithError
|
|||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.tangemcard.data.TangemCard
|
||||
import com.tangem.tangemcard.data.loadFromBundle
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.util.UtilHelper
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_confirm_payment.*
|
||||
|
|
|
|||
|
|
@ -16,17 +16,18 @@ import android.widget.Toast
|
|||
import com.tangem.App
|
||||
import com.tangem.Constant
|
||||
import com.tangem.di.Navigator
|
||||
import com.tangem.tangemcard.tasks.VerifyCardTask
|
||||
import com.tangem.tangemcard.reader.CardProtocol
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.tangemcard.data.TangemCard
|
||||
import com.tangem.domain.wallet.TangemContext
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.tangemcard.android.reader.NfcReader
|
||||
import com.tangem.tangemcard.data.TangemCard
|
||||
import com.tangem.tangemcard.data.asBundle
|
||||
import com.tangem.tangemcard.data.loadFromBundle
|
||||
import com.tangem.tangemcard.reader.CardProtocol
|
||||
import com.tangem.tangemcard.tasks.VerifyCardTask
|
||||
import com.tangem.tangemcard.util.Util
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_empty_wallet.*
|
||||
import javax.inject.Inject
|
||||
|
|
@ -34,6 +35,8 @@ import javax.inject.Inject
|
|||
class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtocol.Notifications {
|
||||
|
||||
companion object {
|
||||
val TAG: String = EmptyWalletActivity::class.java.simpleName
|
||||
|
||||
fun callingIntent(context: Context, ctx: TangemContext): Intent {
|
||||
val intent = Intent(context, EmptyWalletActivity::class.java)
|
||||
ctx.saveToIntent(intent)
|
||||
|
|
@ -61,7 +64,7 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
ctx = TangemContext.loadFromBundle(this, intent.extras)
|
||||
|
||||
tvIssuer.text = ctx.card!!.issuerDescription
|
||||
//tvBlockchain.text = ctx.card!!.blockchainName
|
||||
|
||||
if (ctx.card!!.tokenSymbol.length > 1) {
|
||||
val html = Html.fromHtml(ctx.blockchainName)
|
||||
tvBlockchain.text = html
|
||||
|
|
@ -154,7 +157,6 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
finish()
|
||||
} else if (requestCode == Constant.REQUEST_CODE_REQUEST_PIN2) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
// doCreateNewWallet()
|
||||
navigator.showCreateNewWallet(this, ctx)
|
||||
}
|
||||
}
|
||||
|
|
@ -167,11 +169,11 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
val uid = tag.id
|
||||
val sUID = Util.byteArrayToHexString(uid)
|
||||
if (ctx.card!!.uid != sUID) {
|
||||
// Log.d(TAG, "Invalid UID: " + sUID);
|
||||
LOG.d(TAG, "Invalid UID: $sUID")
|
||||
nfcManager.ignoreTag(isoDep.tag)
|
||||
return
|
||||
} else {
|
||||
// Log.v(TAG, "UID: " + sUID);
|
||||
LOG.d(TAG, "UID: $sUID")
|
||||
}
|
||||
|
||||
if (lastReadSuccess) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import javax.inject.Inject
|
|||
class LogoActivity : AppCompatActivity() {
|
||||
|
||||
companion object {
|
||||
val TAG: String = LogoActivity::class.java.simpleName
|
||||
|
||||
fun callingIntent(context: Context, autoHide: Boolean): Intent {
|
||||
val intent = Intent(context, LogoActivity::class.java)
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ import com.tangem.tangemcard.data.TangemCard
|
|||
import com.tangem.tangemcard.data.loadFromBundle
|
||||
import com.tangem.tangemcard.data.saveToBundle
|
||||
import com.tangem.util.CommonUtil
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.util.PhoneUtility
|
||||
import com.tangem.wallet.BuildConfig
|
||||
import com.tangem.wallet.R
|
||||
|
|
@ -205,10 +206,10 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
try {
|
||||
f = Logger.collectLogs(this)
|
||||
if (f != null) {
|
||||
// Log.e(TAG, String.format("Collect %d log bytes", f.length()));
|
||||
LOG.e(TAG, String.format("Collect %d log bytes", f.length()))
|
||||
CommonUtil.sendEmail(this, zipFile, TAG, "Logs", PhoneUtility.getDeviceInfo(), arrayOf(f))
|
||||
} else {
|
||||
// Log.e(TAG, "Can't create temporaly log file");
|
||||
LOG.e(TAG, "Can't create temporarily log file")
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
|
@ -242,7 +243,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
val isoDep = IsoDep.get(tag)
|
||||
?: throw CardProtocol.TangemException(getString(R.string.wrong_tag_err))
|
||||
|
||||
// Log.e(TAG, "setTimeout(" + String.valueOf(1000 + 3000 * unsuccessReadCount) + ")");
|
||||
LOG.e(TAG, "setTimeout(" + (1000 + 3000 * unsuccessReadCount) + ")")
|
||||
if (unsuccessReadCount < 2) {
|
||||
isoDep.timeout = 2000 + 5000 * unsuccessReadCount
|
||||
} else {
|
||||
|
|
@ -253,7 +254,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
readCardInfoTask = ReadCardInfoTask(NfcReader(nfcManager, isoDep), App.localStorage, App.pinStorage, this)
|
||||
readCardInfoTask!!.start()
|
||||
|
||||
// Log.i(TAG, "onTagDiscovered " + Arrays.toString(tag.getId()));
|
||||
LOG.i(TAG, "onTagDiscovered " + Arrays.toString(tag.id))
|
||||
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
|
@ -297,7 +298,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
rlProgressBar.post {
|
||||
rlProgressBar.visibility = View.GONE
|
||||
|
||||
// // TODO - ??? remove save and load???
|
||||
// TODO - ??? remove save and load???
|
||||
val cardInfo = Bundle()
|
||||
cardInfo.putString("UID", cardProtocol.card.uid)
|
||||
val bCard = Bundle()
|
||||
|
|
|
|||
|
|
@ -68,8 +68,6 @@ class PinSaveActivity : AppCompatActivity(), FingerprintHelper.FingerprintHelper
|
|||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_pin_save)
|
||||
|
||||
// MainActivity.commonInit(applicationContext)
|
||||
|
||||
usePIN2 = intent.getBooleanExtra(Constant.EXTRA_PIN2, false)
|
||||
|
||||
if (usePIN2)
|
||||
|
|
@ -229,14 +227,14 @@ class PinSaveActivity : AppCompatActivity(), FingerprintHelper.FingerprintHelper
|
|||
fun initCipher(mode: Int): Boolean {
|
||||
try {
|
||||
keyStore!!.load(null)
|
||||
val keyspec = keyStore!!.getKey(Constant.KEY_ALIAS, null) as SecretKey
|
||||
val keySpec = keyStore!!.getKey(Constant.KEY_ALIAS, null) as SecretKey
|
||||
|
||||
if (mode == Cipher.ENCRYPT_MODE) {
|
||||
cipher!!.init(mode, keyspec)
|
||||
cipher!!.init(mode, keySpec)
|
||||
} else {
|
||||
val iv = PINStorage.loadEncryptedIV()
|
||||
val ivspec = IvParameterSpec(iv)
|
||||
cipher!!.init(mode, keyspec, ivspec)
|
||||
val ivSpec = IvParameterSpec(iv)
|
||||
cipher!!.init(mode, keySpec, ivSpec)
|
||||
}
|
||||
|
||||
return true
|
||||
|
|
@ -314,7 +312,6 @@ class PinSaveActivity : AppCompatActivity(), FingerprintHelper.FingerprintHelper
|
|||
}
|
||||
|
||||
// show a progress spinner, and kick off a background task to perform the user login attempt
|
||||
//showProgress(true);
|
||||
confirmWithFingerprintTask = ConfirmWithFingerprintTask(this@PinSaveActivity)
|
||||
confirmWithFingerprintTask!!.execute(null as Void?)
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -15,14 +15,15 @@ import android.widget.ProgressBar
|
|||
import android.widget.Toast
|
||||
import com.tangem.App
|
||||
import com.tangem.Constant
|
||||
import com.tangem.tangemcard.tasks.SwapPINTask
|
||||
import com.tangem.tangemcard.reader.CardProtocol
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.tangemcard.android.reader.NfcReader
|
||||
import com.tangem.tangemcard.data.*
|
||||
import com.tangem.tangemcard.reader.CardProtocol
|
||||
import com.tangem.tangemcard.tasks.SwapPINTask
|
||||
import com.tangem.tangemcard.util.Util
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_pin_swap.*
|
||||
|
||||
|
|
@ -55,8 +56,6 @@ class PinSwapActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProt
|
|||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_pin_swap)
|
||||
|
||||
// MainActivity.commonInit(applicationContext)
|
||||
|
||||
nfcManager = NfcManager(this, this)
|
||||
|
||||
card = TangemCard(intent.getStringExtra(EXTRA_TANGEM_CARD_UID))
|
||||
|
|
@ -79,17 +78,16 @@ class PinSwapActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProt
|
|||
?: throw CardProtocol.TangemException(getString(R.string.wrong_tag_err))
|
||||
val uid = tag.id
|
||||
val sUID = Util.byteArrayToHexString(uid)
|
||||
// Log.v(TAG, "UID: $sUID")
|
||||
LOG.d(TAG, "UID: $sUID")
|
||||
|
||||
if (sUID == card!!.uid) {
|
||||
isoDep.timeout = card!!.pauseBeforePIN2 + 65000
|
||||
swapPinTask = SwapPINTask(card, NfcReader(nfcManager, isoDep), App.localStorage, App.pinStorage, this, newPIN, newPIN2)
|
||||
swapPinTask!!.start()
|
||||
} else {
|
||||
// Log.d(TAG, "Mismatch card UID (" + sUID + " instead of " + mCard!!.uid + ")")
|
||||
nfcManager!!.ignoreTag(isoDep.tag)
|
||||
LOG.d(TAG, "Mismatch card UID (" + sUID + " instead of " + card!!.uid + ")")
|
||||
nfcManager.ignoreTag(isoDep.tag)
|
||||
}
|
||||
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
|
@ -97,11 +95,11 @@ class PinSwapActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProt
|
|||
|
||||
public override fun onResume() {
|
||||
super.onResume()
|
||||
nfcManager!!.onResume()
|
||||
nfcManager.onResume()
|
||||
}
|
||||
|
||||
public override fun onPause() {
|
||||
nfcManager!!.onPause()
|
||||
nfcManager.onPause()
|
||||
if (swapPinTask != null)
|
||||
swapPinTask!!.cancel(true)
|
||||
super.onPause()
|
||||
|
|
@ -109,7 +107,7 @@ class PinSwapActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProt
|
|||
|
||||
public override fun onStop() {
|
||||
// dismiss enable NFC dialog
|
||||
nfcManager!!.onStop()
|
||||
nfcManager.onStop()
|
||||
if (swapPinTask != null)
|
||||
swapPinTask!!.cancel(true)
|
||||
super.onStop()
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ import android.support.v7.app.AppCompatActivity
|
|||
import android.view.View
|
||||
import com.tangem.App
|
||||
import com.tangem.Constant
|
||||
import com.tangem.data.Blockchain
|
||||
import com.tangem.data.network.CryptonitOtherApi
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.di.Navigator
|
||||
import com.tangem.domain.wallet.CoinEngineFactory
|
||||
import com.tangem.domain.wallet.TangemContext
|
||||
import com.tangem.data.Blockchain
|
||||
import com.tangem.di.Navigator
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_prepare_cryptonit_other_api_withdrawal.*
|
||||
import java.io.IOException
|
||||
|
|
@ -26,10 +26,6 @@ class PrepareCryptonitOtherApiWithdrawalActivity : AppCompatActivity(), NfcAdapt
|
|||
|
||||
companion object {
|
||||
val TAG: String = PrepareCryptonitOtherApiWithdrawalActivity::class.java.simpleName
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private lateinit var ctx: TangemContext
|
||||
|
|
@ -67,7 +63,6 @@ class PrepareCryptonitOtherApiWithdrawalActivity : AppCompatActivity(), NfcAdapt
|
|||
|
||||
// set listeners
|
||||
btnLoad.setOnClickListener {
|
||||
|
||||
try {
|
||||
val strAmount: String = etAmount.text.toString().replace(",", ".")
|
||||
// if (!engine.checkAmount(card, strAmount))
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import com.tangem.wallet.R
|
|||
import kotlinx.android.synthetic.main.activity_prepare_cryptonit_withdrawal.*
|
||||
import java.io.IOException
|
||||
|
||||
|
||||
class PrepareCryptonitWithdrawalActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
||||
|
||||
companion object {
|
||||
|
|
@ -39,8 +38,6 @@ class PrepareCryptonitWithdrawalActivity : AppCompatActivity(), NfcAdapter.Reade
|
|||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_prepare_cryptonit_withdrawal)
|
||||
|
||||
// MainActivity.commonInit(applicationContext)
|
||||
|
||||
nfcManager = NfcManager(this, this)
|
||||
|
||||
ctx = TangemContext.loadFromBundle(this, intent.extras)
|
||||
|
|
@ -89,11 +86,10 @@ class PrepareCryptonitWithdrawalActivity : AppCompatActivity(), NfcAdapter.Reade
|
|||
|
||||
// set listeners
|
||||
btnLoad.setOnClickListener {
|
||||
|
||||
try {
|
||||
val strAmount: String = etAmount.text.toString().replace(",", ".")
|
||||
val strFee: String = etFee.text.toString().replace(",", ".")
|
||||
var dblAmount: Double = strAmount.toDouble()
|
||||
val dblAmount: Double = strAmount.toDouble()
|
||||
var dblFee: Double = strFee.toDouble()
|
||||
cryptonit!!.fee = strFee
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import com.tangem.di.Navigator
|
|||
import com.tangem.domain.wallet.CoinEngineFactory
|
||||
import com.tangem.domain.wallet.TangemContext
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_prepare_payment.*
|
||||
import java.io.IOException
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.tangem.presentation.dialog.WaitSecurityDelayDialog
|
|||
import com.tangem.tangemcard.android.reader.NfcReader
|
||||
import com.tangem.tangemcard.data.asBundle
|
||||
import com.tangem.tangemcard.util.Util
|
||||
import com.tangem.util.LOG
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.activity_purge.*
|
||||
|
||||
|
|
@ -82,14 +83,14 @@ class PurgeActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoc
|
|||
val isoDep = IsoDep.get(tag) ?: throw CardProtocol.TangemException(getString(R.string.wrong_tag_err))
|
||||
val uid = tag.id
|
||||
val sUID = Util.byteArrayToHexString(uid)
|
||||
// Log.v(TAG, "UID: $sUID")
|
||||
LOG.d(TAG, "UID: $sUID")
|
||||
|
||||
if (sUID == ctx.card!!.uid) {
|
||||
isoDep.timeout = ctx.card!!.pauseBeforePIN2 + 65000
|
||||
purgeTask = PurgeTask(ctx.card, NfcReader(nfcManager, isoDep), App.localStorage, App.pinStorage, this)
|
||||
purgeTask!!.start()
|
||||
} else {
|
||||
// this Log.d(TAG, "Mismatch card UID (" + sUID + " instead of " + card.getUID() + ")");
|
||||
LOG.d(TAG, "Mismatch card UID (" + sUID + " instead of " + ctx.card.uid + ")")
|
||||
nfcManager.ignoreTag(isoDep.tag)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import android.os.Bundle
|
|||
import android.support.v4.app.ActivityCompat
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import com.google.zxing.Result
|
||||
import com.tangem.Constant
|
||||
import me.dm7.barcodescanner.zxing.ZXingScannerView
|
||||
|
||||
class QrScanActivity : AppCompatActivity(), ZXingScannerView.ResultHandler {
|
||||
|
|
@ -54,7 +55,7 @@ class QrScanActivity : AppCompatActivity(), ZXingScannerView.ResultHandler {
|
|||
|
||||
override fun handleResult(result: Result) {
|
||||
val data = Intent()
|
||||
data.putExtra("QRCode", result.text)
|
||||
data.putExtra(Constant.EXTRA_QR_CODE, result.text)
|
||||
setResult(Activity.RESULT_OK, data)
|
||||
finish()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,13 @@ import android.os.Bundle
|
|||
import android.support.v7.app.AppCompatActivity
|
||||
import android.view.KeyEvent
|
||||
import android.widget.Toast
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.domain.wallet.*
|
||||
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.reader.NfcManager
|
||||
import com.tangem.util.UtilHelper
|
||||
import com.tangem.wallet.R
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
|
|
@ -18,10 +21,6 @@ import java.io.IOException
|
|||
|
||||
class SendTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
||||
|
||||
companion object {
|
||||
const val EXTRA_TX: String = "TX"
|
||||
}
|
||||
|
||||
private lateinit var ctx: TangemContext
|
||||
private var tx: ByteArray? = null
|
||||
private lateinit var nfcManager: NfcManager
|
||||
|
|
@ -33,7 +32,7 @@ class SendTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
nfcManager = NfcManager(this, this)
|
||||
|
||||
ctx = TangemContext.loadFromBundle(this, intent.extras)
|
||||
tx = intent.getByteArrayExtra(EXTRA_TX)
|
||||
tx = intent.getByteArrayExtra(Constant.EXTRA_TX)
|
||||
|
||||
val engine = CoinEngineFactory.create(ctx)
|
||||
|
||||
|
|
@ -55,7 +54,6 @@ class SendTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
},
|
||||
tx
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
|
||||
|
|
@ -97,7 +95,7 @@ class SendTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
EventBus.getDefault().post(transactionFinishWithSuccess)
|
||||
|
||||
val intent = Intent()
|
||||
intent.putExtra("message", getString(R.string.transaction_has_been_successfully_signed))
|
||||
intent.putExtra(Constant.EXTRA_MESSAGE, getString(R.string.transaction_has_been_successfully_signed))
|
||||
setResult(RESULT_OK, intent)
|
||||
finish()
|
||||
}
|
||||
|
|
@ -108,7 +106,7 @@ class SendTransactionActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
|
|||
EventBus.getDefault().post(transactionFinishWithError)
|
||||
|
||||
val intent = Intent()
|
||||
intent.putExtra("message", String.format(getString(R.string.try_again_failed_to_send_transaction), message))
|
||||
intent.putExtra(Constant.EXTRA_MESSAGE, String.format(getString(R.string.try_again_failed_to_send_transaction), message))
|
||||
setResult(RESULT_CANCELED, intent)
|
||||
finish()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class SignPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
if (tx != null) {
|
||||
val intent = Intent(this, SendTransactionActivity::class.java)
|
||||
ctx.saveToIntent(intent)
|
||||
intent.putExtra(SendTransactionActivity.EXTRA_TX, tx)
|
||||
intent.putExtra(Constant.EXTRA_TX, tx)
|
||||
startActivityForResult(intent, Constant.REQUEST_CODE_SEND_PAYMENT_)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class VerifyCardActivity : AppCompatActivity() {
|
|||
super.onBackPressed()
|
||||
val verifyCard = supportFragmentManager.findFragmentById(R.id.verify_card_fragment) as VerifyCard
|
||||
val data = verifyCard.prepareResultIntent()
|
||||
data.putExtra(Constant.EXTRA_MODIFICATION, "update")
|
||||
data.putExtra(Constant.EXTRA_MODIFICATION, Constant.EXTRA_MODIFICATION_UPDATE)
|
||||
finish()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,15 +11,11 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.tangem.util.UtilHelper;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* Created by dvol on 06.03.2018.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,10 @@ 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.*
|
||||
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
|
||||
|
|
@ -48,10 +51,8 @@ import com.tangem.util.LOG
|
|||
import com.tangem.util.UtilHelper
|
||||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.fr_loaded_wallet.*
|
||||
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
|
||||
import java.io.InputStream
|
||||
import java.util.*
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,6 @@ class VerifyCard : Fragment(), NfcAdapter.ReaderCallback {
|
|||
|
||||
Constant.REQUEST_CODE_PURGE -> if (resultCode == Activity.RESULT_OK) {
|
||||
if (data == null) {
|
||||
// data = Intent()
|
||||
ctx.saveToIntent(data)
|
||||
data?.putExtra(Constant.EXTRA_MODIFICATION, "delete")
|
||||
} else {
|
||||
|
|
@ -203,37 +202,11 @@ class VerifyCard : Fragment(), NfcAdapter.ReaderCallback {
|
|||
}
|
||||
updateViews()
|
||||
}
|
||||
|
||||
// TODO unused block, need check and remove it
|
||||
// Constant.REQUEST_CODE_SEND_PAYMENT -> {
|
||||
// if (resultCode == Activity.RESULT_OK) {
|
||||
// srlVerifyCard.isRefreshing = true
|
||||
// ctx.coinData!!.clearInfo()
|
||||
// //ctx.card!!.switchToInitialBlockchain()
|
||||
// updateViews()
|
||||
// }
|
||||
//
|
||||
// if (data != null) {
|
||||
// if (data.extras!!.containsKey("UID") && data.extras!!.containsKey("Card")) {
|
||||
// val updatedCard = TangemCard(data.getStringExtra("UID"))
|
||||
// updatedCard.loadFromBundle(data.getBundleExtra("Card"))
|
||||
// ctx.card = updatedCard
|
||||
// }
|
||||
// if (data.extras!!.containsKey("message")) {
|
||||
// if (resultCode == Activity.RESULT_OK)
|
||||
// ctx.message = data.getStringExtra("message")
|
||||
// else
|
||||
// ctx.error = data.getStringExtra("message")
|
||||
// }
|
||||
// updateViews()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTagDiscovered(tag: Tag) {
|
||||
try {
|
||||
// Log.w(getClass().getName(), "Ignore discovered tag!");
|
||||
nfcManager!!.ignoreTag(tag)
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue