我混淆过jbuilderX生成的一个application(一个空Jframe) 的jar 文件。一切正常,生成的jar文件变小了很多!!!!!!!
反编译后对比文件变化觉得有意思,起码jar文件小了很多
但后来出现如下问题: 请高手解答 小弟拜谢了!!!!!!!!!
¥混淆器为:retroguard(才下载的)
¥我的混淆器目录:E:\学习栏\retroguard-v2.0.2\retroguard-v2.0.2
¥我的jar文件:thunder.jar (用jbuilderX的wizards->archive builder->application打包而成)
(运行正常)其中用到了2个borland的类文件
¥我的jar文件用到的类库(borland的)分别是:com/borland/jbcl/layout/XYLayout.class和
com/borland/jbcl/layout/XYConstraints.class打入thunder.jar包中(路径是jar文件中的位置)。
通过命令行运行混淆器
命令如下:retroguard.jar thunder.jar out1.jar q.txt log.txt
生成了out1.jar 文件
!!!!!!!!!!但运行时有问题:
提示如下:could not find the main class. program will exit.
于是把out1.jar文件解压 查看META-INF中的MANIFEST.MF文件的内容
觉得mainclass的指向没有问题(文件内容在后面写出!)混淆前后都是 指向 thunder.ThunderMain
郁闷啊 实在是不知道为什么???被折磨了半天,请老鸟指点指点!!!
另外有1个问题??也请高手回答
1)如何在jbuilderX中使用混淆器(我说的是project在打成jar包时候 既:wizards->archive builder->application打包 )
如果那位高手知道请说的详细点,小弟设置了好多次了 ,不名所以然!
//////////////////////////////////////////////////////
混淆后的MANIFEST.MF文件内容
Manifest-Version: 1.0
Main-Class: thunder.ThunderMain
Name: com/borland/jbcl/layout/XYConstraints.class
Name: com/borland/jbcl/layout/XYLayout.class
Name: a/o.class
Name: a/l.class
Name: a/g.class
Name: a/s.class
Name: a/c.class
Name: a/r.class
Name: a/d.class
Name: a/f.class
Name: a/h.class
Name: a/p.class
Name: a/m.class
Name: a/j.class
Name: a/q.class
Name: a/n.class
Name: a/e.class
Name: a/a.class
Name: a/k.class
Name: a/b.class
Name: a/i.class
5 个解决方案
#1
/////////////////////////////////////////
原来没有混淆的时候是的 MANIFEST.MF文件内容
Manifest-Version: 1.0
Main-Class: thunder.ThunderMain
/////////////////////////////////
/////////////////////////////////////////////
/////////////////q.txt 文件如下:////////////
.class com/borland/jbcl/layout/XYLayout
.class com/borland/jbcl/layout/XYConstraints
/////////////////////////////////////////////
////////////log.txt如下//////////////////////
# If this log is to be used for incremental obfuscation / patch generation,
# add any '.class', '.method', '.field' and '.attribute' restrictions here:
#-DO-NOT-EDIT-BELOW-THIS-LINE------------------DO-NOT-EDIT-BELOW-THIS-LINE--
#
# RetroGuard Bytecode Obfuscator, v2.0.2, a product of Retrologic Systems - www.retrologic.com
#
# Logfile created on Fri May 06 02:30:58 CST 2005
#
# Jar file to be obfuscated: thunder.jar
# Target Jar file for obfuscated code: out1.jar
# RetroGuard Script file used: q.txt
#
#
# Memory in use after class data structure built: 848656 bytes
# Total memory available : 2031616 bytes
原来没有混淆的时候是的 MANIFEST.MF文件内容
Manifest-Version: 1.0
Main-Class: thunder.ThunderMain
/////////////////////////////////
/////////////////////////////////////////////
/////////////////q.txt 文件如下:////////////
.class com/borland/jbcl/layout/XYLayout
.class com/borland/jbcl/layout/XYConstraints
/////////////////////////////////////////////
////////////log.txt如下//////////////////////
# If this log is to be used for incremental obfuscation / patch generation,
# add any '.class', '.method', '.field' and '.attribute' restrictions here:
#-DO-NOT-EDIT-BELOW-THIS-LINE------------------DO-NOT-EDIT-BELOW-THIS-LINE--
#
# RetroGuard Bytecode Obfuscator, v2.0.2, a product of Retrologic Systems - www.retrologic.com
#
# Logfile created on Fri May 06 02:30:58 CST 2005
#
# Jar file to be obfuscated: thunder.jar
# Target Jar file for obfuscated code: out1.jar
# RetroGuard Script file used: q.txt
#
#
# Memory in use after class data structure built: 848656 bytes
# Total memory available : 2031616 bytes
#2
混淆器把public static void main(String[] args)函式也給混淆了。你得寫個小腳本保證不會混淆main。
#3
多谢大哥!
请教怎么写脚本 怎么不混淆那些类文件
请教怎么写脚本 怎么不混淆那些类文件
#4
# this is comment
.method thunder/ThunderMain/main ([Ljava/lang/String;)V
存檔為script.rgs
retroguard.jar thunder.jar out1.jar script.rgs q.txt log.txt
.method thunder/ThunderMain/main ([Ljava/lang/String;)V
存檔為script.rgs
retroguard.jar thunder.jar out1.jar script.rgs q.txt log.txt
#5
thank you
#1
/////////////////////////////////////////
原来没有混淆的时候是的 MANIFEST.MF文件内容
Manifest-Version: 1.0
Main-Class: thunder.ThunderMain
/////////////////////////////////
/////////////////////////////////////////////
/////////////////q.txt 文件如下:////////////
.class com/borland/jbcl/layout/XYLayout
.class com/borland/jbcl/layout/XYConstraints
/////////////////////////////////////////////
////////////log.txt如下//////////////////////
# If this log is to be used for incremental obfuscation / patch generation,
# add any '.class', '.method', '.field' and '.attribute' restrictions here:
#-DO-NOT-EDIT-BELOW-THIS-LINE------------------DO-NOT-EDIT-BELOW-THIS-LINE--
#
# RetroGuard Bytecode Obfuscator, v2.0.2, a product of Retrologic Systems - www.retrologic.com
#
# Logfile created on Fri May 06 02:30:58 CST 2005
#
# Jar file to be obfuscated: thunder.jar
# Target Jar file for obfuscated code: out1.jar
# RetroGuard Script file used: q.txt
#
#
# Memory in use after class data structure built: 848656 bytes
# Total memory available : 2031616 bytes
原来没有混淆的时候是的 MANIFEST.MF文件内容
Manifest-Version: 1.0
Main-Class: thunder.ThunderMain
/////////////////////////////////
/////////////////////////////////////////////
/////////////////q.txt 文件如下:////////////
.class com/borland/jbcl/layout/XYLayout
.class com/borland/jbcl/layout/XYConstraints
/////////////////////////////////////////////
////////////log.txt如下//////////////////////
# If this log is to be used for incremental obfuscation / patch generation,
# add any '.class', '.method', '.field' and '.attribute' restrictions here:
#-DO-NOT-EDIT-BELOW-THIS-LINE------------------DO-NOT-EDIT-BELOW-THIS-LINE--
#
# RetroGuard Bytecode Obfuscator, v2.0.2, a product of Retrologic Systems - www.retrologic.com
#
# Logfile created on Fri May 06 02:30:58 CST 2005
#
# Jar file to be obfuscated: thunder.jar
# Target Jar file for obfuscated code: out1.jar
# RetroGuard Script file used: q.txt
#
#
# Memory in use after class data structure built: 848656 bytes
# Total memory available : 2031616 bytes
#2
混淆器把public static void main(String[] args)函式也給混淆了。你得寫個小腳本保證不會混淆main。
#3
多谢大哥!
请教怎么写脚本 怎么不混淆那些类文件
请教怎么写脚本 怎么不混淆那些类文件
#4
# this is comment
.method thunder/ThunderMain/main ([Ljava/lang/String;)V
存檔為script.rgs
retroguard.jar thunder.jar out1.jar script.rgs q.txt log.txt
.method thunder/ThunderMain/main ([Ljava/lang/String;)V
存檔為script.rgs
retroguard.jar thunder.jar out1.jar script.rgs q.txt log.txt
#5
thank you