WALA
WALA copied to clipboard
Initial values of static fields in DexIField
Hello, In Java static fields with initial values are initialized in <clinit>. However in dex bytecode static fields are not initialized in <clinit> and the initial values are stored in an array (For more information check static_values_off in https://source.android.com/devices/tech/dalvik/dex-format).
Dexlib2 has a way to access the initial value of a static field: org.jf.dexlib2.iface.Field :: getInitialValue(). However I do not see this feature integrated anywhere in WALA. Is it possible to do this somehow and if not could you support it?
Thanks in advance, Sifis.
It sounds like what we need to is use the getInitialValue API for each static field in the class, and add initialization of each field to the static
Sorry my initial message missed the word "<clinit>" in two places due to formatting. What you suggest would solve this problem. Thank you.