java打包jar反编译

 

1.打包jar

以D盘下的tools_0808文件夹为例,打包的文件夹中必须存在MANIFEST.MF文件,存放的位置是

D:\tools_0808\META-INF\MANIFEST.MF。

dos命令如下:

D:\>jar cvfm tools_0808.jar tools_0808\META-INF\MANIFEST.MF -C tools_0808/  .

 

2.反编译jar

在jar  位置shift+鼠标右键    cmd打开

需要下载cfr-0.150.jar

java -jar cfr-0.150.jar flow.jar --outputdir d/soft/jar/flownew

 

https://www.cnblogs.com/passedbylove/p/7000644.html

 

 

--aexagg                         (boolean)
--aexagg2                        (boolean)
--aggressivedoextension          (boolean)
--aggressivesizethreshold        (int >= 0)  default: 15000
--allowcorrecting                (boolean)  default: true
--analyseas                      (One of [DETECT, JAR, WAR, CLASS])
--arrayiter                      (boolean)  default: true if class file from version 49.0 (Java 5) or greater
--caseinsensitivefs              (boolean)  default: true
--clobber                        (boolean)
--collectioniter                 (boolean)  default: true if class file from version 49.0 (Java 5) or greater
--commentmonitors                (boolean)  default: false
--comments                       (boolean)  default: true
--decodeenumswitch               (boolean)  default: true if class file from version 49.0 (Java 5) or greater
去除switch对枚举支持的语法糖 --decodeenumswitch false
--decodefinally                  (boolean)  default: true
--decodelambdas                  (boolean)  default: true if class file from version 52.0 (Java 8) or greater
去除lambda表达式的语法糖 --decodelambdas false
--decodestringswitch             (boolean)  default: true if class file from version 51.0 (Java 7) or greater
--dumpclasspath                  (boolean)  default: false
--eclipse                        (boolean)  default: true
--elidescala                     (boolean)  default: false
--extraclasspath                 (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                   (boolean)
--forcetopsortaggress            (boolean)
--forcetopsortnopull             (boolean)
--forloopaggcapture              (boolean)
--hidebridgemethods              (boolean)  default: true
--hidelangimports                (boolean)  default: true
--hidelongstrings                (boolean)  default: false
--hideutf                        (boolean)  default: true
--ignoreexceptions               (boolean)  default: false
--ignoreexceptionsalways         (boolean)  default: false
--importfilter                   (string)
--innerclasses                   (boolean)  default: true
--instanceofpattern              (boolean)  default: true if class file from version 58.0 (Java 14) or greater, or experimental in 58.0 (Java 14)
--j14classobj                    (boolean)  default: false if class file from version 49.0 (Java 5) or greater
--jarfilter                      (string)
--labelledblocks                 (boolean)  default: true
--lenient                        (boolean)  default: false
--liftconstructorinit            (boolean)  default: true
--lomem                          (boolean)  default: false
--methodname                     (string)
--obfuscationpath                (string)
--outputdir                      (string)
结果输出目录
--outputpath                     (string)
--override                       (boolean)  default: true if class file from version 50.0 (Java 6) or greater
--previewfeatures                (boolean)  default: true
--pullcodecase                   (boolean)  default: false
--recordtypes                    (boolean)  default: true if class file from version 58.0 (Java 14) or greater, or experimental in 58.0 (Java 14)
--recover                        (boolean)  default: true
--recovertypeclash               (boolean)
--recovertypehints               (boolean)
--relinkconststring              (boolean)  default: true
--removebadgenerics              (boolean)  default: true
去除泛型的语法糖 --removebadgenerics false
--removeboilerplate              (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
--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                   (boolean)  default: false if class file from version 49.0 (Java 5) or greater
--stringbuilder                  (boolean)  default: true if class file from version 49.0 (Java 5) or greater
--stringconcat                   (boolean)  default: true if class file from version 53.0 (Java 9) or greater
--sugarasserts                   (boolean)  default: true
--sugarboxing                    (boolean)  default: true
去除自动装箱和拆箱的语法糖 --sugarboxing false
--sugarenums                     (boolean)  default: true if class file from version 49.0 (Java 5) or greater
去除枚举的语法糖 --sugarenums false
--switchexpression               (boolean)  default: true if class file from version 57.0 (Java 13) or greater, or experimental in 56.0 (Java 12)
--tidymonitors                   (boolean)  default: true
--tryresources                   (boolean)  default: true if class file from version 51.0 (Java 7) or greater
--usenametable                   (boolean)  default: true
--usesignatures                  (boolean)  default: true
--help                           (string)

 

 

idea反编译jar

找到idea安装目录   plugins, 找到java-decompiler.jar

D:\soft\idea\plugins\java-decompiler\lib

创建目录

java -cp "D:\soft\idea\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -dgs=true ubpm-rest-1.2.2-SNAPSHOT.jar flow3

 

 

 

 

 

posted @ 2020-11-04 08:41  jentary  阅读(632)  评论(0编辑  收藏  举报