Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanpierrefortune committed Dec 4, 2023
1 parent 31010fd commit 93ff736
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CardRepository {
calypsoCardApiFactory.createFreeTransactionManager(cardReader, calypsoCard)
}

if (isSecureSessionMode && cardTransaction is SecureRegularModeTransactionManager) {
if (cardTransaction is SecureRegularModeTransactionManager) {
// Open a transaction to read/write the Calypso Card and read the Environment file
cardTransaction.prepareOpenSecureSession(WriteAccessLevel.DEBIT)
}
Expand All @@ -90,7 +90,7 @@ class CardRepository {
// the current version) reject the card.
// <Abort Secure Session if any>
if (env.envVersionNumber != VersionNumber.CURRENT_VERSION) {
if (isSecureSessionMode && cardTransaction is SecureRegularModeTransactionManager) {
if (cardTransaction is SecureRegularModeTransactionManager) {
cardTransaction.prepareCancelSecureSession().processCommands(ChannelControl.CLOSE_AFTER)
}
throw EnvironmentException("wrong version number")
Expand All @@ -99,7 +99,7 @@ class CardRepository {
// Step 4 - If EnvEndDate points to a date in the past reject the card.
// <Abort Secure Session if any>
if (env.envEndDate.getDate().isBefore(controlDateTime.toLocalDate())) {
if (isSecureSessionMode && cardTransaction is SecureRegularModeTransactionManager) {
if (cardTransaction is SecureRegularModeTransactionManager) {
cardTransaction.prepareCancelSecureSession().processCommands(ChannelControl.CLOSE_AFTER)
}
throw EnvironmentException("End date expired")
Expand All @@ -118,7 +118,7 @@ class CardRepository {
// <Abort Secure Session if any>
val eventVersionNumber = event.eventVersionNumber
if (eventVersionNumber != VersionNumber.CURRENT_VERSION) {
if (isSecureSessionMode && cardTransaction is SecureRegularModeTransactionManager) {
if (cardTransaction is SecureRegularModeTransactionManager) {
cardTransaction.prepareCancelSecureSession().processCommands(ChannelControl.CLOSE_AFTER)
}
if (eventVersionNumber == VersionNumber.UNDEFINED) {
Expand Down Expand Up @@ -213,7 +213,7 @@ class CardRepository {
// of the value
// by using the PSO Verify Signature command of the SAM.
@Suppress("ControlFlowWithEmptyBody")
if (isSecureSessionMode && contract.contractAuthenticator != 0) {
if (contract.contractAuthenticator != 0) {
// Step 15.1 - If the value is wrong reject the card.
// <Abort Secure Session if any>
// Step 15.2 - If the value of ContractSaleSam is present in the SAM Black List reject
Expand Down Expand Up @@ -263,7 +263,7 @@ class CardRepository {
status = Status.TICKETS_FOUND

// Step 20 - If isSecureSessionMode is true, Close the session
if (isSecureSessionMode && cardTransaction is SecureRegularModeTransactionManager) {
if (cardTransaction is SecureRegularModeTransactionManager) {
cardTransaction.prepareCloseSecureSession().processCommands(ChannelControl.CLOSE_AFTER)
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 2023.06.01
version = 2023.12.04
archivesBaseName = keyple-android-demo-control

# Project-wide Gradle settings.
Expand Down

0 comments on commit 93ff736

Please sign in to comment.