[Soot-list] How to retrieve compile-time constant name

Steven Arzt Steven.Arzt at cased.de
Wed Jul 22 05:28:47 EDT 2015


Hi Mian,

 

I’m not exactly sure what your question is. The dx tool applies some optimizations when generating the Dalvik bytecode. One of them is to replace references to the static fields of the R classes with their actual values. Is your goal to get back the name of the field that was originally accessed in the R class? Or is your goal to find out which layout control is referenced by a given numeric ID?

 

Best regards,

  Steven

 

Von: soot-list-bounces at CS.McGill.CA [mailto:soot-list-bounces at CS.McGill.CA] Im Auftrag von Mian Wan
Gesendet: Dienstag, 21. Juli 2015 01:07
An: soot-list at CS.McGill.CA
Betreff: [Soot-list] How to retrieve compile-time constant name

 

Hi, I'm trying to retrieve the compile-time constant name (e.g. public static final int main = 2130903040) for Android apps. However, Java compiler will replace all the statement used this 

compile-time constant with its actual value. Thus, in bytecode, the constant seems in the Constant Pool.

But in Jimple code, I can see some code for method <clinit> to do initialization for this constant, in which the constant name is preserved. When I loaded this app to see all methods for this class, this <clinit> method doesn't exist in the class file.

 

Can you help me about explain why this happened and how to obtain the constant name?

 

Thanks,

 

-- 

Best,

 

Mian Wan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20150722/e6a2cc84/attachment.html 


More information about the Soot-list mailing list