soot
soot copied to clipboard
How to setType for a SootField?
I have modified the Type of some SootField,e.g I set Runnable type to it's implements (A), Code be like: SootField f = assignStmt.getFieldRef().getField(); SootClass fclz = f.getDeclaringClass(); f.setType(RightType); // logger.warn("Test:{}:",RightType instanceof RefLikeType); // f.setDeclaringClass(fclz); assignStmt.getFieldRef().setFieldRef(f.makeRef());
when I logger this modified field's signature immediately,it looks good,however when I get it in other Unit,it can't keep type A,it remains Runnable,and it's Signature also changed from <xx.xx.mainActivity:A xxx> to <androidx.appcompat.app.AppCompatActivity: java.lang.Runnable xxx>
So How Can I modify a field correctly?
it's implements A looks like mainActivity$1