Quick Reference Guide

This section introduces the structure components of DexKit queries. Matcher objects can be recursively nested, and all conditions are optional.

FindClass

Field NameTypeDescription
searchPackagesCollection<String>List of package names to search
excludePackagesCollection<String>List of excluded package names
ignorePackagesCaseBooleanWhether to ignore package name case
searchInCollection<ClassData>Search for classes in the specified list of classes
findFirstBooleanReturn the first result found immediately; results are not guaranteed to be unique due to multi-threading
matcherClassMatcherMatching conditions

FindField

Field NameTypeDescription
searchPackagesCollection<String>List of package names to search
excludePackagesCollection<String>List of excluded package names
ignorePackagesCaseBooleanWhether to ignore package name case
searchInClassesCollection<ClassData>Search for fields in the specified list of classes
searchInFieldsCollection<FieldData>Search for fields in the specified list of fields
findFirstBooleanReturn the first result found immediately; results are not guaranteed to be unique due to multi-threading
matcherFieldMatcherMatching conditions

FindMethod

Field NameTypeDescription
searchPackagesCollection<String>List of package names to search
excludePackagesCollection<String>List of excluded package names
ignorePackagesCaseBooleanWhether to ignore package name case
searchInClassesCollection<ClassData>Search for methods in the specified list of classes
searchInMethodsCollection<MethodData>Search for methods in the specified list of methods
findFirstBooleanReturn the first result found immediately; results are not guaranteed to be unique due to multi-threading
matcherMethodMatcherMatching conditions

BatchFindClassUsingStrings

Field NameTypeDescription
searchPackagesCollection<String>List of package names to search
excludePackagesCollection<String>List of excluded package names
ignorePackagesCaseBooleanWhether to ignore package name case
searchInCollection<ClassData>Search for classes in the specified list of classes
matchersCollection<StringMatchersGroup>List of query groups using strings

BatchFindMethodUsingStrings

Field NameTypeDescription
searchPackagesCollection<String>List of package names to search
excludePackagesCollection<String>List of excluded package names
ignorePackagesCaseBooleanWhether to ignore package name case
searchInClassesCollection<ClassData>Search for methods in the specified list of classes
searchInMethodsCollection<MethodData>Search for methods in the specified list of methods
matchersCollection<StringMatchersGroup>List of query groups using strings

AccessFlagsMatcher

Field NameTypeDescription
modifiersIntBit masks for matching modifiers
matchTypeMatchTypeMatching mode

AnnotationEncodeValueMatcher

Field NameTypeDescription
byteValueByteMatched byte
shortValueShortMatched short integer
charValueCharMatched character
intValueIntMatched integer
longValueLongMatched long integer
floatValueFloatMatched float
doubleValueDoubleMatched double precision float
stringValueStringMatcherMatched string
methodValueMethodMatcherMatched method
enumValueFieldMatcherMatched enumeration
arrayValueAnnotationEncodeArrayMatcherMatched array
annotationValueAnnotationMatcherMatched annotation
nullValueNoneMatch null
boolValueBooleanMatched boolean

IntRange

Field NameTypeDescription
minIntMinimum value, default is 0
maxIntMaximum value, default is Int.MAX_VALUE

NumberEncodeValueMatcher

Field NameTypeDescription
byteValueByteMatched byte
shortValueShortMatched short integer
charValueCharMatched character
intValueIntMatched integer
longValueLongMatched long integer
floatValueFloatMatched float
doubleValueDoubleMatched double precision float

OpcodesMatcher

Field NameTypeDescription
opCodesCollection<Int>Matched Int values of opcodes
opNamesCollection<String>Matched names of opcodes (as per smali syntax)
matchTypeOpCodeMatchTypeMatching mode
sizeIntRangeTotal length range of the opcode

StringMatcher

Field NameTypeDescription
valueStringMatched string
matchTypeStringMatchTypeMatching mode
ignoreCaseBooleanIgnore case sensitivity

TargetElementTypesMatcher

Field NameTypeDescription
typesCollection<TargetElementType>List of matched annotation element types
matchTypeMatchTypeMatching mode

AnnotationElementMatcher

Field NameTypeDescription
nameStringMatcherMatched name
valueAnnotationEncodeValueMatcherMatched value

AnnotationElementsMatcher

Field NameTypeDescription
elementsCollection<AnnotationElementMatcher>List of matched annotation elements
matchTypeMatchTypeMatching mode
countIntRangeNumber of matched elements

AnnotationEncodeArrayMatcher

Field NameTypeDescription
valuesCollection<AnnotationEncodeValueMatcher>List of matched annotation elements
matchTypeMatchTypeMatching mode
countIntRangeNumber of matched elements

AnnotationMatcher

Field NameTypeDescription
typeClassMatcherMatched annotation type
targetElementTypesTargetElementTypesMatcherList of matched annotation element types
policyRetentionPolicyTypeMatched retention policy
elementsAnnotationElementsMatcherList of matched annotation elements
usingStringsCollection<StringMatcher>List of strings used in the annotation

AnnotationsMatcher

Field NameTypeDescription
annotationsCollection<AnnotationMatcher>List of matched annotations
matchTypeMatchTypeMatching mode
countIntRangeNumber of matched annotations

ClassMatcher

Field NameTypeDescription
sourceStringMatcherSource file name of the class, i.e., .source field in smali
classNameStringMatcherName of the class
modifiersAccessFlagsMatcherModifiers of the class
superClassClassMatcherSuperclass of the class
interfacesInterfacesMatcherList of interfaces implemented by the class
annotationsAnnotationsMatcherList of annotations for the class
fieldsFieldsMatcherList of fields in the class
methodsMethodsMatcherList of methods in the class
usingStringsCollection<StringMatcher>List of strings used in the class

