From 2bdeb79ffd0056139a5814aefcb8fb1dd45de7fb Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 16 Feb 2023 15:25:15 +0100 Subject: [PATCH 1/4] increase method timeout --- src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index a1bc90f..8eb3fa1 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -26,7 +26,7 @@ export const DEFAULT_HOST = "127.0.0.1"; export const BASE_NAME = "zemu-test-"; export const DEFAULT_START_TIMEOUT = 20000; export const KILL_TIMEOUT = 5000; -export const DEFAULT_METHOD_TIMEOUT = 10000; +export const DEFAULT_METHOD_TIMEOUT = 20000; export const DEFAULT_NANO_APPROVE_KEYWORD = "APPROVE"; export const DEFAULT_NANO_REJECT_KEYWORD = "REJECT"; From 912cbbadcece77e24ab5dc6dca3989b7c87b7334 Mon Sep 17 00:00:00 2001 From: ftheirs Date: Fri, 17 Feb 2023 11:19:05 -0300 Subject: [PATCH 2/4] sdk option no longer needed --- src/emulator.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/emulator.ts b/src/emulator.ts index 29f2b82..8f8918e 100644 --- a/src/emulator.ts +++ b/src/emulator.ts @@ -85,7 +85,6 @@ export default class EmuContainer { logging: boolean; custom: string; model: string; - sdk: string; transportPort: string; speculosApiPort: string; }): Promise { @@ -105,15 +104,11 @@ export default class EmuContainer { }); const modelOptions = options.model !== "" ? options.model : "nanos"; - if (modelOptions === "nanosp" && options.sdk === "") options.sdk = "1.0.3"; - - const sdkOption = options.sdk !== "" ? `-k ${options.sdk}` : ""; - if (sdkOption !== "") this.log(`[ZEMU] Using SDK ${modelOptions} with version ${options.sdk}`); const customOptions = options.custom; const displaySetting = "--display headless"; - const command = `/home/zondax/speculos/speculos.py --log-level speculos:DEBUG --color JADE_GREEN ${displaySetting} ${customOptions} -m ${modelOptions} ${sdkOption} ${DEFAULT_APP_PATH}/${appFilename} ${libArgs}`; + const command = `/home/zondax/speculos/speculos.py --log-level speculos:DEBUG --color JADE_GREEN ${displaySetting} ${customOptions} -m ${modelOptions} ${DEFAULT_APP_PATH}/${appFilename} ${libArgs}`; this.log(`[ZEMU] Command: ${command}`); From 5d357312a9f964077d4f07f583c2aaa85fdbf485 Mon Sep 17 00:00:00 2001 From: ftheirs Date: Fri, 17 Feb 2023 12:37:10 -0300 Subject: [PATCH 3/4] minor fixes for Stax --- src/Zemu.ts | 2 +- src/buttons.ts | 6 +++--- src/constants.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Zemu.ts b/src/Zemu.ts index faae7d7..323b9f4 100644 --- a/src/Zemu.ts +++ b/src/Zemu.ts @@ -360,7 +360,7 @@ export default class Zemu { this.log(`Screen changed`); } - async waitForScreenChanges(prevEvents: IEvent[], timeout: number = 10000): Promise { + async waitForScreenChanges(prevEvents: IEvent[], timeout = DEFAULT_METHOD_TIMEOUT): Promise { let currEvents = await this.getEvents(); const startTime = new Date(); while (currEvents.length === prevEvents.length) { diff --git a/src/buttons.ts b/src/buttons.ts index 06cf154..bccd391 100644 --- a/src/buttons.ts +++ b/src/buttons.ts @@ -82,9 +82,9 @@ const approveTapButton: IButton = { }; const approveHoldButton: IButton = { - x: 400, - y: 500, - delay: 2.5, + x: 335, + y: 525, + delay: 3, }; const rejectButton: IButton = { diff --git a/src/constants.ts b/src/constants.ts index 8eb3fa1..5d418c7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -24,9 +24,9 @@ export const DEFAULT_START_DELAY = 20000; export const DEFAULT_KEY_DELAY = 100; export const DEFAULT_HOST = "127.0.0.1"; export const BASE_NAME = "zemu-test-"; -export const DEFAULT_START_TIMEOUT = 20000; +export const DEFAULT_START_TIMEOUT = 30000; export const KILL_TIMEOUT = 5000; -export const DEFAULT_METHOD_TIMEOUT = 20000; +export const DEFAULT_METHOD_TIMEOUT = 30000; export const DEFAULT_NANO_APPROVE_KEYWORD = "APPROVE"; export const DEFAULT_NANO_REJECT_KEYWORD = "REJECT"; From bd1de6b683e4453916fb38c3dd84b65db3d851be Mon Sep 17 00:00:00 2001 From: ftheirs Date: Fri, 17 Feb 2023 13:03:50 -0300 Subject: [PATCH 4/4] replace default approve word for Stax --- src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 5d418c7..7bd31c6 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -31,7 +31,7 @@ export const DEFAULT_METHOD_TIMEOUT = 30000; export const DEFAULT_NANO_APPROVE_KEYWORD = "APPROVE"; export const DEFAULT_NANO_REJECT_KEYWORD = "REJECT"; -export const DEFAULT_STAX_APPROVE_KEYWORD = "APPROVE"; +export const DEFAULT_STAX_APPROVE_KEYWORD = "Hold"; export const DEFAULT_STAX_REJECT_KEYWORD = "Cancel"; export const DEFAULT_START_OPTIONS: IStartOptions = {