Package sootup.apk.frontend.interceptors
Class DexSharedConstantSplitter
java.lang.Object
sootup.apk.frontend.interceptors.DexSharedConstantSplitter
- All Implemented Interfaces:
BodyInterceptor
Gives each statement that uses a shared constant its own copy of the constant, like Soot's
dexpler does with its
SharedInitializationLocalSplitter.
Dex constants have no type: const/4 v0, 0 can be the int 0, false, the float
0.0 or null, and the verifier checks each use on its own, so one register can feed uses
of different types:
l = 0; useInt(l); useObject(l);The number and null transformers decide per local, so one of the uses would get a constant of the wrong type. After this interceptor, each using statement has its own local:
l = 0; useInt(l); l#c1 = 0; useObject(l#c1);
It handles locals with a single definition that assigns an int or long constant, so it runs
after a LocalSplitter and before the dex transformers. The copy is assigned right before
the statement that uses it.
-
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
-
DexSharedConstantSplitter
public DexSharedConstantSplitter()
-
-
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
-