反编译 Class 文件的工具——CFR

本文最后更新于:1 年前

Reference

java -jar cfr.jar --help

选项描述(类型)默认值
-‌-aexagg(boolean)
-‌-aexagg2(boolean)
-‌-aggressivedocopy(int >= 0) default: 0
-‌-aggressivedoextension(boolean)
-‌-aggressiveduff(boolean)
-‌-aggressivesizethreshold通过积极应用语义安全但有破坏性的转换例如删除忽略的存储来简化静态分配分析,从而更好地处理巨大的代码块(int >= 0) default: 13000
-‌-allowcorrecting(boolean) default: true
-‌-allowmalformedswitch(boolean)
-‌-analyseas(One of [DETECT, JAR, WAR, CLASS])
-‌-antiobf处理基本整数例如 /0控制流混淆(boolean) default: false
-‌-arrayiter不反编译出变长参数的语法糖实现(boolean) default: true if class file from version 49.0 (Java 5) or greater
-‌-caseinsensitivefs(boolean) default: true
-‌-clobber避免覆盖文件(boolean)
-‌-collectioniter不反编译出增强 for 循环的语法糖实现(boolean) default: true if class file from version 49.0 (Java 5) or greater
-‌-commentmonitors(boolean) default: false
-‌-comments输出调整 - 每个方法注释块、类注释等(boolean) default: true
-‌-constobf折叠反编译的常量表达式(boolean) default: Value of option ‘antiobf’
-‌-decodeenumswitch不反编译出switch-on-enum的语法糖实现(boolean) default: true if class file from version 49.0 (Java 5) or greater
-‌-decodefinally不反编译出finally的语法糖实现(boolean) default: true
-‌-decodelambdas不反编译出lambda的语法糖实现(boolean) default: true if class file from version 52.0 (Java 8) or greater
-‌-decodestringswitch不反编译出switch-on-string的语法糖实现(boolean) default: true if class file from version 51.0 (Java 7) or greater
-‌-dumpclasspath(boolean) default: false
-‌-eclipse允许禁用规范化 eclipse 输出的转换(boolean) default: true
-‌-elidescala通过删除 serialVersionUID 和 ScalaSignature 可能对其他语言有帮助使阅读反编译的 scala 更容易(boolean) default: false
-‌-extraclasspath允许搜索 helper jar 进行分析(string)
-‌-forbidanonymousclasses(boolean) default: false
-‌-forbidmethodscopedclasses(boolean) default: false
-‌-forceclassfilever(string, specifying either java version as ‘j6’, ‘j1.0’, or classfile as ‘56’, ‘56.65535’)
-‌-forcecondpropagate(boolean)
-‌-forceexceptionprune积极的异常剥离 - 删除无意义的异常块以获得更清晰的代码(boolean)
-‌-forcereturningifs(boolean)
-‌-forcetopsort当代码看起来不正确时添加了一种激进的拓扑排序,改进了 dex2jar 输出(boolean)
-‌-forcetopsortaggress(boolean)
-‌-forcetopsortnopull(boolean)
-‌-forloopaggcapture允许循环捕获多个更新(boolean)
-‌-hidebridgemethods(boolean) default: Value of option ‘obfattr’
-‌-hidelangimports隐藏 java.lang 导入(boolean) default: true
-‌-hidelongstrings(boolean) default: false
-‌-hideutf解码 unicode 文字(boolean) default: true
-‌-ignoreexceptions忽略异常当异常表非常混乱以至于无法检索到任何有意义的内容时,这很有用(boolean) default: false
-‌-ignoreexceptionsalways(boolean) default: false
-‌-importfilter(string)
-‌-innerclasses反编译内部类(boolean) default: true
-‌-instanceofpattern反编译instanceof 模板(boolean) default: true if class file from version 60.0 (Java 16) or greater, or experimental in 58.0 (Java 14), 59.0 (Java 15)
-‌-j14classobj不反编译出类常量的初始化(boolean) default: false if class file from version 49.0 (Java 5) or greater
-‌-jarfilter允许 jar 处理采用正则表达式提取哪些类(string)
-‌-labelledblocks(boolean) default: true
-‌-lenient允许对奇怪排序的异常处理程序进行排序(boolean) default: false
-‌-liftconstructorinit不反编译出类变量的初始化(boolean) default: true
-‌-lomem(boolean) default: false
-‌-methodname(string)
-‌-obfattr(boolean) default: Value of option ‘antiobf’
-‌-obfcontrol(boolean) default: Value of option ‘antiobf’
-‌-obfuscationpath支持反混淆映射文件(string)
-‌-outputdir(string)
-‌-outputencoding(string)
-‌-outputpath(string)
-‌-override生成 @Override 注释(boolean) default: true if class file from version 50.0 (Java 6) or greater
-‌-previewfeatures(boolean) default: true
-‌-pullcodecase(boolean) default: false
-‌-recordtypes不反编译出record的语法糖实现(boolean) default: true if class file from version 60.0 (Java 16) or greater, or experimental in 58.0 (Java 14), 59.0 (Java 15)
-‌-recover在反编译失败的情况下停止任何使用额外选项覆盖的尝试(boolean) default: true
-‌-recovertypeclash(boolean)
-‌-recovertypehints(boolean)
-‌-reducecondscope(boolean)
-‌-relinkconst(boolean) default: true
-‌-relinkconststring用猜测的源静态最终替换字符串常量(boolean) default: Value of option ‘relinkconst’
-‌-removebadgenerics不反编译出泛型的语法糖实现(boolean) default: true
-‌-removeboilerplate不反编译出序列化时 lambda的语法糖实现(boolean) default: true
-‌-removedeadconditionals(boolean)
-‌-removedeadmethods(boolean) default: true
-‌-removeinnerclasssynthetics不反编译出内部类的语法糖实现(boolean) default: true
-‌-rename(boolean) default: false
-‌-renamedupmembers(boolean) default: Value of option ‘rename’
-‌-renameenumidents(boolean) default: Value of option ‘rename’
-‌-renameillegalidents(boolean) default: Value of option ‘rename’
-‌-renamesmallmembers(int >= 0) default: 0
-‌-sealed支持密封类(boolean) default: true if class file from version 62.0 (Java 18) or greater, or experimental in 60.0 (Java 16), 61.0 (Java 17)
-‌-showinferrable(boolean) default: false if class file from version 51.0 (Java 7) or greater
-‌-showversion(boolean) default: true
-‌-silent(boolean) default: false
-‌-skipbatchinnerclasses(boolean) default: true
-‌-staticinitreturn(boolean) default: true
-‌-stringbuffer反编译出【JDK 5-】**+**的语法糖实现(boolean) default: false if class file from version 49.0 (Java 5) or greater
-‌-stringbuilder不反编译出【JDK 8-】**+**的语法糖实现(boolean) default: true if class file from version 49.0 (Java 5) or greater
-‌-stringconcat不反编译出【JDK 9+】**+**的语法糖实现(boolean) default: true if class file from version 53.0 (Java 9) or greater
-‌-sugarasserts不反编译出断言的语法糖实现(boolean) default: true
-‌-sugarboxing不反编译出自动装箱/拆箱的语法糖实现(boolean) default: true
-‌-sugarenums不反编译出枚举的语法糖实现(boolean) default: true if class file from version 49.0 (Java 5) or greater
-‌-sugarretrolambda(boolean) default: false
-‌-switchexpression反编译switch 表达式(boolean) default: true if class file from version 58.0 (Java 14) or greater, or experimental in 56.0 (Java 12), 57.0 (Java 13)
-‌-tidymonitors(boolean) default: true
-‌-trackbytecodeloc(boolean) default: false
-‌-tryresources不反编译出try-with-resources的语法糖实现(boolean) default: true if class file from version 51.0 (Java 7) or greater
-‌-usenametable(boolean) default: true
-‌-usesignatures(boolean) default: true
-‌-versionCFR 的版本号(boolean) default: true
-‌-help帮助(string)

反编译 Class 文件的工具——CFR
https://weichao.io/19dae968f2dd/
作者
魏超
发布于
2022年12月13日
更新于
2023年1月11日
许可协议