private static void createDecryptMethod(MethodNode mn,boolean isStatic){
  if (isStatic) {
    mn.visitCode();
    mn.visitInsn(Opcodes.ICONST_0);
    mn.visitVarInsn(Opcodes.ISTORE,3);
    mn.visitInsn(Opcodes.ICONST_0);
    mn.visitVarInsn(Opcodes.ISTORE,4);
    Label lbl0=new Label();
    mn.visitJumpInsn(Opcodes.GOTO,lbl0);
    Label lbl1=new Label();
    mn.visitLabel(lbl1);
    mn.visitFrame(Opcodes.F_APPEND,2,new Object[]{Opcodes.INTEGER,Opcodes.INTEGER},0,null);
    mn.visitVarInsn(Opcodes.ALOAD,0);
    mn.visitVarInsn(Opcodes.ILOAD,4);
    mn.visitInsn(Opcodes.CALOAD);
    mn.visitVarInsn(Opcodes.ISTORE,5);
    mn.visitVarInsn(Opcodes.ALOAD,1);
    mn.visitVarInsn(Opcodes.ILOAD,3);
    mn.visitVarInsn(Opcodes.ALOAD,1);
    mn.visitMethodInsn(Opcodes.INVOKEVIRTUAL,"java/lang/String","length","()I",false);
    mn.visitInsn(Opcodes.IREM);
    mn.visitMethodInsn(Opcodes.INVOKEVIRTUAL,"java/lang/String","charAt","(I)C",false);
    mn.visitVarInsn(Opcodes.ISTORE,6);
    mn.visitVarInsn(Opcodes.ILOAD,5);
    mn.visitVarInsn(Opcodes.ILOAD,2);
    mn.visitInsn(Opcodes.IADD);
    mn.visitVarInsn(Opcodes.ILOAD,6);
    mn.visitInsn(Opcodes.ISUB);
    mn.visitInsn(Opcodes.I2C);
    mn.visitVarInsn(Opcodes.ISTORE,7);
    mn.visitVarInsn(Opcodes.ALOAD,0);
    mn.visitVarInsn(Opcodes.ILOAD,4);
    mn.visitVarInsn(Opcodes.ILOAD,7);
    mn.visitInsn(Opcodes.CASTORE);
    mn.visitIincInsn(3,1);
    mn.visitIincInsn(4,1);
    mn.visitLabel(lbl0);
    mn.visitFrame(Opcodes.F_SAME,0,null,0,null);
    mn.visitVarInsn(Opcodes.ILOAD,4);
    mn.visitVarInsn(Opcodes.ALOAD,0);
    mn.visitInsn(Opcodes.ARRAYLENGTH);
    mn.visitJumpInsn(Opcodes.IF_ICMPLT,lbl1);
    mn.visitTypeInsn(Opcodes.NEW,"java/lang/String");
    mn.visitInsn(Opcodes.DUP);
    mn.visitVarInsn(Opcodes.ALOAD,0);
    mn.visitMethodInsn(Opcodes.INVOKESPECIAL,"java/lang/String","<init>","([C)V",false);
    mn.visitInsn(Opcodes.ARETURN);
    mn.visitMaxs(3,8);
    mn.visitEnd();
  }
 else {
    mn.visitCode();
    mn.visitInsn(Opcodes.ICONST_0);
    mn.visitVarInsn(Opcodes.ISTORE,4);
    mn.visitInsn(Opcodes.ICONST_0);
    mn.visitVarInsn(Opcodes.ISTORE,5);
    Label l0=new Label();
    mn.visitJumpInsn(Opcodes.GOTO,l0);
    Label l1=new Label();
    mn.visitLabel(l1);
    mn.visitFrame(Opcodes.F_APPEND,2,new Object[]{Opcodes.INTEGER,Opcodes.INTEGER},0,null);
    mn.visitVarInsn(Opcodes.ALOAD,1);
    mn.visitVarInsn(Opcodes.ILOAD,5);
    mn.visitInsn(Opcodes.CALOAD);
    mn.visitVarInsn(Opcodes.ISTORE,6);
    mn.visitVarInsn(Opcodes.ALOAD,2);
    mn.visitVarInsn(Opcodes.ILOAD,4);
    mn.visitVarInsn(Opcodes.ALOAD,2);
    mn.visitMethodInsn(Opcodes.INVOKEVIRTUAL,"java/lang/String","length","()I",false);
    mn.visitInsn(Opcodes.IREM);
    mn.visitMethodInsn(Opcodes.INVOKEVIRTUAL,"java/lang/String","charAt","(I)C",false);
    mn.visitVarInsn(Opcodes.ISTORE,7);
    mn.visitVarInsn(Opcodes.ILOAD,6);
    mn.visitVarInsn(Opcodes.ILOAD,3);
    mn.visitInsn(Opcodes.IADD);
    mn.visitVarInsn(Opcodes.ILOAD,7);
    mn.visitInsn(Opcodes.ISUB);
    mn.visitInsn(Opcodes.I2C);
    mn.visitVarInsn(Opcodes.ISTORE,8);
    mn.visitVarInsn(Opcodes.ALOAD,1);
    mn.visitVarInsn(Opcodes.ILOAD,5);
    mn.visitVarInsn(Opcodes.ILOAD,8);
    mn.visitInsn(Opcodes.CASTORE);
    mn.visitIincInsn(4,1);
    mn.visitIincInsn(5,1);
    mn.visitLabel(l0);
    mn.visitFrame(Opcodes.F_SAME,0,null,0,null);
    mn.visitVarInsn(Opcodes.ILOAD,5);
    mn.visitVarInsn(Opcodes.ALOAD,1);
    mn.visitInsn(Opcodes.ARRAYLENGTH);
    mn.visitJumpInsn(Opcodes.IF_ICMPLT,l1);
    mn.visitTypeInsn(Opcodes.NEW,"java/lang/String");
    mn.visitInsn(Opcodes.DUP);
    mn.visitVarInsn(Opcodes.ALOAD,1);
    mn.visitMethodInsn(Opcodes.INVOKESPECIAL,"java/lang/String","<init>","([C)V",false);
    mn.visitInsn(Opcodes.ARETURN);
    mn.visitMaxs(3,9);
    mn.visitEnd();
  }
}

