Skip to content

Commit e631cb9

Browse files
committed
80% working adb-based interception & cert injection
This allows automated setup on emulators, or other devices without QR code readers, and automatically does *system* certificate injection into any root-ish devices (rooted devices, plus the official emulators that only allow su from an adb shell).
1 parent 948b163 commit e631cb9

File tree

8 files changed

+466
-36
lines changed

8 files changed

+466
-36
lines changed

custom-typings/adbkit.d.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
declare module 'adbkit' {
2+
import * as stream from 'stream';
3+
import * as events from 'events';
4+
5+
export interface Device {
6+
id: string;
7+
type: string;
8+
}
9+
10+
export interface AdbClient {
11+
listDevices(): Promise<Device[]>;
12+
isInstalled(id: string, pkg: string): Promise<boolean>;
13+
install(id: string, apk: string | stream.Readable): Promise<true>;
14+
startActivity(
15+
id: string,
16+
options: {
17+
debug?: boolean;
18+
wait?: boolean;
19+
action?: string;
20+
data?: string;
21+
}
22+
): Promise<true>;
23+
push(
24+
id: string,
25+
contents: string | stream.Readable,
26+
path: string,
27+
mode?: number
28+
): Promise<events.EventEmitter>
29+
shell(id: string, cmd: string | string[]): Promise<stream.Readable>;
30+
root(id: string): Promise<true>;
31+
}
32+
33+
export function createClient(options?: {
34+
port?: number,
35+
host?: string,
36+
bin?: string
37+
}): AdbClient;
38+
39+
export namespace util {
40+
export function readAll(stream: stream.Readable): Promise<Buffer>;
41+
}
42+
}

0 commit comments

Comments
 (0)