You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue while attempting to set or remove a password using the flutter-nfc-manager library. Despite following the documented instructions, the password setting/removing functionality does not seem to work as expected.Steps to Reproduce:Initialize the NFC manager in the Flutter app.Attempt to set a password using the provided method.Verify if the password was successfully set.Try to remove the password using the appropriate function.Confirm whether the password removal was successful.Expected Behavior:
The library should allow users to both set and remove passwords as documented without any errors or unexpected behavior.Actual Behavior:
The password setting/removing functions either do not execute as expected or produce errors, rendering the feature non-functional.
this is my code:
void _setPassword(String password) {
NfcManager.instance.startSession(
onDiscovered: (NfcTag tag) async {
try {
var mifareUltralight = MifareUltralight.from(tag);
if (mifareUltralight == null) {
throw Exception('Tag is not compatible with Mifare Ultralight.');
}
int pageOffset = 0xE5;
Uint8List passwordBytes = Uint8List.fromList(password.codeUnits);
await mifareUltralight.writePage(pageOffset: pageOffset, data: passwordBytes);
pageOffset = 0xE6;
Uint8List pack = Uint8List.fromList([0x00, 0x00]);
await mifareUltralight.writePage(pageOffset: pageOffset, data: pack);
pageOffset = 0xE3;
Uint8List auth0Byte = Uint8List.fromList([0x04]);
await mifareUltralight.writePage(pageOffset: pageOffset, data: auth0Byte);
print('Password set successfully');
result.value = 'Password set successfully';
} catch (e) {
if (e is PlatformException && e.code == 'io_exception' && e.message == 'Tag was lost.') {
print('Error setting password: Tag was lost during write operation.');
result.value = 'Error setting password: Tag was lost during write operation.';
} else {
print('Error setting password: $e');
result.value = 'Error setting password: $e';
}
} finally {
NfcManager.instance.stopSession();
}
},
I encountered an issue while attempting to set or remove a password using the flutter-nfc-manager library. Despite following the documented instructions, the password setting/removing functionality does not seem to work as expected.Steps to Reproduce:Initialize the NFC manager in the Flutter app.Attempt to set a password using the provided method.Verify if the password was successfully set.Try to remove the password using the appropriate function.Confirm whether the password removal was successful.Expected Behavior:
The library should allow users to both set and remove passwords as documented without any errors or unexpected behavior.Actual Behavior:
The password setting/removing functions either do not execute as expected or produce errors, rendering the feature non-functional.
this is my code:
void _setPassword(String password) {
NfcManager.instance.startSession(
onDiscovered: (NfcTag tag) async {
try {
var mifareUltralight = MifareUltralight.from(tag);
if (mifareUltralight == null) {
throw Exception('Tag is not compatible with Mifare Ultralight.');
}
);
}
I followed steps mentioned here: https://forum.dangerousthings.com/t/inquiry-regarding-nfc-tag-password-protection-for-nxp-ntag216/21878/7
The text was updated successfully, but these errors were encountered: