Skip to content

Commit be03010

Browse files
committed
feat(devices): add onekey support
1 parent 9ebf888 commit be03010

File tree

12 files changed

+795
-23
lines changed

12 files changed

+795
-23
lines changed

.github/actions/install-sim/action.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ runs:
1717
apt-get update
1818
apt-get install -y libsdl2-image-2.0-0 libusb-1.0-0
1919
tar -xvf trezor-firmware.tar.gz
20-
20+
21+
- if: startsWith(inputs.device, 'onekey-')
22+
shell: bash
23+
run: |
24+
apt-get update
25+
apt-get install -y libsdl2-image-2.0-0 libusb-1.0-0
26+
tar -xvf onekey-firmware.tar.gz
27+
2128
- if: inputs.device == 'coldcard'
2229
shell: bash
2330
run: |

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ jobs:
154154
- { name: 'ledger', archive: 'speculos', paths: 'test/work/speculos' }
155155
- { name: 'keepkey', archive: 'keepkey-firmware', paths: 'test/work/keepkey-firmware/bin' }
156156
- { name: 'bitbox02', archive: 'bitbox02', paths: 'test/work/bitbox02-firmware/build-build/bin/simulator' }
157+
- { name: 'onekey-1', archive: 'onekey-firmware', paths: 'test/work/onekey-firmware' }
158+
- { name: 'onekey-t', archive: 'onekey-firmware', paths: 'test/work/onekey-firmware' }
157159

158160
steps:
159161
- uses: actions/checkout@v4
@@ -221,6 +223,8 @@ jobs:
221223
- 'ledger-legacy'
222224
- 'keepkey'
223225
- 'bitbox02'
226+
- 'onekey-1'
227+
- 'onekey-t'
224228
script:
225229
- name: 'Wheel'
226230
install: 'pip install dist/*.whl'
@@ -292,6 +296,8 @@ jobs:
292296
- 'ledger-legacy'
293297
- 'keepkey'
294298
- 'bitbox02'
299+
- 'onekey-1'
300+
- 'onekey-t'
295301
interface: [ 'library', 'cli', 'stdin' ]
296302

297303
container: python:${{ matrix.python-version }}

hwilib/devices/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
'digitalbitbox',
66
'coldcard',
77
'bitbox02',
8-
'jade'
8+
'jade',
9+
'onekey'
910
]

hwilib/devices/keepkey.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ def __init__(self, path: str, password: Optional[str] = None, expert: bool = Fal
160160
if path.startswith("udp"):
161161
model.default_mapping.register(KeepkeyDebugLinkState)
162162

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

166165
def can_sign_taproot(self) -> bool:
167166
"""

0 commit comments

Comments
 (0)