@yume-chan/adb
Version:
TypeScript implementation of Android Debug Bridge (ADB) protocol.
70 lines • 2.28 kB
JavaScript
import { PromiseResolver } from "@yume-chan/async";
import { AdbFeature } from "../features.js";
export const ADB_SERVER_DEFAULT_FEATURES = /* #__PURE__ */ (() => [
AdbFeature.ShellV2,
AdbFeature.Cmd,
AdbFeature.StatV2,
AdbFeature.ListV2,
AdbFeature.FixedPushMkdir,
"apex",
AdbFeature.Abb,
// only tells the client the symlink timestamp issue in `adb push --sync` has been fixed.
// No special handling required.
"fixed_push_symlink_timestamp",
AdbFeature.AbbExec,
"remount_shell",
"track_app",
AdbFeature.SendReceiveV2,
"sendrecv_v2_brotli",
"sendrecv_v2_lz4",
"sendrecv_v2_zstd",
"sendrecv_v2_dry_run_send",
])();
export class AdbServerTransport {
serial;
transportId;
maxPayloadSize = 1 * 1024 * 1024;
banner;
get disconnected() {
return this.
}
get clientFeatures() {
// No need to get host features (features supported by ADB server)
// Because we create all ADB packets ourselves
return ADB_SERVER_DEFAULT_FEATURES;
}
// eslint-disable-next-line @typescript-eslint/max-params
constructor(client, serial, banner, transportId, disconnected) {
this.
this.serial = serial;
this.banner = banner;
this.transportId = transportId;
this.
}
async connect(service) {
const socket = await this.
this.
return socket;
}
async addReverseTunnel(handler, address) {
return await this.
}
async removeReverseTunnel(address) {
await this.
}
async clearReverseTunnels() {
await this.
}
async close() {
for (const socket of this.
await socket.close();
}
this.
this.
}
}
//# sourceMappingURL=transport.js.map