InterfacesMatcher

Field NameTypeDescription
interfacesCollection<ClassMatcher>List of matched interfaces
matchTypeMatchTypeMatching mode
countIntRangeNumber of matched interfaces

FieldMatcher

Field NameTypeDescription
nameStringMatcherName of the field
modifiersAccessFlagsMatcherModifiers of the field
declaredClassClassMatcherDeclaring class of the field
typeClassMatcherType of the field
annotationsAnnotationsMatcherList of annotations for the field
readMethodsMethodsMatcherList of methods to read the field
writeMethodsMethodsMatcherList of methods to write the field

FieldsMatcher

Field NameTypeDescription
fieldsCollection<FieldMatcher>List of matched fields
matchTypeMatchTypeMatching mode
countIntRangeNumber of matched fields

MethodMatcher

Field NameTypeDescription
nameStringMatcherName of the method
modifiersAccessFlagsMatcherModifiers of the method
declaredClassClassMatcherDeclaring class of the method
returnTypeClassMatcherReturn type of the method
paramsParametersMatcherList of parameters
annotationsAnnotationsMatcherList of annotations for the method
opCodesOpcodesMatcherList of opcodes for the method
usingStringsCollection<StringMatcher>List of strings used in the method
usingFieldsCollection<UsingFieldMatcher>List of fields used in the method
usingNumbersCollection<Number>List of numbers used in the method
invokeMethodsMethodsMatcherList of methods invoked by the method
callerMethodsMethodsMatcherList of methods that call the method

MethodsMatcher

Field NameTypeDescription
methodsCollection<MethodMatcher>List of matched methods
matchTypeMatchTypeMatching mode
countIntRangeNumber of matched methods

ParameterMatcher

Field NameTypeDescription
typeClassMatcherType of the parameter
annotationsAnnotationsMatcherList of annotations for the parameter

ParametersMatcher

Field NameTypeDescription
paramsCollection<ParameterMatcher>List of matched parameters
countIntRangeNumber of matched parameters

StringMatchersGroup

Field NameTypeDescription
groupNameStringGroup name for the query
matchersCollection<StringMatcher>List of strings used in the query

UsingFieldMatcher

Field NameTypeDescription
fieldFieldMatcherMatched field
usingTypeUsingTypeType of usage

EncodeValueByte

Field NameTypeDescription
valueBytebyte value

EncodeValueShort

Field NameTypeDescription
valueShortshort integer value

EncodeValueChar

Field NameTypeDescription
valueCharcharacter value

EncodeValueInt

Field NameTypeDescription
valueIntinteger value

EncodeValueLong

Field NameTypeDescription
valueLonglong integer value

EncodeValueFloat

Field NameTypeDescription
valueFloatfloat value

EncodeValueDouble

Field NameTypeDescription
valueDoubledouble value

EncodeValueString

Field NameTypeDescription
valueStringstring value

EncodeValueNull

This object has no fields.

EncodeValueBoolean

Field NameTypeDescription
valueBooleanboolean value

Enumerations

AnnotationEncodeValueType

Field NameTypeDescription
ByteValueEnumByte type
ShortValueEnumShort integer type
CharValueEnumCharacter type
IntValueEnumInteger type
LongValueEnumLong integer type
FloatValueEnumFloat type
DoubleValueEnumDouble precision float type
StringValueEnumString type
TypeValueEnumType type
MethodValueEnumMethod type
EnumValueEnumEnum type
ArrayValueEnumArray type
AnnotationValueEnumAnnotation type
NullValueEnumNull type
BoolValueEnumBoolean type

AnnotationVisibilityType

Refer to Visibility valuesopen in new window

Field NameTypeDescription
BuildEnumVisible at build time
RuntimeEnumVisible at runtime
SystemEnumVisible to the system

MatchType

Field NameTypeDescription
ContainsEnumContains
EqualsEnumEquals

NumberEncodeValueType

Field NameTypeDescription
ByteValueEnumByte type
ShortValueEnumShort integer type
CharValueEnumCharacter type
IntValueEnumInteger type
LongValueEnumLong integer type
FloatValueEnumFloat type
DoubleValueEnumDouble precision float type

OpCodeMatchType

Field NameTypeDescription
ContainsEnumContains
StartsWithEnumStarts with
EndsWithEnumEnds with
EqualsEnumEquals

RetentionPolicyType

This Enum corresponds to java.lang.annotation.RetentionPolicy.

Field NameTypeDescription
SourceEnumSource level
ClassEnumClass level
RuntimeEnumRuntime level

StringMatchType

Field NameTypeDescription
ContainsEnumContains
StartsWithEnumStarts with
EndsWithEnumEnds with
SimilarRegexEnumRegex-like pattern, supporting only ^ and $
EqualsEnumEquals

TargetElementType

This Enum corresponds to java.lang.annotation.ElementType.

Field NameTypeDescription
TypeEnumType
FieldEnumField
MethodEnumMethod
ParameterEnumParameter
ConstructorEnumConstructor
LocalVariableEnumLocal variable
AnnotationTypeEnumAnnotation type
PackageEnumPackage
TypeParameterEnumType parameter
TypeUseEnumType use

UsingType

Field NameTypeDescription
AnyEnumAny usage
GetEnumGet usage
SetEnumSet usage