java assist 如何获取混淆器混淆之后的类的final字段

德莫罗 发布于 2014/05/03 21:32
阅读 413
收藏 0

这是一个混淆之后的类,如何通过java assist 获取里面的final field,已经尝试过getdeclaredFields的方式,但是获取出来的是 a b c 之类的东西。

这个类是在一个jar 里面,在工程里通过classpath 引用。

public class uY
  implements RemotingApp
{
  private final String jdField_a_of_type_JavaLangString;
  private final String jdField_b_of_type_JavaLangString;
  private final byte[] jdField_a_of_type_ArrayOfByte;
  private final String jdField_c_of_type_JavaLangString;
  private final File jdField_a_of_type_JavaIoFile;
  private final File jdField_b_of_type_JavaIoFile;
  private final String jdField_d_of_type_JavaLangString;
  private final String e;
  private final File jdField_c_of_type_JavaIoFile;
  private final File jdField_d_of_type_JavaIoFile;
  private final boolean jdField_a_of_type_Boolean;
  private final yU jdField_a_of_type_ComZeroturnaroundJavarebelYU;
  private final Map jdField_a_of_type_JavaUtilMap;
  private final Map jdField_b_of_type_JavaUtilMap;
  private Transaction jdField_a_of_type_OrgZeroturnaroundJavarebelRemotingTransaction;
  private String f;
  private long jdField_a_of_type_Long;
  private final Set jdField_a_of_type_JavaUtilSet;
  private final Set jdField_b_of_type_JavaUtilSet;



一下是获取filed的代码
ClassPool pool = ClassPool.getDefault();
        try {
            CtClass entity =pool.get("com.zeroturnaround.javarebel.uY");
            CtField[] fields = entity.getFields();
            for (CtField f:fields){
                System.out.println("field signatur : "+f.getSignature());
                System.out.println("field name : "+f.getName());
            }



        }catch (Exception e){
            e.printStackTrace();
        }




加载中
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部