Repository navigation
bugfix:修复八达通卡支持,增加呼和浩特地铁储值卡,裁剪武汉通卡号 #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -319,7 +319,7 @@ | |
| let ReadTransWuhan = async (fci) => { | ||
| let f15 = await BasicInfoFile(fci); | ||
| if (!f15) return {}; | ||
| const number = f15.slice(24, 40); | ||
| const number = f15.slice(31, 40); | ||
| const issue_date = f15.slice(40, 48); | ||
| const expiry_date = f15.slice(48, 56); | ||
| const balance_atc_trans = await ReadPBOCBalanceATCAndTrans(); | ||
|
|
@@ -840,9 +840,11 @@ | |
| returnMap = { ...returnMap, ...subCard }; | ||
| } | ||
| } | ||
| if (tag.type === "felica" && tag.systemCode === "8008") { | ||
| // Octopus | ||
| return await ReadOctopus(); | ||
| if (tag.type === "iso18092") { | ||
| if (tag.systemCode === "8008") { | ||
| // Octopus | ||
| return await ReadOctopus(); | ||
| } | ||
|
Comment on lines
+843
to
+847
|
||
| } else if (tag.type === "mifare_ultralight") { | ||
| return await ReadMifareUltralight(); | ||
| } else if (tag.type === "mifare_plus") { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,8 +153,10 @@ class _PlatformAdaptingHomePageState extends State<PlatformAdaptingHomePage> { | |
| case 'poll': | ||
| error = null; | ||
| try { | ||
| final tag = | ||
| await FlutterNfcKit.poll(iosAlertMessage: S(context).waitForCard); | ||
| final tag = await FlutterNfcKit.poll( | ||
| iosAlertMessage: S(context).waitForCard, | ||
| readIso18092: true, | ||
| ); | ||
|
Comment on lines
+156
to
+159
|
||
| final json = tag.toJson(); | ||
|
|
||
| // try to read ndef and insert into json | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f15is a hex string (frombuf2hex/ APDU response).f15.slice(31, 40)starts at an odd index (splits a byte) and also selects the last 9 chars of the previous 16-char range (24..40), not the “first 9 digits” described in the PR. This is likely an off-by-one / wrong-range bug; consider extracting the full card number field first (byte-aligned) and then truncating to the desired 9-digit display string.