Guest User

Untitled

a guest
Dec 13th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. public static void main(String[] s) throws Exception{
  2. ClassGen cg = new ClassGen(new ClassParser("Client.class").parse());
  3. ConstantPoolGen cPoolGen = cg.getConstantPool();
  4.  
  5. Field f = new FieldGen(Constants.ACC_PUBLIC, Type.INT, "test", cPoolGen).getField();
  6. cg.addField(f);
  7. /*for(Method a : cg.getMethods()){
  8. if(a.getName().equals("a")){
  9. a.setAccessFlags(Constants.ACC_PUBLIC);
  10. }
  11. }*/
  12. cg.getJavaClass().dump("Loader2.class");
  13. }
  14.  
  15. }
Add Comment
Please, Sign In to add comment