/** * Creates a new ConstantAdder that will copy constants into the given * target class. */ public ConstantAdder(ProgramClass targetClass) { constantPoolEditor = new ConstantPoolEditor(targetClass); }
/** * Creates a new InstructionSequenceBuilder. * @param targetClass the target class for the instruction * constants. */ public InstructionSequenceBuilder(ProgramClass targetClass) { this(new ConstantPoolEditor(targetClass)); }
/** * Creates a new InstructionSequenceBuilder. * @param targetClass the target class for the instruction * constants. */ public InstructionSequenceBuilder(ProgramClass targetClass) { this(new ConstantPoolEditor(targetClass)); }
public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute) { // Fix the source file attribute. sourceFileAttribute.u2sourceFileIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSourceFileAttribute); }
public void visitSourceDirAttribute(Clazz clazz, SourceDirAttribute sourceDirAttribute) { // Fix the source file attribute. sourceDirAttribute.u2sourceDirIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSourceFileAttribute); } }
public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute) { // Fix the source file attribute. sourceFileAttribute.u2sourceFileIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSourceFileAttribute); }
public void visitSourceDirAttribute(Clazz clazz, SourceDirAttribute sourceDirAttribute) { // Fix the source file attribute. sourceDirAttribute.u2sourceDirIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSourceFileAttribute); } }
/** * Creates a new ConstantAdder that will copy constants into the given * target class. */ public ConstantAdder(ProgramClass targetClass) { constantPoolEditor = new ConstantPoolEditor(targetClass); bootstrapMethodsAttributeAdder = new BootstrapMethodsAttributeAdder(targetClass); }
public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute) { // Fix the source file attribute. sourceFileAttribute.u2sourceFileIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSourceFileAttribute); }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Update the Class entry if required. String newName = ClassObfuscator.newClassName(clazz); if (newName != null) { // Refer to a new Utf8 entry. classConstant.u2nameIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newName); } } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Update the Class entry if required. String newName = ClassObfuscator.newClassName(clazz); if (newName != null) { // Refer to a new Utf8 entry. classConstant.u2nameIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newName); } } }
public void visitClassConstant(Clazz clazz, ClassConstant classConstant) { // Update the Class entry if required. String newName = ClassObfuscator.newClassName(clazz); if (newName != null) { // Refer to a new Utf8 entry. classConstant.u2nameIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newName); } } }
/** * Creates a new SimplifiedClassEditor for the given class. * * @param programClass the class to be edited. */ public SimplifiedClassEditor(ProgramClass programClass) { this.programClass = programClass; classEditor = new ClassEditor(programClass); constantPoolEditor = new ConstantPoolEditor(programClass); nameFactory = UniqueMemberNameFactory.newInjectedMemberNameFactory(programClass); }
/** * Creates a new SimplifiedClassEditor for the given class. * * @param programClass the class to be edited. */ public SimplifiedClassEditor(ProgramClass programClass) { this.programClass = programClass; classEditor = new ClassEditor(programClass); constantPoolEditor = new ConstantPoolEditor(programClass); nameFactory = UniqueMemberNameFactory.newInjectedMemberNameFactory(programClass); }
/** * Creates a new SimplifiedClassEditor for the given class. * * @param programClass the class to be edited. */ public SimplifiedClassEditor(ProgramClass programClass) { this.programClass = programClass; classEditor = new ClassEditor(programClass); constantPoolEditor = new ConstantPoolEditor(programClass); nameFactory = UniqueMemberNameFactory.newInjectedMemberNameFactory(programClass); }
public void visitLocalVariableTypeInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, LocalVariableTypeInfo localVariableTypeInfo) { // Has the signature changed? String signature = clazz.getString(localVariableTypeInfo.u2signatureIndex); String newSignature = newDescriptor(signature, localVariableTypeInfo.referencedClasses); if (!signature.equals(newSignature)) { localVariableTypeInfo.u2signatureIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSignature); } }
public void visitSignatureAttribute(Clazz clazz, SignatureAttribute signatureAttribute) { // Compute the new signature. String signature = clazz.getString(signatureAttribute.u2signatureIndex); String newSignature = newDescriptor(signature, signatureAttribute.referencedClasses); if (!signature.equals(newSignature)) { signatureAttribute.u2signatureIndex = new ConstantPoolEditor((ProgramClass)clazz).addUtf8Constant(newSignature); } }
/** * Finds or creates a class constant for the given reference value, and * returns its index in the constant pool. */ private int createClassConstant(ProgramClass programClass, ReferenceValue referenceValue) { return new ConstantPoolEditor(programClass).addClassConstant(referenceValue.getType(), referenceValue.getReferencedClass()); }
/** * Finds or creates a class constant for the given reference value, and * returns its index in the constant pool. */ private int createClassConstant(ProgramClass programClass, ReferenceValue referenceValue) { return new ConstantPoolEditor(programClass).addClassConstant(referenceValue.getType(), referenceValue.getReferencedClass()); }
public void visitProgramClass(ProgramClass programClass) { constantPoolEditor = new ConstantPoolEditor(programClass); // Visit all methods that have "NEWARRAY" instructions. programClass.methodsAccept( new AllAttributeVisitor( new ArrayInitializationFilter( this))); }