翻譯|使用教程|編輯:莫成敏|2019-09-30 14:20:39.083|閱讀 928 次
概述:Allatori Java obfuscator是第二代Java代碼混淆器,為您的知識產(chǎn)權(quán)提供全方位的保護。本文主要介紹Allatori Java obfuscator中的字段標(biāo)簽和方法標(biāo)簽。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Allatori Java obfuscator是第二代Java代碼混淆器,為您的知識產(chǎn)權(quán)提供全方位的保護。Allatori除了保護功能之外,還附加了一系列的功能,幾乎可以抵御一切的代碼攻擊。同時,Allatori可以讓您的程序體積更小,速度更快,效果簡直讓人難以置信。
字段標(biāo)簽
字段標(biāo)簽用于匹配字段。如果字段標(biāo)簽嵌套在類標(biāo)簽中,則它僅應(yīng)用于與父類標(biāo)簽匹配的類。如果父標(biāo)記是keep-names,那么它將應(yīng)用于所有類。字段標(biāo)簽具有以下屬性:
屬性 | 值 |
訪問 | 需要*。設(shè)置匹配規(guī)則。 |
模板 | 需要*。設(shè)置匹配規(guī)則。其格式如下所述。 |
*必須具有訪問權(quán)限或模板屬性。
字段標(biāo)簽的模板屬性具有以下格式:
[@annotation] [modifiers] [type] fieldname [instanceof classname]
字段或類型名稱中的“*”符號可匹配任意數(shù)量的字符。如果名稱以“regex:”開頭,則將其視為標(biāo)準(zhǔn)正則表達式。
例子:
方法標(biāo)簽
該方法標(biāo)簽用于匹配的方法。如果方法標(biāo)簽嵌套在類標(biāo)簽中,則它僅應(yīng)用于與父類標(biāo)簽匹配的類。如果父標(biāo)記是keep-names,那么它將應(yīng)用于所有類。該方法的標(biāo)簽具有以下屬性:
屬性 | 值 |
訪問 | 需要*。設(shè)置匹配規(guī)則。 |
模板 | 需要*。設(shè)置匹配規(guī)則。其格式如下所述。 |
參數(shù) | 可選的。如果設(shè)置為“keep”,則方法參數(shù)的名稱將不會更改。對于公共API方法很有用。 |
*必須具有訪問權(quán)限或模板屬性。
方法標(biāo)簽的模板屬性具有以下格式:
[@annotation] [modifiers] [type] methodname(arguments)
方法或類型名稱中的“*”符號可匹配任意數(shù)量的字符。參數(shù)中的“*”符號與任何單個參數(shù)匹配。使用“**”來匹配任意數(shù)量的參數(shù)。如果名稱以“regex:”開頭,則將其視為標(biāo)準(zhǔn)正則表達式。
例子:
值 | 描述 |
*(**) | 匹配所有方法。 |
private *(**) | 匹配所有私有方法。 |
private+ *(**) | 匹配所有方法。 |
protected+ *(**) | 匹配所有受保護的方法和公共方法。 |
private+ *(*) | 將所有方法與一個參數(shù)完全匹配。 |
private+ *(*,*) | 用正好兩個參數(shù)匹配所有方法。 |
private+ *(java.lang.String) | 與所有方法完全匹配一個String類型的參數(shù)。 |
private+ *(java.lang.String,**) | 匹配所有以String作為第一個參數(shù)的方法。 |
private+ *(java.lang.*) | 僅使用java.lang包中的一個參數(shù)來匹配所有方法。 |
public get*(**) | 匹配所有以“get”開頭的公共方法。 |
public *abc*(**) | 匹配名稱包含“abc”的所有公共方法。 |
private+ int *(**) | 匹配所有具有int返回類型的方法。 |
@java.lang.Deprecated *(**) | 匹配所有不推薦使用的方法。 |
public regex:(g|s)et.*(**) | 匹配所有公共的getter和setter方法。 |
例子:
<keep-names> <!-- Stops applying further rules to classes in the com.company.abc package, therefore all classes, methods and fields in this package will be renamed --> <class template="class com.company.abc.*" stop="true"/> <!-- Further rules instruct Allatori not to rename matched elements --> <!-- Matches classes with the name "Main" in any package --> <class template="class *.Main"/> <!-- Matches classes with the name ending with "Bean" --> <class template="class *Bean"> <!-- Matches all fields --> <field access="private+"/> <!-- Matches public integer fields --> <field template="public int *"/> <!-- Matches all static fields --> <field template="static *"/> <!-- Matches protected and public String fields --> <field template="protected+ java.lang.String *"/> <!-- Matches all methods --> <method template="private+ *(**)"/> <!-- Matches all getter methods --> <method template="private+ get*(**)"/> <!-- Matches all methods with String argument, parameter names of these methods will not be changed --> <method template="private+ *(java.lang.String)" parameters="keep"/> </class> <!-- Matches serialization members --> <class template="class * instanceof java.io.Serializable"> <field template="static final long serialVersionUID"/> <method template="void writeObject(java.io.ObjectOutputStream)"/> <method template="void readObject(java.io.ObjectInputStream)"/> <method template="java.lang.Object writeReplace()"/> <method template="java.lang.Object readResolve()"/> </class> <!-- Matches applets --> <class template="class * instanceof java.applet.Applet"/> <!-- Matches servlets --> <class template="class * instanceof javax.servlet.Servlet"/> <!-- Matches midlets --> <class template="class * instanceof javax.microedition.midlet.MIDlet"/> </keep-names>
本教程內(nèi)容到這里就完結(jié)了,希望文章內(nèi)容對您有所幫助~感興趣的朋友可以下載Allatori Java obfuscator試用一下哦~
想要購買該產(chǎn)品的請點擊“在線訂購”,了解更多產(chǎn)品信息請點擊“”
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn