Sitelet https://github.com/trustcrypto/OnlyKey-App/pull/243
Skip to content

Draft: native Apple Silicon (arm64) build for macOS - #243

Draft
mtdvicvm wants to merge 1 commit into
trustcrypto:masterfrom
mtdvicvm:pr/macos-arm64
Draft

mtdvicvm wants to merge 1 commit into
trustcrypto:masterfrom
mtdvicvm:pr/macos-arm64

Conversation

@mtdvicvm

Copy link
Copy Markdown

Draft for discussion. This works on my M1 Mac, and I haven't tested it anywhere else.

Why: nw 0.71.1 has no osx-arm64 build (dl.nwjs.io returns 404), so the Mac app only runs under Rosetta.

Changes

  1. nw → 0.104.1, which ships osx-arm64. package-lock.json is deliberately left out: mine regenerated as lockfile v3 (7,500 lines). Please regenerate it with your npm.
  2. tasks/release_osx.js:
    • Stop copying Contents/Versions to the bundle root. It left a stray Frameworks/ there, which breaks codesign --verify.
    • Patch the runtime's own Info.plist instead of replacing it with the old template. This also sets the bundle identifier to com.cryptotrust.onlykey; change it as you prefer.
    • Ad-hoc sign the app, which arm64 binaries need in order to run.
    • Fall back to hdiutil when appdmg can't be installed. It didn't build on Node 26.
  3. tray.js: on macOS, skip autoLaunch.isEnabled() at startup. It calls System Events via AppleScript, which raises an Automation permission popup at launch. The stored preference is used instead, and the OS is still asked when the menu item is clicked.
  4. OnlyKeyWizard.js / OnlyKeyComm.js / dialog-links.js: on nw 0.104 on macOS, the page sometimes stays in readyState: "loading", so DOMContentLoaded and load never fire, and the wizard and HID init never run. It happens reliably when the app is launched from the Dock. Both inits are now idempotent and are also called from the last script on the page. This is a workaround; I didn't find the root cause.

Tested: macOS on M1, OnlyKey DUO firmware v3.0.3. It detects the key and reads its unlocked state, launched from both the Dock and the terminal. I haven't tested Windows, Linux, the auto-updater or the other feature tabs.

I also saw #242 (6.0.0). This merges cleanly on top of it.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant