Skip to content

Commit

Permalink
feat(devices): add onekey support
Browse files Browse the repository at this point in the history
  • Loading branch information
somebodyLi committed Dec 5, 2024
1 parent 9ebf888 commit be03010
Show file tree
Hide file tree
Showing 12 changed files with 795 additions and 23 deletions.
9 changes: 8 additions & 1 deletion .github/actions/install-sim/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ runs:
apt-get update
apt-get install -y libsdl2-image-2.0-0 libusb-1.0-0
tar -xvf trezor-firmware.tar.gz
- if: startsWith(inputs.device, 'onekey-')
shell: bash
run: |
apt-get update
apt-get install -y libsdl2-image-2.0-0 libusb-1.0-0
tar -xvf onekey-firmware.tar.gz
- if: inputs.device == 'coldcard'
shell: bash
run: |
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ jobs:
- { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' }
- { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' }
- { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' }
- { name: 'onekey-1', archive: 'onekey-firmware', paths: 'test/work/onekey-firmware' }
- { name: 'onekey-t', archive: 'onekey-firmware', paths: 'test/work/onekey-firmware' }

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -221,6 +223,8 @@ jobs:
- 'ledger-legacy'
- 'keepkey'
- 'bitbox02'
- 'onekey-1'
- 'onekey-t'
script:
- name: 'Wheel'
install: 'pip install dist/*.whl'
Expand Down Expand Up @@ -292,6 +296,8 @@ jobs:
- 'ledger-legacy'
- 'keepkey'
- 'bitbox02'
- 'onekey-1'
- 'onekey-t'
interface: [ 'library', 'cli', 'stdin' ]

container: python:${{ matrix.python-version }}
Expand Down
3 changes: 2 additions & 1 deletion hwilib/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
'digitalbitbox',
'coldcard',
'bitbox02',
'jade'
'jade',
'onekey'
]
3 changes: 1 addition & 2 deletions hwilib/devices/keepkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ def __init__(self, path: str, password: Optional[str] = None, expert: bool = Fal
if path.startswith("udp"):
model.default_mapping.register(KeepkeyDebugLinkState)

super(KeepkeyClient, self).__init__(path, password, expert, chain, KEEPKEY_HID_IDS, KEEPKEY_WEBUSB_IDS, KEEPKEY_SIMULATOR_PATH, model)
self.type = 'Keepkey'
super(KeepkeyClient, self).__init__(path, password, expert, chain, KEEPKEY_HID_IDS, KEEPKEY_WEBUSB_IDS, KEEPKEY_SIMULATOR_PATH, model, device_type="Keepkey")

def can_sign_taproot(self) -> bool:
"""
Expand Down
Loading

0 comments on commit be03010

Please sign in to comment.