Help us shape the future of Go! Take the 2026 Go Developer Survey

dex

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractFromDEX

func ExtractFromDEX(data []byte) (map[string]TransactionCodes, error)

ExtractFromDEX parses a single DEX file and extracts TRANSACTION_* constants from all $Stub classes. Returns a map of fully qualified interface name to TransactionCodes.

func ExtractFromJAR

func ExtractFromJAR(path string) (map[string]TransactionCodes, error)

ExtractFromJAR opens a JAR (ZIP) file, finds all DEX files inside, and extracts TRANSACTION_* constants from all $Stub inner classes. Returns a map of fully qualified interface name to TransactionCodes.

Example key: "android.app.IActivityManager"

func ExtractSignaturesFromJAR added in v0.0.8

func ExtractSignaturesFromJAR(path string) (map[string]MethodSignatures, error)

ExtractSignaturesFromJAR opens a JAR (ZIP) file, finds all DEX files inside, and extracts method signatures from all $Stub$Proxy inner classes. Returns a map of fully qualified interface name to MethodSignatures.

Types

type JARContents added in v0.0.8

type JARContents struct {
	Codes      map[string]TransactionCodes
	Signatures map[string]MethodSignatures
}

JARContents holds both transaction codes and method signatures extracted from a single JAR file in one pass.

func ExtractAllFromJAR added in v0.0.8

func ExtractAllFromJAR(path string) (*JARContents, error)

ExtractAllFromJAR opens a JAR (ZIP) file and extracts both TRANSACTION_* constants (from $Stub classes) and method signatures (from $Stub$Proxy classes) in a single pass over the DEX data. This avoids parsing the same JAR twice.

type MethodSignatures added in v0.0.8

type MethodSignatures map[string][]string

MethodSignatures maps method names to their parameter type descriptor lists. Example: {"registerClient": ["Landroid/os/ParcelUuid;", "Landroid/bluetooth/IBluetoothGattCallback;", "Z", "Landroid/content/AttributionSource;"]}

func ExtractDescriptorSignaturesFromJAR added in v0.0.8

func ExtractDescriptorSignaturesFromJAR(
	path string,
	descriptor string,
) (MethodSignatures, error)

ExtractDescriptorSignaturesFromJAR extracts method signatures for a single AIDL interface from a JAR file. The descriptor uses dot notation (e.g., "android.app.IActivityManager"). Returns nil, nil if the descriptor is not found.

type TransactionCodes

type TransactionCodes map[string]uint32

TransactionCodes maps AIDL method names to their binder transaction codes. Method names use the original AIDL camelCase (e.g., "isUserAMonkey").

func ExtractDescriptorFromJAR

func ExtractDescriptorFromJAR(
	path string,
	descriptor string,
) (TransactionCodes, error)

ExtractDescriptorFromJAR extracts transaction codes for a single AIDL interface from a JAR file. The descriptor uses dot notation (e.g., "android.app.IActivityManager"). Returns nil, nil if the descriptor is not found in this JAR.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL