Add field references, only for getstatic currently
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
package info.sigterm.deob;
|
||||
|
||||
import info.sigterm.deob.attributes.Attributes;
|
||||
import info.sigterm.deob.attributes.code.Instruction;
|
||||
import info.sigterm.deob.pool.UTF8;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Field
|
||||
{
|
||||
@@ -14,6 +17,8 @@ public class Field
|
||||
private int descriptorIndex;
|
||||
private Attributes attributes;
|
||||
|
||||
private ArrayList<Instruction> instructions = new ArrayList<Instruction>(); // instructions which reference this field
|
||||
|
||||
Field(Fields fields) throws IOException
|
||||
{
|
||||
this.fields = fields;
|
||||
@@ -30,4 +35,21 @@ public class Field
|
||||
{
|
||||
return fields;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
UTF8 u = (UTF8) fields.getClassFile().getPool().getEntry(nameIndex);
|
||||
return u.getValue();
|
||||
}
|
||||
|
||||
public String getDescriptor()
|
||||
{
|
||||
UTF8 u = (UTF8) fields.getClassFile().getPool().getEntry(descriptorIndex);
|
||||
return u.getValue();
|
||||
}
|
||||
|
||||
public void addReference(Instruction ins)
|
||||
{
|
||||
instructions.add(ins);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user