protected void internalTransform(Body b, String phaseName, Map<String, String> options) {
if (b.getMethod().getName().indexOf("<clinit>") >= 0) {
return;
}
int weight = soot.jbco.Main.getWeight(phaseName, b.getMethod().getSignature());
if (weight == 0) {
return;
}
PatchingChain<Unit> units = b.getUnits();
Iterator<Unit> iter = units.snapshotIterator();
while (iter.hasNext()) {
Unit u = (Unit) iter.next();
if (u instanceof PushInst) {
SootField f = CollectConstants.constantsToFields.get(((PushInst) u).getConstant());
if (f != null && Rand.getInt(10) <= weight) {
Unit get = Baf.v().newStaticGetInst(f.makeRef());
units.insertBefore(get, u);
BodyBuilder.updateTraps(get, u, b.getTraps());
units.remove(u);
updated++;
}
}
}
}
}