private static void createDecryptMethod ( MethodNode mn , boolean isStatic ) { if ( isStatic ) { mn . visitCode ( ) ; mn . visitInsn ( Opcodes . ICONST_0 ) ; mn . visitVarInsn ( Opcodes . ISTORE , 3 ) ; mn . visitInsn ( Opcodes . ICONST_0 ) ; mn . visitVarInsn ( Opcodes . ISTORE , 4 ) ; Label lbl0 = new Label ( ) ; mn . visitJumpInsn ( Opcodes . GOTO , lbl0 ) ; Label lbl1 = new Label ( ) ; mn . visitLabel ( lbl1 ) ; mn . visitFrame ( Opcodes . F_APPEND , 2 , new Object [ ] { Opcodes . INTEGER , Opcodes . INTEGER } , 0 , null ) ; mn . visitVarInsn ( Opcodes . ALOAD , 0 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 4 ) ; mn . visitInsn ( Opcodes . CALOAD ) ; mn . visitVarInsn ( Opcodes . ISTORE , 5 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 1 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 3 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 1 ) ; mn . visitMethodInsn ( Opcodes . INVOKEVIRTUAL , "java/lang/String" , "length" , "()I" , false ) ; mn . visitInsn ( Opcodes . IREM ) ; mn . visitMethodInsn ( Opcodes . INVOKEVIRTUAL , "java/lang/String" , "charAt" , "(I)C" , false ) ; mn . visitVarInsn ( Opcodes . ISTORE , 6 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 5 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 2 ) ; mn . visitInsn ( Opcodes . IADD ) ; mn . visitVarInsn ( Opcodes . ILOAD , 6 ) ; mn . visitInsn ( Opcodes . ISUB ) ; mn . visitInsn ( Opcodes . I2C ) ; mn . visitVarInsn ( Opcodes . ISTORE , 7 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 0 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 4 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 7 ) ; mn . visitInsn ( Opcodes . CASTORE ) ; mn . visitIincInsn ( 3 , 1 ) ; mn . visitIincInsn ( 4 , 1 ) ; mn . visitLabel ( lbl0 ) ; mn . visitFrame ( Opcodes . F_SAME , 0 , null , 0 , null ) ; mn . visitVarInsn ( Opcodes . ILOAD , 4 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 0 ) ; mn . visitInsn ( Opcodes . ARRAYLENGTH ) ; mn . visitJumpInsn ( Opcodes . IF_ICMPLT , lbl1 ) ; mn . visitTypeInsn ( Opcodes . NEW , "java/lang/String" ) ; mn . visitInsn ( Opcodes . DUP ) ; mn . visitVarInsn ( Opcodes . ALOAD , 0 ) ; mn . visitMethodInsn ( Opcodes . INVOKESPECIAL , "java/lang/String" , "<init>" , "([C)V" , false ) ; mn . visitInsn ( Opcodes . ARETURN ) ; mn . visitMaxs ( 3 , 8 ) ; mn . visitEnd ( ) ; } else { mn . visitCode ( ) ; mn . visitInsn ( Opcodes . ICONST_0 ) ; mn . visitVarInsn ( Opcodes . ISTORE , 4 ) ; mn . visitInsn ( Opcodes . ICONST_0 ) ; mn . visitVarInsn ( Opcodes . ISTORE , 5 ) ; Label l0 = new Label ( ) ; mn . visitJumpInsn ( Opcodes . GOTO , l0 ) ; Label l1 = new Label ( ) ; mn . visitLabel ( l1 ) ; mn . visitFrame ( Opcodes . F_APPEND , 2 , new Object [ ] { Opcodes . INTEGER , Opcodes . INTEGER } , 0 , null ) ; mn . visitVarInsn ( Opcodes . ALOAD , 1 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 5 ) ; mn . visitInsn ( Opcodes . CALOAD ) ; mn . visitVarInsn ( Opcodes . ISTORE , 6 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 2 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 4 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 2 ) ; mn . visitMethodInsn ( Opcodes . INVOKEVIRTUAL , "java/lang/String" , "length" , "()I" , false ) ; mn . visitInsn ( Opcodes . IREM ) ; mn . visitMethodInsn ( Opcodes . INVOKEVIRTUAL , "java/lang/String" , "charAt" , "(I)C" , false ) ; mn . visitVarInsn ( Opcodes . ISTORE , 7 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 6 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 3 ) ; mn . visitInsn ( Opcodes . IADD ) ; mn . visitVarInsn ( Opcodes . ILOAD , 7 ) ; mn . visitInsn ( Opcodes . ISUB ) ; mn . visitInsn ( Opcodes . I2C ) ; mn . visitVarInsn ( Opcodes . ISTORE , 8 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 1 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 5 ) ; mn . visitVarInsn ( Opcodes . ILOAD , 8 ) ; mn . visitInsn ( Opcodes . CASTORE ) ; mn . visitIincInsn ( 4 , 1 ) ; mn . visitIincInsn ( 5 , 1 ) ; mn . visitLabel ( l0 ) ; mn . visitFrame ( Opcodes . F_SAME , 0 , null , 0 , null ) ; mn . visitVarInsn ( Opcodes . ILOAD , 5 ) ; mn . visitVarInsn ( Opcodes . ALOAD , 1 ) ; mn . visitInsn ( Opcodes . ARRAYLENGTH ) ; mn . visitJumpInsn ( Opcodes . IF_ICMPLT , l1 ) ; mn . visitTypeInsn ( Opcodes . NEW , "java/lang/String" ) ; mn . visitInsn ( Opcodes . DUP ) ; mn . visitVarInsn ( Opcodes . ALOAD , 1 ) ; mn . visitMethodInsn ( Opcodes . INVOKESPECIAL , "java/lang/String" , "<init>" , "([C)V" , false ) ; mn . visitInsn ( Opcodes . ARETURN ) ; mn . visitMaxs ( 3 , 9 ) ; mn . visitEnd ( ) ; } }
creates a decrypt method in a given method node .
