Skip to content

Commit

Permalink
Properly intern fields when unreflecting
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebFenton committed Feb 15, 2016
1 parent cf80ad3 commit 9c92290
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.jf.dexlib2.iface.reference.MethodReference;
import org.jf.dexlib2.immutable.reference.ImmutableMethodReference;
import org.jf.dexlib2.util.ReferenceUtil;
import org.jf.dexlib2.writer.builder.BuilderField;
import org.jf.dexlib2.writer.builder.BuilderMethod;
import org.jf.dexlib2.writer.builder.BuilderTypeReference;
import org.slf4j.Logger;
Expand Down Expand Up @@ -165,8 +166,10 @@ private BuilderInstruction buildFieldGetReplacement(int address) {
String type = parts[1];

boolean isStatic = false;
FieldReference fieldRef = manipulator.getDexBuilder().internField(className, fieldName, type,
BuilderField builderField = manipulator.getDexBuilder().internField(className, fieldName, type,
field.getModifiers(), null, null);
FieldReference fieldRef = manipulator.getDexBuilder().internFieldReference(builderField);

isStatic = Modifier.isStatic(field.getModifiers());
Opcode newOp = getGetOpcode(type, isStatic);

Expand Down

0 comments on commit 9c92290

Please sign in to comment.