Package sootup.apk.frontend.interceptors
Class DexArrayIndexConstantInliner
java.lang.Object
sootup.apk.frontend.interceptors.DexArrayIndexConstantInliner
- All Implemented Interfaces:
BodyInterceptor
Inlines constant array indices.
Dex has no array instruction with an immediate index: arr[1] = x compiles to
const/4 v0, 1; aput v1, v2, v0, so the Jimple index is a local (arr[v0] = x) where
javac-compiled bytecode has the constant (arr[1] = x). This rewrites an array index local
to its constant when every definition reaching that use assigns the same int constant, so dex
bodies get the same shape as bytecode bodies and an analysis can tell array elements apart.
Reaching definitions follow normal and exceptional predecessors, so a definition that reaches a handler only through an exception is not missed. A use with any non-constant reaching definition, or with none found, is left unchanged.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinterceptBody(@NonNull Body.BodyBuilder builder, @NonNull View view) Takes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.
-
Constructor Details
-
DexArrayIndexConstantInliner
public DexArrayIndexConstantInliner()
-
-
Method Details
-
interceptBody
Description copied from interface:BodyInterceptorTakes a BodyBuilder and may apply a transformation to it, for example removing unused local variables.- Specified by:
interceptBodyin interfaceBodyInterceptor
-