翻譯|使用教程|編輯:莫成敏|2019-09-30 14:20:39.083|閱讀 928 次
概述:Allatori Java obfuscator是第二代Java代碼混淆器,為您的知識產權提供全方位的保護。本文主要介紹Allatori Java obfuscator中的字段標簽和方法標簽。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Allatori Java obfuscator是第二代Java代碼混淆器,為您的知識產權提供全方位的保護。Allatori除了保護功能之外,還附加了一系列的功能,幾乎可以抵御一切的代碼攻擊。同時,Allatori可以讓您的程序體積更小,速度更快,效果簡直讓人難以置信。
字段標簽
字段標簽用于匹配字段。如果字段標簽嵌套在類標簽中,則它僅應用于與父類標簽匹配的類。如果父標記是keep-names,那么它將應用于所有類。字段標簽具有以下屬性:
屬性 | 值 |
訪問 | 需要*。設置匹配規則。 |
模板 | 需要*。設置匹配規則。其格式如下所述。 |
*必須具有訪問權限或模板屬性。
字段標簽的模板屬性具有以下格式:
[@annotation] [modifiers] [type] fieldname [instanceof classname]
字段或類型名稱中的“*”符號可匹配任意數量的字符。如果名稱以“regex:”開頭,則將其視為標準正則表達式。
例子:
方法標簽
該方法標簽用于匹配的方法。如果方法標簽嵌套在類標簽中,則它僅應用于與父類標簽匹配的類。如果父標記是keep-names,那么它將應用于所有類。該方法的標簽具有以下屬性:
屬性 | 值 |
訪問 | 需要*。設置匹配規則。 |
模板 | 需要*。設置匹配規則。其格式如下所述。 |
參數 | 可選的。如果設置為“keep”,則方法參數的名稱將不會更改。對于公共API方法很有用。 |
*必須具有訪問權限或模板屬性。
方法標簽的模板屬性具有以下格式:
[@annotation] [modifiers] [type] methodname(arguments)
方法或類型名稱中的“*”符號可匹配任意數量的字符。參數中的“*”符號與任何單個參數匹配。使用“**”來匹配任意數量的參數。如果名稱以“regex:”開頭,則將其視為標準正則表達式。
例子:
值 | 描述 |
*(**) | 匹配所有方法。 |
private *(**) | 匹配所有私有方法。 |
private+ *(**) | 匹配所有方法。 |
protected+ *(**) | 匹配所有受保護的方法和公共方法。 |
private+ *(*) | 將所有方法與一個參數完全匹配。 |
private+ *(*,*) | 用正好兩個參數匹配所有方法。 |
private+ *(java.lang.String) | 與所有方法完全匹配一個String類型的參數。 |
private+ *(java.lang.String,**) | 匹配所有以String作為第一個參數的方法。 |
private+ *(java.lang.*) | 僅使用java.lang包中的一個參數來匹配所有方法。 |
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>
本教程內容到這里就完結了,希望文章內容對您有所幫助~感興趣的朋友可以下載Allatori Java obfuscator試用一下哦~
想要購買該產品的請點擊“在線訂購”,了解更多產品信息請點擊“”
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn