3.0.0的一些bug表现和建议
-
插件没编译版本好像用1.8的项目build的时候会提示 java.lang.UnsupportedClassVersionError: com/github/megatronking/stringfog/plugin/StringFogPlugin has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 尝试解决:按其他两个模块一样增加就没问题了 targetCompatibility = '1.7' sourceCompatibility = '1.7'
-
两个ClassVisitor没有支持ASM高版本吧,构造方法里面还是 Opcodes.ASM5 肯定报错的 NestHost requires ASM7 尝试解决:Opcodes.ASM5 改为 Opcodes.ASM9
-
线上运行兼容问题,因为有些sdk用了旧版本的IStringFog接口 要是应用层用3.0.0肯定报错的 ava.lang.NoSuchMethodError: No virtual method decrypt(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; in class Lcom/github/megatronking/stringfog/xor/StringFogImpl; or its super classes (declaration of 'com.github.megatronking.stringfog.xor.StringFogImpl' appears in 尝试解决:建议考虑下兼容问题,来个IStringFogV3?然后判断一下版本
-
不知道用byte的方式性能会怎样,有出现过jvm的OOM,也出现过下面这个MethodTooLargeException org.objectweb.asm.MethodTooLargeException: Method too large: androidx/core/util/PatternsCompat 尝试解决:加了下面的两点
-
建议增加不加密的包 尝试解决:空加密里面增加判断 private static boolean isInExcludePackages(String[] excludePackages, String className) { if (TextUtils.isEmpty(className)) { return false; } if (excludePackages == null || excludePackages.length == 0) { return false; } for (String package : excludePackages) { if (className.replace('/', '.').startsWith(package + ".")) { return true; } } return false; }
-
建议只混淆当前模块的代码,其他库代码不管