File tree Expand file tree Collapse file tree 9 files changed +77
-26
lines changed
suite-data/files/bin/bluetooth/TrezorBluetooth.app/Contents
suite-desktop-core/src/libs/processes
TrezorBluetooth.app/Contents Expand file tree Collapse file tree 9 files changed +77
-26
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+ <plist version =" 1.0" >
4+ <dict >
5+ <key >CFBundleDevelopmentRegion </key >
6+ <string >en </string >
7+ <key >CFBundleExecutable </key >
8+ <string >trezor-bluetooth </string >
9+ <key >CFBundleIconFile </key >
10+ <string >AppIcon </string >
11+ <key >CFBundleIconName </key >
12+ <string >AppIcon </string >
13+ <key >CFBundleIdentifier </key >
14+ <string >io.trezor.TrezorBtleMac </string >
15+ <key >CFBundleInfoDictionaryVersion </key >
16+ <string >6.0 </string >
17+ <key >CFBundleName </key >
18+ <string >TrezorBtleMac </string >
19+ <key >CFBundlePackageType </key >
20+ <string >APPL </string >
21+ <key >CFBundleShortVersionString </key >
22+ <string >0.1.0 </string >
23+ <key >CFBundleSupportedPlatforms </key >
24+ <array >
25+ <string >MacOSX </string >
26+ </array >
27+ <key >CFBundleVersion </key >
28+ <string >0.1.0 </string >
29+ <key >LSMinimumSystemVersion </key >
30+ <string >13.0 </string >
31+ <key >LSUIElement </key >
32+ <true />
33+ <key >NSBluetoothAlwaysUsageDescription </key >
34+ <string >This app requires Bluetooth access to communicate with Trezor devices. </string >
35+ </dict >
36+ </plist >
Original file line number Diff line number Diff line change 1+ APPL????
File renamed without changes.
Original file line number Diff line number Diff line change @@ -248,11 +248,11 @@ export abstract class BaseProcess {
248248 await this . start ( ) ;
249249 }
250250
251- private onError ( err : Error ) {
251+ public onError ( err : Error ) {
252252 this . logger . error ( this . logTopic , err . message ) ;
253253 }
254254
255- private onExit ( code : number | null ) {
255+ public onExit ( code : number | null ) {
256256 this . logger . info (
257257 this . logTopic ,
258258 `Exited, code: ${ code ?? 'N/A' } (Stopped: ${ b2t ( this . stopped ) } )` ,
Original file line number Diff line number Diff line change 1+ import { spawn } from 'child_process' ;
2+ import path from 'path' ;
3+
14import { isDevEnv } from '@suite-common/suite-utils' ;
5+ import { isMacOs } from '@trezor/env-utils' ;
26
37import { BaseProcess , Status } from './BaseProcess' ;
48import { getSwitchValue } from '../process-switches' ;
@@ -62,6 +66,29 @@ export class BluetoothProcess extends BaseProcess {
6266 process . env . RUST_BACKTRACE = '1' ;
6367 }
6468
65- return super . start ( [ '-p' , this . port . toString ( ) ] ) ;
69+ if ( ! isMacOs ( ) ) {
70+ return super . start ( [ '-p' , this . port . toString ( ) ] ) ;
71+ }
72+
73+ return new Promise < void > ( resolve => {
74+ // Launch macos helper
75+ const helperPath = path . join (
76+ global . resourcesPath ,
77+ '..' ,
78+ 'Helpers' ,
79+ 'TrezorBluetooth.app' ,
80+ ) ;
81+ this . logger . info ( this . logTopic , `Launching macOS helper: ${ helperPath } ` ) ;
82+ const process = spawn ( '/usr/bin/open' , [
83+ '-n' ,
84+ helperPath ,
85+ '--args' ,
86+ '-p' ,
87+ this . port . toString ( ) ,
88+ ] ) ;
89+ process . on ( 'error' , err => super . onError ( err ) ) ;
90+ process . on ( 'close' , code => super . onExit ( code ) ) ;
91+ resolve ( ) ;
92+ } ) ;
6693 }
6794}
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ module.exports = {
8181 oneClick : false ,
8282 } ,
8383 mac : {
84+ binaries : [ ] ,
8485 files : [ 'entitlements.mac.inherit.plist' ] ,
8586 extraResources : [
8687 {
@@ -100,6 +101,12 @@ module.exports = {
100101 to : 'bin/bluetooth' ,
101102 } ,
102103 ] ,
104+ extraFiles : [
105+ {
106+ from : 'build/static/bin/bluetooth/TrezorBluetooth.app' ,
107+ to : 'Helpers/TrezorBluetooth.app' ,
108+ } ,
109+ ] ,
103110 icon : 'build/static/images/desktop/512x512.icns' ,
104111 artifactName : 'Trezor-Suite-${version}-mac-${arch}.${ext}' ,
105112 hardenedRuntime : true ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11cargo build
2- cp target/debug/trezor-bluetooth TrezorBluetooth.app/Contents/MacOS
3- # codesign --deep --force --sign - TrezorBluetooth.app
4- codesign --deep --force --sign " Apple Development: Tomas Martykan (Z45W4655Y2) " --entitlements entitlements.plist TrezorBluetooth.app/
2+ cp target/debug/trezor-bluetooth ../suite-data/files/bin/bluetooth/ TrezorBluetooth.app/Contents/MacOS
3+ codesign --deep --force --sign " Apple Development: Tomas Martykan (Z45W4655Y2) " --entitlements entitlements.plist ../suite-data/files/bin/bluetooth/ TrezorBluetooth.app/
4+ codesign -dvvv --entitlements - ../suite-data/files/bin/bluetooth/ TrezorBluetooth.app
You can’t perform that action at this time.
0 commit comments