Skip to content
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

v0.3.2: fixup #108

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,14 @@ jobs:
uses: egad13/purge-jsdelivr-cache@v1
with:
url: |
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.global.js
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/Crypto1.global.js
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebbleAdapter.global.js
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebserialAdapter.global.js

https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/+esm
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.mjs/+esm
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/Crypto1.mjs/+esm
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebbleAdapter.mjs/+esm
https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebserialAdapter.mjs/+esm
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ Using jsDelivr CDN:

<!-- module -->
<script type="module">
import { Buffer, ChameleonUltra } from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.mjs/+esm'
import { Buffer, ChameleonUltra } from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/+esm'
import WebbleAdapter from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebbleAdapter.mjs/+esm'
import WebserialAdapter from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebserialAdapter.mjs/+esm'
</script>

<!-- module + async import -->
<script type="module">
const { Buffer, ChameleonUltra } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.mjs/+esm')
const { Buffer, ChameleonUltra } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/+esm')
const { default: WebbleAdapter } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebbleAdapter.mjs/+esm')
const { default: WebserialAdapter } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebserialAdapter.mjs/+esm')
</script>
Expand All @@ -121,7 +121,7 @@ ultraBle.use(new WebbleAdapter())

```js
async function run (ultra) {
const { Buffer, DeviceMode, FreqType, Slot, TagType } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.mjs/+esm')
const { Buffer, DeviceMode, FreqType, Slot, TagType } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/+esm')
// set slot tag type and reset data
await ultra.cmdSlotChangeTagType(Slot.SLOT_8, TagType.MIFARE_1024)
await ultra.cmdSlotResetTagType(Slot.SLOT_8, TagType.MIFARE_1024)
Expand All @@ -146,7 +146,7 @@ async function run (ultra) {
await run(vm.ultra)

// or run with new ChaneleonUltra instance
const { ChameleonUltra } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.mjs/+esm')
const { ChameleonUltra } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/+esm')
const { default: WebserialAdapter } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebserialAdapter.mjs/+esm')
const ultraUsb = new ChameleonUltra()
ultraUsb.use(new WebserialAdapter())
Expand All @@ -166,7 +166,7 @@ async function run (ultra) {
await run(vm.ultra)

// or run with new ChaneleonUltra instance
const { ChameleonUltra } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.mjs/+esm')
const { ChameleonUltra } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/+esm')
const { default: WebserialAdapter } = await import('https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebserialAdapter.mjs/+esm')
const ultraUsb = new ChameleonUltra()
ultraUsb.use(new WebserialAdapter())
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"module": "./dist/index.mjs",
"name": "chameleon-ultra.js",
"type": "commonjs",
"version": "0.3.1",
"version": "0.3.2",
"bugs": {
"url": "https://github.com/taichunmin/chameleon-ultra.js/issues"
},
Expand Down
4 changes: 2 additions & 2 deletions src/ChameleonUltra.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import _ from 'lodash'
import { Buffer } from '@taichunmin/buffer'
import { debug as createDebugger, type Debugger } from 'debug'
import { errToJson, middlewareCompose, sleep, type MiddlewareComposeFn, versionCompare } from './helper'
import { type ReadableStream, type UnderlyingSink, WritableStream } from 'node:stream/web'
import * as Decoder from './ResponseDecoder'
import createDebugger, { type Debugger } from 'debug'

import {
Cmd,
Expand Down Expand Up @@ -102,7 +102,7 @@
*
* ```html
* <script type="module">
* import { Buffer, ChameleonUltra } from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/index.mjs/+esm'
* import { Buffer, ChameleonUltra } from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/+esm'
* import WebbleAdapter from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebbleAdapter.mjs/+esm'
* import WebserialAdapter from 'https://cdn.jsdelivr.net/npm/chameleon-ultra.js@0/dist/plugin/WebserialAdapter.mjs/+esm'
*
Expand Down Expand Up @@ -307,9 +307,9 @@

/**
* Send a command to device.
* @param opts.cmd - The command to be sent to device.

Check warning on line 310 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param opts.status - The status is always `0x0000`.

Check warning on line 311 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param opts.data - `<= 512 bytes`, the data to be sent. This payload depends on the exact command being used. See [Packet payloads](https://github.com/RfidResearchGroup/ChameleonUltra/blob/main/docs/protocol.md#packet-payloads) for more infomation.

Check warning on line 312 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @internal
* @group Internal
*/
Expand Down Expand Up @@ -1369,12 +1369,12 @@
/**
* Use a known key to do the mifare static nested attack.
* @param known - The info of known key.
* @param known.block - The block of known key.

Check warning on line 1372 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param known.key - The known key.

Check warning on line 1373 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param known.keyType - The key type of known key.

Check warning on line 1374 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param target - The info of target key to be attack.
* @param target.block - The block of target key.

Check warning on line 1376 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param target.keyType - The key type of target key.

Check warning on line 1377 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @returns The result of mifare static nested attack.
* @group Mifare Classic Related
* @example
Expand Down Expand Up @@ -1506,7 +1506,7 @@
/**
* Dectect the nt distance of mifare protocol.
* @param known - The info of known key.
* @param known.block - The block of known key.

Check warning on line 1509 in src/ChameleonUltra.ts

View workflow job for this annotation

GitHub Actions / test

tsdoc-param-tag-with-invalid-name: The @param block should be followed by a valid parameter name: The identifier cannot non-word characters
* @param known.key - The known key.
* @param known.keyType - The key type of known key.
* @returns The nt distance of mifare protocol.
Expand Down
Loading