Documentation
¶
Overview ¶
Package android configures a USB-connected Android device for HTTPS interception via adb. Every action runs only when the operator explicitly requests it — nothing is applied automatically on startup.
Index ¶
- func Available() bool
- func DisableProxy(d Device, port int) error
- func EnableProxyUSB(d Device, port int) error
- func EnableProxyWiFi(d Device, host string, port int) error
- func InstallSystemCA(d Device, certPEM []byte) error
- func InstallUserCA(d Device, certPEM []byte) error
- func IsEmulator(serial string) bool
- func LANHost() (string, error)
- func ProxyValue(d Device) (string, error)
- func RemoveSystemCA(d Device, certPEM []byte) error
- func ResolveSerial(serial string, devices []Device) (string, error)
- type Device
- type SetupOpts
- type SetupResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableProxy ¶
DisableProxy clears the device global proxy and removes adb reverse for port.
func EnableProxyUSB ¶
EnableProxyUSB sets adb reverse and points the device global proxy at 127.0.0.1:port.
func EnableProxyWiFi ¶
EnableProxyWiFi points the device global proxy at host:port (no adb reverse).
func InstallSystemCA ¶
InstallSystemCA installs the CA into the system trust store (rooted device or emulator).
func InstallUserCA ¶
InstallUserCA pushes the CA to the device and opens the system install prompt.
func IsEmulator ¶
IsEmulator reports whether serial looks like an Android emulator (emulator-5554).
func ProxyValue ¶
ProxyValue reads the device global HTTP proxy setting.
func RemoveSystemCA ¶
RemoveSystemCA deletes the Interceptor CA from the system trust store (rooted/emulator).
Types ¶
type Device ¶
type Device struct {
Serial string `json:"serial"`
State string `json:"state"`
Model string `json:"model,omitempty"`
TransportID int `json:"transportId,omitempty"`
Emulator bool `json:"emulator,omitempty"`
SuggestedCAMode string `json:"suggestedCAMode,omitempty"`
}
Device is a connected Android device reported by adb.
func EnrichDevice ¶
EnrichDevice adds emulator detection and suggested CA mode.
type SetupOpts ¶
type SetupOpts struct {
ProxyMode string // usb (default) or wifi
CAMode string // user, system, or auto
WiFiHost string
Port int
}
SetupOpts configures a one-click Android intercept setup.
type SetupResult ¶
type SetupResult struct {
Serial string `json:"serial"`
Proxy string `json:"proxy,omitempty"`
CAMode string `json:"caMode,omitempty"`
Steps []string `json:"steps"`
NeedsUserAction bool `json:"needsUserAction,omitempty"`
Message string `json:"message"`
Warning string `json:"warning,omitempty"`
}
SetupResult is returned from Setup and Teardown.