104 lines
2.8 KiB
Java
104 lines
2.8 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package com.tridium.asm;
|
|
|
|
import com.tridium.asm.AttributeInfo;
|
|
import com.tridium.asm.Buffer;
|
|
import com.tridium.asm.ConstantPool;
|
|
import com.tridium.asm.FieldInfo;
|
|
import com.tridium.asm.MethodInfo;
|
|
import java.util.ArrayList;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class Assembler {
|
|
public final int thisClass;
|
|
public final int superClass;
|
|
public final int[] interfaces;
|
|
public final int accessFlags;
|
|
public final ConstantPool cp;
|
|
private ArrayList fields;
|
|
private ArrayList methods;
|
|
private ArrayList attributes;
|
|
|
|
public void addField(FieldInfo fieldInfo) {
|
|
this.fields.add(fieldInfo);
|
|
}
|
|
|
|
public void addMethod(MethodInfo methodInfo) {
|
|
this.methods.add(methodInfo);
|
|
}
|
|
|
|
public void addAttribute(AttributeInfo attributeInfo) {
|
|
this.attributes.add(attributeInfo);
|
|
}
|
|
|
|
public Buffer compile() {
|
|
Buffer buffer = new Buffer();
|
|
buffer.u4(-889275714);
|
|
buffer.u2(3);
|
|
buffer.u2(45);
|
|
buffer.u2(this.cp.count + 1);
|
|
buffer.append(this.cp.buf);
|
|
buffer.u2(this.accessFlags);
|
|
buffer.u2(this.thisClass);
|
|
buffer.u2(this.superClass);
|
|
buffer.u2(this.interfaces.length);
|
|
int n = 0;
|
|
while (n < this.interfaces.length) {
|
|
buffer.u2(this.interfaces[n]);
|
|
++n;
|
|
}
|
|
buffer.u2(this.fields.size());
|
|
n = 0;
|
|
while (n < this.fields.size()) {
|
|
((FieldInfo)this.fields.get(n)).compile(buffer);
|
|
++n;
|
|
}
|
|
buffer.u2(this.methods.size());
|
|
n = 0;
|
|
while (n < this.methods.size()) {
|
|
((MethodInfo)this.methods.get(n)).compile(buffer);
|
|
++n;
|
|
}
|
|
buffer.u2(this.attributes.size());
|
|
n = 0;
|
|
while (n < this.attributes.size()) {
|
|
((AttributeInfo)this.attributes.get(n)).compile(buffer);
|
|
++n;
|
|
}
|
|
return buffer;
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.cp = new ConstantPool();
|
|
this.fields = new ArrayList();
|
|
this.methods = new ArrayList();
|
|
this.attributes = new ArrayList();
|
|
}
|
|
|
|
public Assembler(String string, String string2, int n, String[] stringArray) {
|
|
this.this();
|
|
this.thisClass = this.cp.cls(string);
|
|
int n2 = 0;
|
|
if (string2 != null) {
|
|
n2 = this.cp.cls(string2);
|
|
}
|
|
this.superClass = n2;
|
|
this.accessFlags = n;
|
|
int n3 = 0;
|
|
if (stringArray != null) {
|
|
n3 = stringArray.length;
|
|
}
|
|
this.interfaces = new int[n3];
|
|
int n4 = 0;
|
|
while (n4 < this.interfaces.length) {
|
|
this.interfaces[n4] = this.cp.cls(stringArray[n4]);
|
|
++n4;
|
|
}
|
|
}
|
|
}
|
|
|