internal

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHeaderSize = errors.New("invalid header size")
)

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Visibility byte
	AnnotationValue
}

func NewAnnotation

func NewAnnotation(p Parser) (Annotation, error)

type AnnotationElement

type AnnotationElement struct {
	NameID uint64
	Value  Value
}

type AnnotationValue

type AnnotationValue struct {
	Header   EncodedAnnotationHeader
	Elements []AnnotationElement
}

type Array

type Array struct {
	Size   uint64
	Values []Value
}

func NewArray

func NewArray(p Parser) (Array, error)

type Class

type Class struct {
	StaticFields   []Field
	InstanceFields []Field
	Methods        []Method
	VirtualMethods []Method
	StaticValues   Array

	RawClass defs.ClassDef
}

func NewClass

func NewClass(p Parser, def defs.ClassDef) (Class, error)

type Dex

type Dex struct {
	Header          defs.DexHeader
	StringDefs      []defs.StringDef
	MethodProtoDefs []defs.MethodProtoDef
	MethodDefs      []defs.MethodDef
	ClassDefs       []defs.ClassDef
	FieldDefs       []defs.FieldDef
	TypeIDs         []uint32

	AuxiliaryStrings map[int]struct{}
	// contains filtered or unexported fields
}

func NewDex

func NewDex(p Parser) (Dex, error)

func (*Dex) SanitizeAnnotations

func (d *Dex) SanitizeAnnotations() error

type EncodedAnnotationHeader

type EncodedAnnotationHeader struct {
	TypeID uint64
	Size   uint64
}

type Field

type Field struct {
	IndexDiff   uint64
	AccessFlags uint64
}

func NewField

func NewField(p Parser) (Field, error)

type Method

type Method struct {
	IndexDiff   uint64
	AccessFlags uint64

	CodeItem defs.CodeItem
	// contains filtered or unexported fields
}

func NewMethod

func NewMethod(p Parser) (Method, error)

func (*Method) ParseCode

func (m *Method) ParseCode(p Parser) error

type Parser

type Parser interface {
	ReadULEB128() (uint64, error)
	ReadSLEB128() (int64, error)
	ReadBytes(n int64) ([]byte, error)
	ReadByte() (byte, error)
	ReadUint64() (uint64, error)
	ReadUint32() (uint32, error)
	ReadUint16() (uint16, error)
	ReadStruct(any) error
	SetCursorTo(offset int64) error
	SkipN(n int64) error
}

type Value

type Value struct {
	Type            ValueType
	Size            byte
	Pad             int16
	Value           int64
	ArrayValue      *Array
	AnnotationValue *AnnotationValue
}

func NewValue

func NewValue(p Parser) (Value, error)

type ValueType

type ValueType int8
const (
	ValueTypeByte ValueType = iota

	ValueTypeShort
	ValueTypeChar
	ValueTypeInt

	ValueTypeLong

	ValueTypeFloat
	ValueTypeDouble

	ValueTypeMethodType
	ValueTypeMethodHandle
	ValueTypeString
	ValueTypeType
	ValueTypeField
	ValueTypeMethod
	ValueTypeEnum
	ValueTypeArray
	ValueTypeAnnotation
	ValueTypeNull
	ValueTypeBoolean
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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