Writing patches
Reference
The patch SDK's public API, by package. Wherever a type is a String, you can write a descriptor (Ljava/lang/String;), a dotted name (java.lang.String), or a Type constant.
app.reseam.patch
Declaring patches
| Symbol | Description |
|---|---|
patch(name: String) { } |
A patch users see. Returns ReseamPatch. |
patch { } |
An internal patch: hidden, runs only as a dependency. |
"pkg"("1.0", "1.1") |
String.invoke: a CompatiblePackage with versions. |
CompatiblePackage(name, versions) |
A package the patch applies to; empty versions means all. |
ReseamPatch |
The interface the engine reads: name, hidden, description, dependencies, compatibleWith, universal, enabled, options, execute(ctx), afterDependents(ctx), finalizes (whether afterDependents does work; the builder sets it). |
ExternalPatch(bundle, id) |
A patch in another bundle, for dependsOn. Generated by the build from the bundles a module declares under reseam { bundle(...) }; see Patches from another bundle. |
Inside patch { } (PatchBuilder):
| Member | Description |
|---|---|
description(text) |
Shown to users; indentation trimmed. |
compatibleWith(vararg packageNames) |
Packages, any version. |
compatibleWith(vararg packages: CompatiblePackage) |
Packages with versions. |
dependsOn(vararg patches) |
Patches that run first. |
enabledByDefault(Boolean) |
Initial selection state. Defaults to true, or false for a universal patch. |
hidden() |
Keep a named patch off the lists. |
stringOption(key, title, description, default, validValues, required) |
Declares and registers a StringOption. |
boolOption(key, title, description, default, required) |
BoolOption. |
intOption(...) |
IntOption (Long values). |
floatOption(...) |
FloatOption (Double values). |
stringListOption(...) |
StringListOption. |
pathOption(key, title, description, required) |
PathOption; a directory the user picks. |
settings(host, vararg sections) |
Registers settings; host becomes a dependency. |
settings(host) { PatchRuntime -> List<SettingsSection> } |
Registers settings computed after execute, so they can read options. |
execute { } |
The body. Receiver PatchRuntime. |
afterDependents { } |
Runs after every dependent finished. |
Hermes
See Hermes JavaScript for extension sources and examples. Targets resolve against the base APK's assets/index.android.bundle when first used.
| API | Meaning |
|---|---|
hermes: HermesScope |
The base APK's Hermes bundle, opened lazily. Supports v98. |
HermesScope.version |
Opens the bundle and returns its bytecode version. |
function(debugName?) { HermesFunctionQuery } |
Exactly one app function matching all constraints; missing and ambiguous matches fail. |
HermesFunctionQuery.name(value) |
Exact function name. |
HermesFunctionQuery.strings(vararg values) |
All strings must be referenced by instructions, including property names. |
HermesFunctionQuery.paramCount(count) |
Declared JavaScript parameters, excluding this; nonnegative. |
HermesScope.modules { AppModules } |
Declares, for the rest of the run, the app modules extensions import. module(specifier, MetroModule) names one; prefix(prefix) { path -> MetroModule } resolves every specifier starting with prefix. |
FunctionTarget.module |
The Metro module whose factory creates the function, or the function when it is a factory. Functions created outside a module, or in several, fail. |
FunctionTarget.before { JsCodeScope } |
Runs on entry; falling off the end calls the function with its arguments, as assigned. |
FunctionTarget.after { JsCodeScope } |
Runs after the function returns; result is the returned value, which falling off the end returns. |
FunctionTarget.replace { JsCodeScope } |
Runs instead of the function; falling off the end returns undefined. Earlier hooks no longer run. |
FunctionTarget.alwaysReturn(), alwaysReturnNull(), alwaysReturn(Boolean / Int / String) |
Replaces the body with a constant result. |
ExtJsModule(name) |
An extension of the bundle, such as example-features. The Gradle plugin generates one per extension, app.reseam.<folder>.bindings.<Extension>, with a property per export. |
JsCodeScope: thisObject, param(i), result (in after), int, bool, string, nullValue, undefinedValue, call(JsExport, args) and JsExport(args) (calls with this undefined), whenTrue, whenFalse, whenNull, whenNotNull, whenEqual, whenNotEqual (each returns JsOtherwise with otherwise { }), returnValue, returnUndefined, returnNull, returnTrue, returnFalse. JsValue.assign(value) overwrites a parameter, the result, or an earlier call's result.
Generators, async functions, class constructors, new.target, direct eval and unprovable environment chains fail explicitly. Hooks compose in patch order, each running around the function as earlier hooks left it. Hooked functions cannot be constructed with new. An extension links once and first runs when a hook first calls it. Exports are private; edited functions may lose debug data.
Options
| Symbol | Description |
|---|---|
Option<T> |
key, title, description, required, kind: OptionKind, default, validValues. |
OptionKind |
STRING, BOOL, INT, FLOAT, STRING_LIST, PATH. |
options[option] |
The value with defaults applied; throws when absent. |
options.getOrNull(option) |
The value or null. |
OptionPath |
path, listContents(), readFile(relativePath). |
Targets
| Symbol | Description |
|---|---|
method(debugName = null) { MethodQuery } |
The unique matching method, or the best candidate with first(). MethodTarget. |
methods(debugName = null) { MethodQuery } |
Every matching method, best ranked first. MethodsTarget. |
klass(name) |
A class by name. ClassTarget. |
klass(debugName) { ClassQuery } |
The unique matching class, or the best candidate with first(). |
ClassTarget.method(name, inherited = false) { MethodQuery } |
A method of the class by name, narrowed by the optional block. |
ClassTarget.methods(debugName = null, inherited = false) { } |
Matching methods of the class. |
ClassTarget.field(name) |
A field by name. FieldTarget. |
ClassTarget.enumConstant(name) |
The field holding the enum constant whose name() is name, even when obfuscation renamed it. FieldTarget. |
ClassTarget.fieldOfType(type) |
The one instance field of that type. |
field(owner, name, type) |
A field reference without lookup. |
methodTarget(debugName) { PatchRuntime.() -> Method } |
A method resolved by hand. |
classTarget(debugName) { PatchRuntime.() -> DexClass } |
A class resolved by hand. |
fieldTarget(debugName) { PatchRuntime.() -> FieldRef } |
A field resolved by hand. |
Target.explain() |
The MatchReport: name, winner, considered, reasons, nearMisses. |
MethodTarget: method, owner, name, proto, returnType, parameterTypes, descriptor, ref. MethodsTarget: all, forEach { }, single(), single { }. ClassTarget: classDef, descriptor. FieldTarget: ref, owner, name, type.
MethodQuery: name, strings, stringsStartingWith(prefix), literals, returns, params, param(index, type), hasParam, paramCount, flags, inClass(target, inherited = false), calls(target), calls(ref), calls { MethodRefMatch }, calledBy, callsMethod { MethodRef }, opcode, opcodeSequence, custom { Method }, rankBy(label) { MethodRankScope }, first(), includeExtensions().
ClassQuery: strings, hasInstanceField, enumConstants(vararg names), extends, implements, sourceFile, custom { DexClass }, rankBy(label) { ClassRankScope }, first(), includeExtensions().
RankScope: type, methods(proto), zeroArgListGetters(). MethodRankScope adds method, paramCount, callSitesFollowedByCast(type, lookAhead = 40). ClassRankScope adds classDef.
Points
| Symbol | Description |
|---|---|
MethodTarget.point(debugName = null) { PointMatch } |
The first instruction matching; a sequence ends at its last step. PointTarget. |
MethodTarget.points(debugName = null) { PointMatch }, MethodsTarget.points(debugName = null) { PointMatch } |
All matches in the selected methods, fetched once per method and anchored before edits. PointsTarget. |
PointsTarget.all, .forEach { }, .single() |
all and forEach resolve immediately; the block has a PointTarget receiver. single() defers resolution and fails unless exactly one point matches. |
PointTarget.redirectTo(ExtMethod) |
Redirect a static, virtual, or interface invoke to a static extension method, receiver first for instance calls. Validates access, arguments, and any consumed result; preserves branches and anchors. |
PointTarget.previous { } |
Nearest earlier match, one step. |
PointTarget.next { } |
Nearest later match, may be a sequence. On an invoke, a leading resultOf must match its immediate result. |
PointTarget.captureAs(name, type = null) |
Records the register written here for capture(name). |
PointTarget.skipWhen { condition } |
Runs the call at the point only when the condition is false; the call's result must be unused. |
PointTarget.captureArgumentAs(name, argument, type = null) |
Records the register of argument argument of the invoke here. The receiver is argument 0 of an instance invoke; a wide argument counts once. |
PointTarget.writer(argument, debugName = null) |
The instruction that wrote the argument, as a PointTarget, following register moves back to the value's producer. Fails for an incoming parameter or multiple writers, reporting the paths. |
PointTarget.callee(debugName = null) |
The invoked method as a MethodTarget, resolved to the nearest declaration up the owner's superclass chain. |
PointTarget.field(debugName = null) |
The accessed field as a FieldTarget. |
PointTarget.index, .instruction, .method |
Current index, instruction, and method target. Points follow edits; using one after body replacement fails. |
PointMatch: opcode, string, stringContains, literal, type, checkCast, newInstance, invoke(opcodes) { MethodRefMatch }, invokeStatic, invokeVirtual, invokeInterface, invokeDirect, calls(target), field { FieldRefMatch }, argument(index) { PointMatch }, resultOf(returns = null), where { Instruction }, then(within = 1) { }.
MethodRefMatch: owner, ownerAssignableTo, name, returns, params, hasParam, paramCount. FieldRefMatch: owner, name, type.
Changing methods
| Symbol | Description |
|---|---|
MethodTarget.before { CodeScope } |
Emit at entry. |
MethodTarget.after { CodeScope } |
Emit before every return; result is the return value. Referenced parameters and receiver are saved at entry in dedicated locals. |
MethodTarget.replace { CodeScope } |
Replace the body. |
appEntry { AppEntryScope } |
Emit into code that runs once at process start, first in onCreate() of the Application the final manifest names. AppEntryScope is a CodeScope whose application is the Application; it has no thisObject. Fails when the manifest names no Application. |
PointTarget.before { }, .after { } |
Emit around the instruction. before code runs on every path into the instruction, branches to it included; after code runs only when the instruction falls through. Repeated emissions at one point stack in emission order. after fails on a return, throw or goto, since nothing after it runs. |
MethodTarget.reserveLocal(name, type) |
A MethodLocal, zeroed at entry and read in blocks of the same method as local(slot). Reserves both words for a wide type; body replacement invalidates it. |
MethodTarget.alwaysReturn(), (Boolean), (Int), (Long), (String), alwaysReturnNull() |
Replace the body with a constant return. |
MethodTarget.replaceAllStrings(old, new), replaceAllLiterals(old, new) |
Rewrite constants; returns the count. |
CodeScope: thisObject, param(i), paramOfType(type), lastParam, result (in a method's after), capture(name) (a captureAs value), local(slot), int, long, bool, string, nullObject, enumValue(type, name) (a constant by its field name; see ClassTarget.enumConstant for obfuscated enums), staticField(FieldTarget | FieldRef), setStatic(FieldTarget | FieldRef, value), newInstance(type, ctorProto = "()V", vararg args), call(ExtMethod | MethodTarget, args) (fails when the extension method does not exist or the argument count does not match), ExtMethod(args) (the same as call for a static extension method), callStatic(owner, name, proto, args), whenTrue, whenFalse, whenNull, whenNotNull, whenEqual, whenNotEqual, whenInstanceOf(value, type) (each returns Otherwise with otherwise { }), returnVoid, returnValue, returnTrue, returnFalse, returnNull.
ValueRef: type, cast(type), field(FieldTarget | FieldRef), fieldOfType(type), set(field, value), assign(value) (fails on a value read from a field), call(ExtMethod | MethodTarget, args), callVirtual(owner, name, proto, args), callInterface(...), size(), get(index), plus, minus.
| Symbol | Description |
|---|---|
ExtClass(name) |
A class an extension ships: descriptor, target, and property delegates named after the property unless name is given: static(vararg params, returns = Type.Void, name = null), method(vararg params, returns = Type.Void, name = null), field(type, name = null). The build generates one for each extension class with @Export declarations, as <package>.bindings.<Class>; see Shipping your own code. |
ExtMethod |
owner, name, proto, isStatic, ref, target, implement { CodeScope }. |
Runtime
PatchRuntime (receiver of execute and afterDependents): manifest, resources, bytecode, files, options, log, explain(target).
| Scope | Members |
|---|---|
ManifestScope |
components(), component(name), packageName, versionCode, versionName, minSdkVersion, splitName, applicationClass, setVersionCode, setVersionName, setMinSdk, addPermission, setAttributeInt, setAttributeString (@type/name and ?attr become references, enum and flag names their values), setActivityConfigChanges, addIntentFilter, addActivityAlias (appended after the activities, label read like setAttributeString), copyIntentFilters (activities or aliases), addActivity(name) { XmlElement }, document(), edit { XmlDocument }. |
ResourceScope |
components(), component(name), owningComponent, setPackageName (rename with the manifest package so by-name lookups resolve), id, exists, getString, setString, add, addString, addBool, addInteger, addColor, addDimen, addId, addRaw, getRaw, path(type, name), paths(type, name), xml(type, name), editXml(type, name) { }, addFile, style(name, parent = null) { StyleScope }, getArray(name), setArray(name, values), getArrayValues(name) and setArrayValues(name, values) (raw values, no text conversion), setStringArray(name, values), poolGet, poolSet, poolAdd, poolFindRefs, replaceEntry. |
StyleScope |
set(attr, value): an <item> of the style. android:name reads the framework table, an unprefixed name the app's own attr entries. |
FileScope |
components(), component(name), list, read, sourceStream() (the original APK bytes, streamed; close it before the callback returns), signers, write, writeStored, delete, copy(bundlePath, apkPath), xml(path), editXml(path) { }. |
BytecodeScope |
classes, findClass(name), classesExtending(type), replaceAllStrings(old, new), replaceStringsContaining(substring) { old -> new? }, redirectCalls(owner, name, to), redirectCalls(from: MethodRef, to). |
PatchLogger |
info, warn, debug. |
XmlDocument |
root, findByTag, findByAttribute(name, value), createElement, declareNamespace(prefix, uri), adopt(element), close(); use { }. XmlDocument.compile(text) compiles XML text into a document backed by no APK entry. |
XmlElement |
tag, parent, children, get(attr), set(attr, value) (binds the attribute's resource id, failing when it has none; enum and flag names become their values), setInt, setBool, setResourceRef, removeAttribute, appendChild, insertBefore (returns the inserted element's handle), remove, clone(deep). appendChild and insertBefore take elements of their own document; adopt brings one over from another. A created or adopted element is used up once attached, and a handle that names no element fails the patch. |
resourceRef(value) |
@0x... or @ref/0x... as a UInt?. |
Resource file and value helpers:
Member of ResourceScope |
Description |
|---|---|
owningComponent(resType, resName), owningComponent(resId: UInt) |
Name of the component defining the resource, or null. |
path(resType, resName) |
Default configuration's APK path. Fails for a missing entry or a value that is not a file path. |
paths(resType, resName) |
Paths for every configuration defining the resource, default first. |
xml(resType, resName) |
Opens the default file as an XmlDocument, finding its component unless one was selected. Close it with use { }. |
editXml(resType, resName) { } |
Opens and closes the document around the block; returns the block's result. |
addFile(resType, name, apkPath, qualifiers = "") |
Registers an existing APK entry; returns its resource ID (UInt). Qualifiers support density, night, notnight, and vN. |
addFile(resType, name, apkPath, data: ByteArray, qualifiers = "") |
Writes and registers the file. Compiles XML, including <aapt:attr> inline resources; returns its resource ID. |
style(name, parent = null) { } |
Sets items in every existing configuration; returns the resource ID. Creating a style requires a parent. A supplied parent replaces an existing one. |
getArray(name) |
Array elements as a List<String>. |
setArray(name, values: List<String>) |
Replaces every configuration's elements, parsing references and typed values; returns the resource ID. |
setStringArray(name, values: List<String>) |
Replaces every configuration's elements with literal strings, including numbers and text starting with @; returns the resource ID. |
Bindings
| Symbol | Description |
|---|---|
bind(label) { BindingQuery } |
A BindingTarget. |
BindingTarget |
sourceType, sourceField, of(value), member(name, value). |
BindingQuery: sourceType, fromField(label) { FieldLocator }, fromMethod(target), fromClass(target), raw { PathQuery }, objectValue(name) { }, string(name) { }, context(name) { }, intValue(name) { }, bind(name, target) { }.
FieldLocator: owner, firstObjectRead, firstObjectReadAnyOwner, nearestObjectReadBeforeString, rankBy(label) { RankScope }, requireScoreAtLeast.
PathQuery: self, member(name), param(i), field(type), field(name) { FieldLocator }, field(target), instanceField(type), instanceField(types), objectSlots().firstInstanceOf(type), firstFieldRead, nextFieldRead(owner?), nextInterfaceCall(returning?, returningObject), callVirtual, callInterface, listGetter(name) { rankBy }, first, last, cast.
Types
| Symbol | Description |
|---|---|
Type |
Void, Boolean, Byte, Short, Char, Int, Long, Float, Double, Object, String, CharSequence, List, ArrayList, Map, Context, View, Activity, Application. |
descriptor(type) |
Any accepted form to a descriptor. |
className(descriptor) |
Descriptor to dotted name. |
proto(returns, vararg params) |
A method prototype string. |
MethodLocal |
A register reserved by reserveLocal: name, type. |
Capture |
A value a point recorded: name, type, register, renumbered when the frame grows. |
app.reseam.patch.settings
| Symbol | Description |
|---|---|
SettingsGroup(strings) |
Base of an object that declares settings. A setting's title is the string named after its property in snake case, its summary that name with _summary when the table has it. |
toggle(default, key = null, icon = null, covers = emptyList()) |
Property delegate for a ToggleSetting. While it is on, each toggle in covers reads as on and is greyed out on the settings screen. |
text(default, multiline = false, key = null, icon = null), folder(default, key = null, icon = null) |
Property delegates for TextSetting and FolderSetting; default is a string. A multiline text setting holds one entry per line. |
SettingDelegate<S> |
Derives an omitted key from the property name in snake case, prefixed by the declaring object's name. |
choice(default, choices, key = null, icon = null) |
ChoiceSetting with Choice(value, title). |
Setting<T> |
key, title, summary (StringRefs), default, icon. Keys are unique within a bundle; each bundle stores its settings apart. |
ChoiceSetting |
A string setting with a List<Choice>; each Choice(value, title: DisplayText) supplies the stored value and displayed title. default must be a choice. copy(default, choices) keeps the key. |
StringTable(id, names) |
Translated strings, generated from a settings module's src/main/strings, with one StringRef member per string. |
StringRef, Verbatim(text) |
DisplayText: a string of a table, shown in the app's language, or text shown as is. |
SettingsSection(title: StringRef, settings, page = null) |
A List<Setting<*>> under a heading; null page places it at the root. |
SettingsPage(id, title: StringRef, parent = null, order = 0, summary: StringRef? = null, icon = null) |
A settings page, shown as a row on its parent; parent nests it, order sorts siblings. Only populated pages and their parents appear. |
section(title, vararg settings) |
A root SettingsSection. |
section(page, title, vararg settings) |
A section on a page; sections with the same page and title merge. |
settingsHost(appId) { } |
An internal patch giving the app the running bundle's settings screen: compatibleWith, dependsOn, settings(vararg sections) for the host's own sections, strings(vararg tables) for tables extensions read beyond those the settings use, brand(Brand), install { PatchRuntime }. It writes assets/reseam/<bundle>/ (settings, brand font, string tables) and the app runtime's strings, and starts the app runtime first in the Application's onCreate. One host per bundle and app. |
SettingsHost |
A ReseamPatch with appId; register(patch, sections) collects contributions. PatchBuilder.settings registers them during execution. |
CodeScope.openSettings() |
Opens the running bundle's settings over the app's current screen. |
XmlElement.opensSettings() |
Makes an <intent> element open the running bundle's settings through Reseam.startActivity. |
Reseam |
The app runtime's entry ExtClass: startActivity(Context, Intent) opens settings for an intent opensSettings set up, and starts any other intent. |
ReseamReactPackage |
addTo(List) adds the React Native package Hermes gates read settings through to the app's package list, once however many bundles call it. |
Brand(name, light, dark, logo = null, font = null, typography = Typography()) |
How the settings screen and branded components look. Brand.DEFAULT is Material 3's baseline in the system font. |
ColorScheme(...) |
The Material 3 roles the app runtime paints with, from primary to scrim. |
Color.hex(value) |
#rgb, #rrggbb, or #aarrggbb. |
Typography(headlineSmall, titleLarge, titleMedium, bodyLarge, bodyMedium, labelLarge, labelMedium) |
Type roles, defaulting to Material 3's; each a TextStyle(size, lineHeight, weight, tracking = 0) in sp. |
Font(file) |
A TrueType or OpenType file; a variable font with a wght axis renders every weight. |
Logo(light, dark = light) |
A brand's mark for each theme. |
Vector.svg(source) |
A vector image from an SVG: paths and basic shapes with fills and strokes; currentColor takes the screen's icon color. |
CodeScope.whenEnabled(toggle) { } |
Branch on a toggle at runtime; returns Otherwise. |
gate(toggle) { GateScope } |
Hooks inside take effect only while the toggle is on. |
GateScope |
MethodTarget and PointTarget before { }, after { }; MethodTarget.alwaysReturn(), alwaysReturnNull(), alwaysReturn(Boolean / Int / Long / String); PointTarget.skip(); FunctionTarget.before { }, after { }, replace { }, alwaysReturn(), alwaysReturnNull(), alwaysReturn(Boolean / Int / String), setArgument(index, path, value). |
app.reseam.patch.dex
| Symbol | Description |
|---|---|
Method |
Handle to a method. Reads: info, classDef, descriptor, name, owner, proto, returnType, parameterTypes, isStatic, instructions, instructionCount, registersSize, insSize, outsSize, dexIndex, registerA..D(index), wideLiteral, stringRef, methodRef, fieldRef, typeRef. Searches: indexOfFirst, indexOfFirstReversed, indexOfFirstLiteral, indexOfFirstLiteralReversed, containsLiteral, indexOfFirstString, findAllIndices, indexOfFirstMethodCall, indexOfFirstFieldAccess, indexOfOpcodeSequence (null matches any one instruction), indexOfFirstInstruction { }, indexOfFirstInstructionReversed { }. Mutation: alwaysReturn*, setInstructions, replaceBody, insertInstruction(s), addInstructions(index) { }, replaceInstruction, removeInstruction(s), replaceString, replaceAllStrings, replaceLiteral, replaceAllLiterals, replaceMethodCall, ensureOutsSize, growLocalRegisters, findFreeRegister(s), findContiguousFreeRegisters, setAccessFlags, clone, remove, addAnnotation. |
DexClass |
Handle to a class: info, descriptor, superclass, interfaces, sourceFile, isInterface, methods, directMethods, virtualMethods, fields, staticFields, instanceFields, superclassChain (nearest first, across every DEX of the app, ending where the platform starts), method(name, proto?), field(name), setAccessFlags, setSuperclass, addInterface, definal, remove, addMethod, addField, removeField, setFieldAccessFlags, setStaticFieldValue, addAnnotation, addFieldAnnotation. |
FieldInfo.ref |
The FieldRef of a field. |
Instruction.* |
opcodeValue, opcode, regA, regB, regC, invokeRegisters, methodRef, fieldRef, stringValue, typeRef, literal, referencedRegisters, invokeArgumentTypes (what an invoke passes, receiver first), codeUnitSize. |
MethodRef.*, MethodInfo.* |
returnType, parameterTypes, descriptor; MethodInfo.isStatic. |
parseParameterTypes(proto), registerWordCount(type), isReferenceType(type) |
Descriptor helpers. |
Opcode |
Enum of Dalvik opcodes: value, isInvoke, isReturn, isMoveResult, rangeVariant, Opcode.of(value). |
AccessFlags |
Flag constants; Int.isSet(flags) for any bit of the mask, Int.allSet(flags) for every bit. |
InstructionBuilder, buildInstructions { } |
See Raw bytecode. |
lowerInvokes(insns, scratch) |
Rewrites invokes the 35c format cannot encode into range form. |
app.reseam.patch.types
Generated from the engine's Rust types. Import the data types below from here. The raw engine calls that the other packages wrap live in app.reseam.patch.native; patch code does not call them, and they change with the engine.
| Symbol | Description |
|---|---|
Instruction |
One instruction. Variants: Simple, Reg1, Reg2, Reg3, RegLiteral, RegString, RegType, RegField, Invoke, InvokeRange, Polymorphic, PolymorphicRange, Custom, CustomRange, RegHandle, RegProto, Branch0, Branch, Branch2, FilledArray, FilledArrayRange, PackedSwitchData, SparseSwitchData, FillArrayData, Raw. Each holds its payload as field0: an *Insn record, or the bytes for Raw. Read it through the Instruction.* properties. |
MethodRef |
definingClass, name, proto. |
FieldRef |
definingClass, name, fieldType. |
MethodInfo |
Method.info: classDescriptor, methodName, proto, accessFlags, dexIndex, registerCount, insSize, outsSize, instructionCount. |
ClassInfo |
DexClass.info: descriptor, accessFlags, superclass, interfaces, sourceFile, dexIndex, directMethodCount, virtualMethodCount, staticFieldCount, instanceFieldCount. |
FieldInfo |
DexClass.fields: classDescriptor, name, fieldType, accessFlags, initialValue. |
NewMethod |
DexClass.addMethod: name, proto, accessFlags, registersSize, insSize, outsSize, instructions, tries: List<TryItem>, catchHandlers: List<CatchHandler>. |
NewField |
DexClass.addField: name, fieldType, accessFlags, initialValue. |
AnnotationItem |
addAnnotation, addFieldAnnotation: visibility, annotationType, elements: List<AnnotationElement> of name and value. |
EncodedVal |
A constant: Null, BoolVal, ByteVal, ShortVal, CharVal, IntVal, LongVal, FloatVal, DoubleVal, StringVal, TypeVal, each holding field0. |
ResourceRef |
ResourceScope.poolFindRefs: resId, keyName. |