From 1d88cd4233a17822158dfbacf47b4759a2a1515d Mon Sep 17 00:00:00 2001 From: 502647092 Date: Tue, 16 Aug 2016 14:48:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=B7=B7=E6=B7=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- class.dict | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ obf.dict | 24 +++++++++++++++++++ pom.xml | 23 +++++++++++++++++- proguard.conf | 54 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 class.dict create mode 100644 obf.dict create mode 100644 proguard.conf diff --git a/class.dict b/class.dict new file mode 100644 index 0000000..21fec61 --- /dev/null +++ b/class.dict @@ -0,0 +1,65 @@ +IIIIiI +IIiIiI +iiIIiI +Iiiiii +IIIIIi +IiIiII +iiIIIi +iIIIii +iIiiIi +iiiIiI +IiiIii +iIiiiI +iiiIIi +IIiIII +IIIIii +IIIiii +iiiiII +iIIiII +IIiiII +iiIIii +IiiIII +iIiIII +IiIIii +iiIiiI +iIiiII +IiiIiI +iiiIII +IIiIIi +iIiIiI +iiIiii +IiIiii +IiIIiI +IiiIIi +IiIIIi +IIiiIi +iIIiIi +iIIIII +IIIiIi +iiiiiI +iIiIIi +IIIiiI +iiiiIi +iiIiIi +IIiiiI +IiiiII +iIIiii +iIiIii +IiIiiI +IIiIii +IiIIII +IIIIII +iIIIIi +IIIiII +iiiiii +IiiiiI +IiIiIi +iiiIii +iIIIiI +iIIiiI +iIiiii +iiIiII +IIiiii +iiIIII +IiiiIi +llllll \ No newline at end of file diff --git a/obf.dict b/obf.dict new file mode 100644 index 0000000..dcde616 --- /dev/null +++ b/obf.dict @@ -0,0 +1,24 @@ +if +try +for +int +new +true +null +this +else +void +enum +final +false +class +catch +import +double +public +static +boolean +package +finally +private +protected \ No newline at end of file diff --git a/pom.xml b/pom.xml index ae55ef8..25ef314 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 pw.yumc MiaoBoard - 1.2 + 1.4 MiaoBoard ${project.name} @@ -55,6 +55,27 @@ + + com.github.wvengen + proguard-maven-plugin + + + package + + proguard + + + + + + + + ${java.home}/lib/rt.jar + + + + + diff --git a/proguard.conf b/proguard.conf new file mode 100644 index 0000000..c9e47c4 --- /dev/null +++ b/proguard.conf @@ -0,0 +1,54 @@ +# -----不优化----- +-dontoptimize + +# -----忽略所有警告----- +-dontwarn +-dontnote + +# -----混淆时应用侵入式重载----- +-overloadaggressively + +# -----启用混淆字典----- +-obfuscationdictionary obf.dict +-classobfuscationdictionary class.dict +-packageobfuscationdictionary class.dict + +# -----保留所有属性 +-keepattributes ** + +# -----公共数据不混淆----- +-keep class cn.citycraft.CommonData.** {*;} + +# -----保护所有实体中的字段名称----- +-keepclassmembers class * implements java.io.Serializable { ; } + +# -----保护监听方法不被清理----- +-keepclassmembers class * implements org.bukkit.event.Listener { + @org.bukkit.event.EventHandler ; +} +# -----保护配置注入不被清理----- +-keepclassmembers class * extends **.config.InjectConfigurationSection { + ; +} +-keepclassmembers class * extends **.config.InjectConfig { + ; +} +# -----保护注解命令方法不被清理----- +-keepclassmembers class **.commands.annotation.** { ; } +-keepclassmembers class * implements **.commands.CommandExecutor { ; } + +-keepclassmembers class **.commands.HandlerCommand { ; } +-keepclassmembers class * implements **.commands.HandlerCommands { + @**.commands.HandlerCommand ; + @**.commands.HandlerTabComplete ; +} +# -----保护注解NotProguard标记----- +-keep class **.NotProguard +-keep @**.NotProguard class * {*;} +-keepclassmembers class * { + @**.NotProguard ; + @**.NotProguard ; +} + +# -----保护命令解析正常----- +-keepnames class * extends **.commands.BaseCommand \ No newline at end of file