Skip to content

Commit fb5cb5b

Browse files
committed
Improve ADB setup log output
1 parent 406e62b commit fb5cb5b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/interceptors/android/adb-commands.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ export async function getRootCommand(adbClient: Adb.DeviceClient): Promise<RootC
189189
// Run our whoami script with each of the possible root commands
190190
const rootCheckResults = await Promise.all(
191191
runAsRootCommands.map((runAsRoot) =>
192-
run(adbClient, runAsRoot(...rootTestCommand), { timeout: 1000 }).catch(console.log)
192+
run(adbClient, runAsRoot(...rootTestCommand), { timeout: 1000 })
193+
.catch((e: any) => console.log(e.message ?? e))
193194
.then((whoami) => ({ cmd: runAsRoot, whoami }))
194195
)
195196
)
@@ -206,7 +207,7 @@ export async function getRootCommand(adbClient: Adb.DeviceClient): Promise<RootC
206207
// We prefer explicit "su" calls if possible, to limit access & side effects.
207208
await adbClient.root().catch((e: any) => {
208209
if (isErrorLike(e) && e.message?.includes("adbd is already running as root")) return;
209-
else console.log(e);
210+
else console.log(e.message ?? e);
210211
});
211212

212213
// Sometimes switching to root can disconnect ADB devices, so double-check
@@ -268,6 +269,8 @@ export async function injectSystemCertificate(
268269
stringAsStream(`
269270
set -e # Fail on error
270271
272+
echo "\n---\nInjecting certificate:"
273+
271274
# Create a separate temp directory, to hold the current certificates
272275
# Without this, when we add the mount we can't read the current certs anymore.
273276
mkdir -p -m 700 /data/local/tmp/htk-ca-copy
@@ -343,7 +346,7 @@ export async function injectSystemCertificate(
343346
rm -r /data/local/tmp/htk-ca-copy
344347
rm ${injectionScriptPath}
345348
346-
echo "System cert successfully injected"
349+
echo "System cert successfully injected\n---\n"
347350
`),
348351
injectionScriptPath,
349352
// Due to an Android bug, user mode is always duplicated to group & others. We set as read-only

0 commit comments

Comments
 (0)