1

I want to make e-wallet apps using MiFare classic 1K with flutter. also use nfc_manager library

I can change the access bit to 887787FF (it change the block of sector to value block that i know).

I wanna ask, what step to make increment and decrement to that block?

here is my code when i change access bit (it is success):

final tech = MifareClassic.from(tag);
var listKeyDefault = [0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x88, 0x77, 0x87, 0xFF, 0xff, 0xff,  0xff, 0xff, 0xff, 0xff];
var dataKeyDefault = Uint8List.fromList(listKeyDefault);

if (tech == null){
      throw('Tag is not Mifare Classic');
}



try {
      tech.authenticateSectorWithKeyB(sectorIndex: 12, key: dataKeyDefault); 
      await tech.writeBlock(blockIndex: 51, data: dataKeyDefault); 
    } on PlatformException catch (e) {
      throw(e.message ?? 'Some error has occurred.');
    }

here is when i want to increment:

 try {
      tech.authenticateSectorWithKeyB(sectorIndex: 12, key: dataKeyDefault); 
      tech.increment(blockIndex: 49, value: 5500);
      await tech.transfer(blockIndex: 49);
    } on PlatformException catch (e) {
      throw(e.message ?? 'Some error has occurred.');
    }
ilham
  • 61
  • 1
  • 1
  • 5

0 Answers0