Loading libraries/adb/src/adb.ts +2 −3 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ import { AdbSubprocessService, AdbSync, AdbTcpIpService, escapeArg, framebuffer, } from "./commands/index.js"; import type { AdbFeature } from "./features.js"; Loading Loading @@ -147,11 +146,11 @@ export class Adb implements Closeable { if (Array.isArray(filenames)) { for (const filename of filenames) { // https://github.com/microsoft/typescript/issues/17002 args.push(escapeArg(filename as string)); args.push(filename as string); } } else { // https://github.com/microsoft/typescript/issues/17002 args.push(escapeArg(filenames as string)); args.push(filenames as string); } // https://android.googlesource.com/platform/packages/modules/adb/+/1a0fb8846d4e6b671c8aa7f137a8c21d7b248716/client/adb_install.cpp#984 args.push("</dev/null"); Loading libraries/adb/src/commands/subprocess/none/service.ts +2 −1 Original line number Diff line number Diff line import type { Adb } from "../../../adb.js"; import { escapeArg } from "../utils.js"; import { AdbNoneProtocolProcessImpl } from "./process.js"; import { AdbNoneProtocolPtyProcess } from "./pty.js"; Loading @@ -18,7 +19,7 @@ export class AdbNoneProtocolSubprocessService { // `shell,raw:${command}` also triggers raw mode, // But is not supported on Android version <7. const socket = await this.#adb.createSocket( `exec:${command.join(" ")}`, `exec:${command.map(escapeArg).join(" ")}`, ); if (signal?.aborted) { Loading libraries/adb/src/commands/subprocess/shell/service.ts +2 −1 Original line number Diff line number Diff line import type { Adb } from "../../../adb.js"; import { AdbFeature } from "../../../features.js"; import { escapeArg } from "../utils.js"; import { AdbShellProtocolProcessImpl } from "./process.js"; import { AdbShellProtocolPtyProcess } from "./pty.js"; Loading @@ -21,7 +22,7 @@ export class AdbShellProtocolSubprocessService { spawn = adbShellProtocolSpawner(async (command, signal) => { const socket = await this.#adb.createSocket( `shell,v2,raw:${command.join(" ")}`, `shell,v2,raw:${command.map(escapeArg).join(" ")}`, ); if (signal?.aborted) { Loading libraries/adb/src/commands/sync/sync.ts +1 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ import type { MaybeConsumable, ReadableStream } from "@yume-chan/stream-extra"; import type { Adb, AdbSocket } from "../../adb.js"; import { AdbFeature } from "../../features.js"; import { escapeArg } from "../subprocess/index.js"; import type { AdbSyncEntry } from "./list.js"; import { adbSyncOpenDir } from "./list.js"; Loading Loading @@ -152,7 +151,7 @@ export class AdbSync { // Ignore the result. // TODO: sync: test push mkdir workaround (need an Android 8 device) await this._adb.subprocess.noneProtocol .spawn(["mkdir", "-p", escapeArg(dirname(options.filename))]) .spawn(["mkdir", "-p", dirname(options.filename)]) .wait(); } Loading libraries/android-bin/src/am.ts +5 −3 Original line number Diff line number Diff line import type { Adb, AdbNoneProtocolProcess } from "@yume-chan/adb"; import { AdbServiceBase, escapeArg } from "@yume-chan/adb"; import { AdbServiceBase } from "@yume-chan/adb"; import { SplitStringStream, TextDecoderStream } from "@yume-chan/stream-extra"; import { Cmd } from "./cmd/index.js"; Loading Loading @@ -43,13 +43,15 @@ export class ActivityManager extends AdbServiceBase { ): Promise<void> { // `am start` and `am start-activity` are the same, // but `am start-activity` was added in Android 8. let args = buildArguments( const args = buildArguments( [ActivityManager.ServiceName, "start", "-W"], options, START_ACTIVITY_OPTIONS_MAP, ); args = args.concat(options.intent.build().map(escapeArg)); for (const arg of options.intent.build()) { args.push(arg); } // `cmd activity` doesn't support `start` command on Android 7. let process: AdbNoneProtocolProcess; Loading Loading
libraries/adb/src/adb.ts +2 −3 Original line number Diff line number Diff line Loading @@ -13,7 +13,6 @@ import { AdbSubprocessService, AdbSync, AdbTcpIpService, escapeArg, framebuffer, } from "./commands/index.js"; import type { AdbFeature } from "./features.js"; Loading Loading @@ -147,11 +146,11 @@ export class Adb implements Closeable { if (Array.isArray(filenames)) { for (const filename of filenames) { // https://github.com/microsoft/typescript/issues/17002 args.push(escapeArg(filename as string)); args.push(filename as string); } } else { // https://github.com/microsoft/typescript/issues/17002 args.push(escapeArg(filenames as string)); args.push(filenames as string); } // https://android.googlesource.com/platform/packages/modules/adb/+/1a0fb8846d4e6b671c8aa7f137a8c21d7b248716/client/adb_install.cpp#984 args.push("</dev/null"); Loading
libraries/adb/src/commands/subprocess/none/service.ts +2 −1 Original line number Diff line number Diff line import type { Adb } from "../../../adb.js"; import { escapeArg } from "../utils.js"; import { AdbNoneProtocolProcessImpl } from "./process.js"; import { AdbNoneProtocolPtyProcess } from "./pty.js"; Loading @@ -18,7 +19,7 @@ export class AdbNoneProtocolSubprocessService { // `shell,raw:${command}` also triggers raw mode, // But is not supported on Android version <7. const socket = await this.#adb.createSocket( `exec:${command.join(" ")}`, `exec:${command.map(escapeArg).join(" ")}`, ); if (signal?.aborted) { Loading
libraries/adb/src/commands/subprocess/shell/service.ts +2 −1 Original line number Diff line number Diff line import type { Adb } from "../../../adb.js"; import { AdbFeature } from "../../../features.js"; import { escapeArg } from "../utils.js"; import { AdbShellProtocolProcessImpl } from "./process.js"; import { AdbShellProtocolPtyProcess } from "./pty.js"; Loading @@ -21,7 +22,7 @@ export class AdbShellProtocolSubprocessService { spawn = adbShellProtocolSpawner(async (command, signal) => { const socket = await this.#adb.createSocket( `shell,v2,raw:${command.join(" ")}`, `shell,v2,raw:${command.map(escapeArg).join(" ")}`, ); if (signal?.aborted) { Loading
libraries/adb/src/commands/sync/sync.ts +1 −2 Original line number Diff line number Diff line Loading @@ -2,7 +2,6 @@ import type { MaybeConsumable, ReadableStream } from "@yume-chan/stream-extra"; import type { Adb, AdbSocket } from "../../adb.js"; import { AdbFeature } from "../../features.js"; import { escapeArg } from "../subprocess/index.js"; import type { AdbSyncEntry } from "./list.js"; import { adbSyncOpenDir } from "./list.js"; Loading Loading @@ -152,7 +151,7 @@ export class AdbSync { // Ignore the result. // TODO: sync: test push mkdir workaround (need an Android 8 device) await this._adb.subprocess.noneProtocol .spawn(["mkdir", "-p", escapeArg(dirname(options.filename))]) .spawn(["mkdir", "-p", dirname(options.filename)]) .wait(); } Loading
libraries/android-bin/src/am.ts +5 −3 Original line number Diff line number Diff line import type { Adb, AdbNoneProtocolProcess } from "@yume-chan/adb"; import { AdbServiceBase, escapeArg } from "@yume-chan/adb"; import { AdbServiceBase } from "@yume-chan/adb"; import { SplitStringStream, TextDecoderStream } from "@yume-chan/stream-extra"; import { Cmd } from "./cmd/index.js"; Loading Loading @@ -43,13 +43,15 @@ export class ActivityManager extends AdbServiceBase { ): Promise<void> { // `am start` and `am start-activity` are the same, // but `am start-activity` was added in Android 8. let args = buildArguments( const args = buildArguments( [ActivityManager.ServiceName, "start", "-W"], options, START_ACTIVITY_OPTIONS_MAP, ); args = args.concat(options.intent.build().map(escapeArg)); for (const arg of options.intent.build()) { args.push(arg); } // `cmd activity` doesn't support `start` command on Android 7. let process: AdbNoneProtocolProcess; Loading