Updated on 2026-08-14
This commit is contained in:
parent
aee042f9a2
commit
3d40a77def
5 changed files with 15 additions and 40 deletions
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
25
.idea/misc.xml
generated
25
.idea/misc.xml
generated
|
|
@ -1,30 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="5">
|
||||
<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" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="4">
|
||||
<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" />
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
package com.tangem.domain.wallet;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.Pair;
|
||||
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class BalanceValidator {
|
||||
private String firstLine;
|
||||
private String secondLine;
|
||||
|
|
@ -34,7 +28,7 @@ public class BalanceValidator {
|
|||
|
||||
public void Check(TangemCard card)
|
||||
{
|
||||
firstLine = "";
|
||||
firstLine = "Verification failed";
|
||||
secondLine = "";
|
||||
|
||||
// rule 1
|
||||
|
|
@ -54,7 +48,7 @@ public class BalanceValidator {
|
|||
|
||||
|
||||
// rule 2.c
|
||||
if(!CheckAttestationServiceResult(card)) {
|
||||
if(!CheckAttestationServiceResult(card) && CheckAttestationServiceAvailable(card)) {
|
||||
score = 0;
|
||||
firstLine = "Not genuine banknote";
|
||||
secondLine = "Tangem Attestation service says the banknote is not genuine.";
|
||||
|
|
@ -75,7 +69,7 @@ public class BalanceValidator {
|
|||
|
||||
if(card.getFailedBalanceRequestCounter()!=0) {
|
||||
score -= 5 * card.getFailedBalanceRequestCounter();
|
||||
secondLine += "Not all nodes have returned balance. Swipe down to refresh. ";
|
||||
secondLine += "Not all nodes have returned balance. Swipe down or tap again. ";
|
||||
if(score <= 0)
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
|
|||
private Timer timerHideErrorAndMessage = null;
|
||||
private String newPIN = "", newPIN2 = "";
|
||||
private CardProtocol mCardProtocol;
|
||||
private int scanTimes = 0;
|
||||
// private int scanTimes = 0;
|
||||
OnlineVerifyTask onlineVerifyTask;
|
||||
|
||||
public LoadedWallet() {
|
||||
|
|
@ -258,7 +258,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
|
|||
if (mCardProtocol != null)
|
||||
openVerifyCard(mCardProtocol);
|
||||
else {
|
||||
scanTimes++;
|
||||
// scanTimes++;
|
||||
Toast.makeText(getContext(), R.string.need_attach_card_again, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
});
|
||||
|
|
@ -512,8 +512,13 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
|
|||
|
||||
CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
|
||||
if ( (mCard.isOnlineVerified()==null || !mCard.isOnlineVerified()) && onlineVerifyTask ==null) {
|
||||
onlineVerifyTask = new OnlineVerifyTask();
|
||||
// updateTasks.add(onlineVerifyTask);
|
||||
onlineVerifyTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, VerificationServerProtocol.Verify.prepare(mCard));
|
||||
}
|
||||
|
||||
if (mCard.getBlockchain() == Blockchain.Bitcoin || mCard.getBlockchain() == Blockchain.BitcoinTestNet) {
|
||||
mCard.resetFailedBalanceRequestCounter();
|
||||
SharedData data = new SharedData(SharedData.COUNT_REQUEST);
|
||||
mCard.resetFailedBalanceRequestCounter();
|
||||
mCard.setIsBalanceEqual(true);
|
||||
|
|
@ -638,11 +643,12 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
|
|||
mCardProtocol = cardProtocol;
|
||||
|
||||
// Log.i(TAG, "scanTimes " + scanTimes);
|
||||
if (scanTimes > 0)
|
||||
openVerifyCard(mCardProtocol);
|
||||
// if (scanTimes > 0)
|
||||
// openVerifyCard(mCardProtocol);
|
||||
|
||||
scanTimes++;
|
||||
// scanTimes++;
|
||||
|
||||
onRefresh();
|
||||
|
||||
//addCard(cardProtocol.getCard());
|
||||
});
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 96 KiB |
Loading…
Add table
Add a link
Reference in a new issue