<div dir="ltr">Hi,<div><br></div><div>I am novice in soot, and I want to analyse some Java projects. But there is some puzzle during the jimple analysis.</div><div><br></div><div>In my analysis, I want to get the definition of the class fields, including the field name, attributes, and value. But there is something wrong.</div><div><br></div><div>For the following class bat, I define a "final static" field "TEST_FIELD", and a "static" field "TEST_FIELD2". But in the jimple code, the "final static TEST_FIELD" is simplified as "100". I tried to find it in the "<clinit>" method. However, when I got the units in "<clinit>" method, I couldn't find the assignment for the "final static TEST_FIELD<span class="sew9h0lvea05cqo"></span><span class="sewu3f1zns02zqe"></span>". More weird, if I delete the definition of "public static int TEST_FIELD2 = 100", I cannot even get the "<clinit>" method by API "<span style="color:rgb(78,144,114);font-family:Monaco;font-size:11px">SootClass.getMethodByName()<span class="sew9h0lvea05cqo"></span><span class="sewu3f1zns02zqe"></span></span>".<br></div><div><span class="sewu3f1zns02zqe"></span></div><div><br></div><div><div><i><font face="tahoma, sans-serif">public class bat{</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">     </span>public static final int TEST_FIELD = 100;</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">    </span>public static int TEST_FIELD2 = 100;</font></i></div><div><i><font face="tahoma, sans-serif"><br></font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">        </span>public int method1(int a){</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">           </span>return TEST_FIELD+a;</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre"> </span>}</font></i></div><div><i><font face="tahoma, sans-serif"><br></font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">   </span>public static void main(String[] args){</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">              </span>bat b = new bat();</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">           </span>int a = 0;</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">           </span>int r1 = b.method1(b.TEST_FIELD);</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">            </span>int r2 = b.method1(b.TEST_FIELD2);</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">           </span>System.out.println(r1);</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">              </span>System.out.println(r2);</font></i></div><div><i><font face="tahoma, sans-serif"><span class="Apple-tab-span" style="white-space:pre">      </span>}</font></i></div><div><i><font face="tahoma, sans-serif">}<span class="sew9h0lvea05cqo"></span><span class="sewu3f1zns02zqe"></span></font></i></div></div><div><i><font face="tahoma, sans-serif"><br></font></i></div><div><font face="arial, helvetica, sans-serif">So, my question is : how could I get access to the definition of this "static final" field.</font></div><div><br></div><div><br></div><div><br></div></div>