73 lines
6.6 KiB
Swift
Executable File
73 lines
6.6 KiB
Swift
Executable File
//
|
|
// EmoneyApduCommands.swift
|
|
// Emoney Info
|
|
//
|
|
// Created by Wira Irawan on 23/07/24.
|
|
//
|
|
|
|
import Foundation
|
|
import CoreNFC
|
|
|
|
|
|
@available(iOS 13.0, *)
|
|
class EmoneyApduCommands{
|
|
static let TAPCASH_INIT_DATA : [UInt8] = [0xA0, 0x00, 0x42, 0x4e, 0x49, 0x10, 0x00, 0x01]
|
|
static let BRIZZI_INIT_DATA : [UInt8] = [0x01, 0x00, 0x00]
|
|
static let EMONEY_INIT_DATA : [UInt8] = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]
|
|
static let FLAZZ_INIT_DATA : [UInt8] = [0xA0, 0x00, 0x00, 0x00, 0x18, 0x0F, 0x00, 0x00, 0x01, 0x80, 0x01]
|
|
static let JACKCARD_INIT_DATA : [UInt8] = [0xA0, 0x00, 0x00, 0x05, 0x71, 0x4e, 0x4a, 0x43]
|
|
static let MEGA_DATA : [UInt8] = [0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00]
|
|
static let BRI_DATA_01 : [UInt8] = [0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00]
|
|
|
|
static let TAPCASH_INIT_APDU = NFCISO7816APDU(instructionClass : CommonConstants.CLA_SELECT, instructionCode : CommonConstants.INS_SELECT, p1Parameter : CommonConstants.SELECT_P1, p2Parameter : CommonConstants.SELECT_P2, data : Data(_ : TAPCASH_INIT_DATA), expectedResponseLength : CommonConstants.LE_NO_RESPONSE_DATA)
|
|
|
|
static let BRIZZI_INIT_APDU = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x5A, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_ : BRIZZI_INIT_DATA), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
|
|
static let EMONEY_INIT_APDU = NFCISO7816APDU(instructionClass : CommonConstants.CLA_SELECT, instructionCode : CommonConstants.INS_SELECT, p1Parameter : CommonConstants.SELECT_P1, p2Parameter : CommonConstants.SELECT_P2, data : Data(_ : EMONEY_INIT_DATA), expectedResponseLength : CommonConstants.LE_NO_RESPONSE_DATA)
|
|
|
|
static let FLAZZ_INIT_APDU = NFCISO7816APDU(instructionClass : CommonConstants.CLA_SELECT, instructionCode : CommonConstants.INS_SELECT, p1Parameter : CommonConstants.SELECT_P1, p2Parameter : CommonConstants.SELECT_P2, data : Data(_ : FLAZZ_INIT_DATA), expectedResponseLength : CommonConstants.LE_NO_RESPONSE_DATA)
|
|
|
|
static let JACKCARD_INIT_APDU = NFCISO7816APDU(instructionClass : CommonConstants.CLA_SELECT, instructionCode : CommonConstants.INS_SELECT, p1Parameter : CommonConstants.SELECT_P1, p2Parameter : CommonConstants.SELECT_P2, data : Data(_ : JACKCARD_INIT_DATA), expectedResponseLength : CommonConstants.LE_NO_RESPONSE_DATA)
|
|
|
|
static let TAPCASH_APDU01 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x32, p1Parameter : 0x03, p2Parameter : 0x00, data : Data(), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//00 a4 01 00 02 02 00
|
|
static let BCA_APDU01 = NFCISO7816APDU(instructionClass : 0x00, instructionCode : 0xA4, p1Parameter : 0x01, p2Parameter : 0x00, data : Data(_ : [0x02, 0x00]), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//00 b0 81 00 8e
|
|
static let BCA_APDU02 = NFCISO7816APDU(instructionClass : 0x00, instructionCode : 0xb0, p1Parameter : 0x81, p2Parameter : 0x00, data : Data(), expectedResponseLength : 142)
|
|
//80 32 00 03 04 00 00 00 00 //00 b0 81 00 00
|
|
static let BCA_APDU03 = NFCISO7816APDU(instructionClass : 0x80, instructionCode : 0x32, p1Parameter : 0x00, p2Parameter : 0x03, data : Data(_ : [0x00, 0x00, 0x00, 0x00]), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//00 b0 81 00 00
|
|
static let BCA_APDU04 = NFCISO7816APDU(instructionClass : 0x00, instructionCode : 0xB0, p1Parameter : 0x81, p2Parameter : 0x00, data : Data(), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
|
|
|
|
|
|
//00 b3 00 00 3f
|
|
static let MANDIRI_APDU01 = NFCISO7816APDU(instructionClass : 0x00, instructionCode : 0xB3, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(), expectedResponseLength : 63)
|
|
//00 b5 00 00 0a
|
|
static let MANDIRI_APDU02 = NFCISO7816APDU(instructionClass : 0x00, instructionCode : 0xB5, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(), expectedResponseLength : 10)
|
|
//90 4c 00 00 04
|
|
static let DKI_APDU01 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x4C, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(), expectedResponseLength : 4)
|
|
//90 bd 00 00 07 01 00 00 00 0a 00 00 00
|
|
static let MEGA_APDU01 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0xBD, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_ : MEGA_DATA), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 6c 00 00 01 02 00
|
|
static let MEGA_APDU02 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x6C, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_ : [0x02]), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 60 00 00 00
|
|
static let BRI_UID01 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x60, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 AF 00 00 00
|
|
static let BRI_UID02 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0xAF, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
|
|
|
|
//90 bd 00 00 07 00 00 00 00 17 00 00 00
|
|
static let BRI_APDU01 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0xBD, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_: BRI_DATA_01), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 5A 00 00 03 03 00 00 00
|
|
static let BRI_APDU02 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x5A, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_: [0x03, 0x00, 0x00]), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 0a 00 00 01 00 00
|
|
static let BRI_APDU03 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x0A, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_: [0x00]), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 6C 00 00 01 00 00
|
|
static let BRI_APDU05 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0x6C, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_: [0x00]), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 BB 00 00 07 01 00 00 00 00 00 00 00
|
|
static let BRI_LOG01 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0xBB, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(_: [0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
//90 AF 00 00 00
|
|
static let BRI_LOG02 = NFCISO7816APDU(instructionClass : 0x90, instructionCode : 0xAF, p1Parameter : 0x00, p2Parameter : 0x00, data : Data(), expectedResponseLength : CommonConstants.LE_GET_ALL_RESPONSE_DATA)
|
|
}
|