Class writing, call graph, eclipse project
This commit is contained in:
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Class extends PoolEntry
|
||||
@@ -22,4 +23,10 @@ public class Class extends PoolEntry
|
||||
UTF8 u = (UTF8) this.getPool().getEntry(index);
|
||||
return u.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeShort(index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Double extends PoolEntry
|
||||
@@ -29,4 +30,10 @@ public class Double extends PoolEntry
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeDouble(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Field extends PoolEntry
|
||||
@@ -29,4 +30,11 @@ public class Field extends PoolEntry
|
||||
{
|
||||
return (NameAndType) this.getPool().getEntry(nameAndTypeIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeShort(classIndex);
|
||||
out.writeShort(nameAndTypeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Float extends PoolEntry
|
||||
@@ -23,4 +24,10 @@ public class Float extends PoolEntry
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeFloat(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Integer extends PoolEntry
|
||||
@@ -23,4 +24,10 @@ public class Integer extends PoolEntry
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeInt(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class InterfaceMethod extends PoolEntry
|
||||
@@ -29,4 +30,11 @@ public class InterfaceMethod extends PoolEntry
|
||||
{
|
||||
return (NameAndType) this.getPool().getEntry(nameAndTypeIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeShort(classIndex);
|
||||
out.writeShort(nameAndTypeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Long extends PoolEntry
|
||||
@@ -29,4 +30,10 @@ public class Long extends PoolEntry
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeLong(value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Method extends PoolEntry
|
||||
@@ -29,4 +30,11 @@ public class Method extends PoolEntry
|
||||
{
|
||||
return (NameAndType) this.getPool().getEntry(nameAndTypeIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeShort(classIndex);
|
||||
out.writeShort(nameAndTypeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -87,4 +88,11 @@ public class NameAndType extends PoolEntry
|
||||
return true;
|
||||
return !methodRefType.endsWith(")V");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeShort(nameIndex);
|
||||
out.writeShort(descriptorIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package info.sigterm.deob.pool;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
public abstract class PoolEntry
|
||||
@@ -12,11 +15,18 @@ public abstract class PoolEntry
|
||||
this.pool = pool;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public abstract void write(DataOutputStream out) throws IOException;
|
||||
|
||||
public ConstantPool getPool()
|
||||
{
|
||||
return pool;
|
||||
}
|
||||
|
||||
public ConstantType getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getSlots()
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class String extends PoolEntry
|
||||
@@ -23,4 +24,10 @@ public class String extends PoolEntry
|
||||
{
|
||||
return this.getPool().getEntry(stringIndex).getObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
out.writeShort(stringIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package info.sigterm.deob.pool;
|
||||
import info.sigterm.deob.ConstantPool;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class UTF8 extends PoolEntry
|
||||
@@ -51,4 +52,14 @@ public class UTF8 extends PoolEntry
|
||||
{
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutputStream out) throws IOException
|
||||
{
|
||||
java.lang.String s = getValue();
|
||||
byte[] bytes = s.getBytes("UTF-8");
|
||||
|
||||
out.writeShort(bytes.length);
|
||||
out.write(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user