Updated on 2026-08-14
This commit is contained in:
parent
7c4cc8fcde
commit
85f9a17bb0
245 changed files with 401 additions and 18 deletions
|
|
@ -0,0 +1,39 @@
|
|||
package com.tangem.tangemcommon.tasks;
|
||||
|
||||
import com.tangem.tangemcommon.data.external.CardDataSubstitutionProvider;
|
||||
import com.tangem.tangemcommon.data.external.PINsProvider;
|
||||
import com.tangem.tangemcommon.reader.CardProtocol;
|
||||
import com.tangem.tangemcommon.data.TangemCard;
|
||||
import com.tangem.tangemcommon.reader.NfcReader;
|
||||
|
||||
public class SwapPINTask extends CustomReadCardTask {
|
||||
public static final String TAG = SwapPINTask.class.getSimpleName();
|
||||
|
||||
private String newPIN, newPIN2;
|
||||
|
||||
public SwapPINTask(TangemCard card, NfcReader reader, CardDataSubstitutionProvider cardDataSubstitutionProvider, PINsProvider pinsProvider, CardProtocol.Notifications notifications, String newPIN, String newPIN2) {
|
||||
super(card, reader, cardDataSubstitutionProvider, pinsProvider, notifications);
|
||||
this.newPIN = newPIN;
|
||||
this.newPIN2 = newPIN2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run_Task() throws Exception {
|
||||
|
||||
if (mCard.getPauseBeforePIN2() > 0) {
|
||||
mNotifications.onReadWait(mCard.getPauseBeforePIN2());
|
||||
}
|
||||
|
||||
protocol.run_SetPIN(pinsProvider.getPIN2(), newPIN, newPIN2, false);
|
||||
protocol.setPIN(newPIN);
|
||||
mCard.setPIN(newPIN);
|
||||
|
||||
mNotifications.onReadProgress(protocol, 50);
|
||||
|
||||
protocol.run_Read();
|
||||
|
||||
mNotifications.onReadProgress(protocol, 100);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue