1. Keywords That Smali must master

.locals represents the number of v open registers used within the method. Prologue represents the beginning of the code in the method. Line indicates the number of rows in the corresponding Java. .annotation/.end Annotation indicates the beginning and end of a comment. .implements represents an interface implementation. .field defines the field. .method/.end method indicates the start and end of a method. .class indicates the package name + class name. . Super indicates the name of the superclass. . Source Indicates the name of the source file. .param specifies the parameters of the method.

(Note: # indicates comments)

2. Several key format parsing

.class < access permission modifier >[non-access permission modifier] < class name >.super< parent name >.source< source file name > A detailed explanation of the above format access permission modifiers are called public, protected, private. Non-permission modifiers are final, abstract, or static.

.implements < interface name >. Field describes the definition of the field, #static fields. Field < access > static[modifier]< field name >:< variable type

Common variable #instance fields. Field < access modifier > [non-access modifier] < variable name >:< variable type >

Virtual methods: Methods that can be overwritten, including public and protected methods

Method < access modifier >[non-access modifier]< method prototype > <.locals> <.prologue> <.line>.. .end

Several relatively special usage. The constructor method XXX () V / / class final variable initialization method XXX constructor () V / / in the class structure lines. The method static synthetic MethodName (XXXX)V // A method with the modifier synthetic

3. Data type

There are eight basic data types in Dalvik bytecode. Objects and arrays are reference types. Basic data types and return types are represented by an uppercase letter. An object type is represented by a capital LETTER L plus the fully qualified name of the object, such as Ljava/lang/String for a String object type. One-dimensional arrays are represented by a ‘[‘ with type or object type added.

Z(Boolean),B(byte),S(short),C(char),I(int),L(long),F(float),D(double)

Data definition instructions are used to define the constants, strings, classes, and other data types used in code. The underlying bytecode is const

The lock instruction is used to operate on the same object in multithreaded programs. Monitor-enter vAA: obtains the lock for the specified object (vAA). Monitor-exit vAA: releases the lock for the specified object (vAA).

Wide indicates that the data width of the instruction operation is 64 bits wide