Skip to content

Commit

Permalink
Fix cmdSlotSetActive (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
taichunmin authored Sep 4, 2024
2 parents c704d97 + 2057741 commit e4d4b5b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pug/src/lf-em410x.pug
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ block script
await ultra.cmdSlotResetTagType(slot, TagType.EM410X)
await ultra.cmdSlotSetEnable(slot, FreqType.LF, true)
if (_.isString(name) && name.length > 0) await ultra.cmdSlotSetFreqName(slot, FreqType.LF, name)
await ultra.cmdEm410xSetEmuId(uid)
await ultra.cmdSlotSetActive(slot)
await ultra.cmdEm410xSetEmuId(uid)
await Swal.fire({ icon: 'success', title: 'Emulate success' })
} catch (err) {
ultra.emitter.emit('error', err)
Expand Down
2 changes: 1 addition & 1 deletion pug/src/mfkey32.pug
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ block script
await ultra.cmdSlotChangeTagType(slot, tagType ? TagType.MIFARE_4096 : TagType.MIFARE_1024)
await ultra.cmdSlotResetTagType(slot, tagType ? TagType.MIFARE_4096 : TagType.MIFARE_1024)
await ultra.cmdSlotSetEnable(slot, FreqType.HF, true)
await ultra.cmdSlotSetActive(slot)
// set anti-coll
const tag = {
atqa: Buffer.from(atqa, 'hex').reverse(),
Expand All @@ -211,7 +212,6 @@ block script
tag.atqa.copy(block0, tag.uid.length + 2) // atqa
console.log(`block0 = ${block0.toString('hex')}`)
await ultra.cmdMf1EmuWriteBlock(0, block0) // set block0
await ultra.cmdSlotSetActive(slot)
await ultra.cmdSlotSaveSettings()
await Swal.fire({ icon: 'success', title: 'Emulate successfully!' })
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion pug/src/mifare-xiaomi.pug
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ block script
await ultra.cmdSlotChangeTagType(slot, TagType.MIFARE_1024)
await ultra.cmdSlotResetTagType(slot, TagType.MIFARE_1024)
await ultra.cmdSlotSetEnable(slot, FreqType.HF, true)
await ultra.cmdSlotSetActive(slot)
await ultra.cmdMf1SetAntiCollMode(true)
await ultra.cmdMf1EmuWriteBlock(0, dump.subarray(0, 16)) // set block0
await ultra.cmdSlotSetActive(slot)
await ultra.cmdSlotSaveSettings()
await Swal.fire({ icon: 'success', title: 'Emulate successfully!' })
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion pug/src/mifare1k.pug
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ block script
await ultra.cmdSlotResetTagType(slot, TagType.MIFARE_1024)
await ultra.cmdSlotSetEnable(slot, FreqType.HF, true)
if (_.isString(name) && name.length > 0) await ultra.cmdSlotSetFreqName(slot, FreqType.HF, name)
await ultra.cmdSlotSetActive(slot)
await ultra.cmdMf1SetAntiCollMode(antiColl)
await ultra.cmdMf1SetDetectionEnable(detection)
await ultra.cmdMf1SetGen1aMode(gen1a)
Expand All @@ -291,7 +292,6 @@ block script
const sectorData = Buffer.from(dump[i], 'hex')
await ultra.cmdMf1EmuWriteBlock(i << 2, sectorData)
}
await ultra.cmdSlotSetActive(slot)
await Swal.fire({ icon: 'success', title: 'Emulate success' })
} catch (err) {
ultra.emitter.emit('error', err)
Expand Down

0 comments on commit e4d4b5b

Please sign in to comment.