Basic Knowledge

Here we provide some basic knowledge to help you better understand the usage of DexKit. Experienced developers can skip this section.

When using DexKit, there are some fundamental concepts you need to understand, including but not limited to:

  • Dex Decompilation Tools
  • JVM Signatures
    • Primitive Type Signatures
    • Reference Type Signatures
    • Array Type Signatures
    • Method Signatures
    • Field Signatures

Notice

The content in the basic knowledge is not necessarily completely accurate. Please read it according to your own understanding. If you find any inaccuracies, feel free to point them out and help improve.

Decompilation Tools

Usually, you can use jadxopen in new window to meet most of your needs. It can restore readable Java code in most cases.

JVM Signatures

Primitive Types (PrimitiveType)

Type SignaturePrimitive TypeSize (Bytes)
Vvoid-
Zboolean1
Bbyte1
Cchar2
Sshort2
Iint4
Jlong8
Ffloat4
Ddouble8

Reference Types (ReferenceType)

Reference types are divided into classes and arrays.

Class (ClassType)

The type signature of a class starts with L, followed by the fully qualified name (FullClassName) of the class, and ends with ;. For example, Ljava/lang/String; represents the java.lang.String class.

For example:

Type SignatureJava Type Definition
Ljava/lang/String;java.lang.String
Ljava/util/List;java.util.List

Array (ArrayType)

The type signature of an array starts with [, followed by the type signature of the array elements. For example, [[I represents a two-dimensional array where the element type is int.

For example:

Type SignatureJava Type Definition
[Iint[]
[[Cchar[][]
[Ljava/lang/String;java.lang.String[]

Tips

The term 'class' and 'type' are not entirely equivalent: 'type' is Type, while 'class' is Class. 'Class' is a subset of 'type'. For example:

  • java.lang.Integer is a 'class' and also a 'type'
  • java.lang.Integer[] is an 'array type', but not a 'class'
  • int is a 'primitive type', but not a 'class'

For method parameters, return types, and field types, we use the term 'type,' specifically 'Type.'

Method Signatures

A method signature consists of the signature of the return type and the signature of the parameter types. For example, ()V represents a parameterless void method.

For example:

For ease of description, all methods in the table are named as function.

Method SignatureJava Method Definition
()Vvoid function()
(I)Vvoid function(int)
(II)Vvoid function(int, int)
(ILjava/lang/String;J)Vvoid function(int, java.lang.String, long)
(I[II)Vvoid function(int, int[], int)
([[Ljava/lang/String;)Vvoid function(java.lang.String[][])
()[Ljava/lang/String;java.lang.String[] function()

Dalvik Descriptor

In a Dex file, we can represent specific classes, methods, or fields using the 'Dalvik Descriptor.' In DexKit API, the term 'descriptor' is commonly used.

Class Descriptor

The format of a class descriptor is [class signature], such as Ljava/lang/String;.

Method Descriptor

The format of a method descriptor is [class signature]->[method name][method signature], such as Ljava/lang/String;->length()I.

Tips

In 'Dalvik Descriptor,' the method name for constructors is <init>, and for static initialization methods, it's <clinit>. Therefore, in DexKit, to find constructors, you need to use <init> as the method name.

Field Descriptor

The format of a field descriptor is [class signature]->[field name]:[type signature], such as Ljava/lang/String;->count:I.

Tips

In DexKit, the className/Type query parameter only supports the Java primitive syntax. For example:

  • For primitive types, use Java PrimitiveType forms like void, int, boolean.
  • For reference types, use FullClassName forms like java.lang.String or java/lang/String.
  • For array types, use ArrayTypeName forms like int[], java.lang.String[][] or java/lang/String[][].