类 StringObfuscator
java.lang.Object
io.github.amsonix.molt.internal.reschiper.obfuscation.StringObfuscator
A utility class for generating obfuscated replacement strings.
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明getReplaceString(Collection<String> names) Gets a replacement string from the buffer based on the provided names.booleanisInWhiteList(int id) Checks if a specific identifier is in the white list.booleanisReplaced(int id) Checks if a specific identifier has been replaced.voidremoveStrings(Collection<String> collection) Removes a collection of strings from the replacement buffer.voidResets the state of the StringObfuscator with the provided blacklist patterns.voidsetInReplaceList(int id) Adds an identifier to the replacement list.voidsetInWhiteList(int id) Adds an identifier to the white list.
-
构造器详细资料
-
StringObfuscator
public StringObfuscator()Initializes a new instance of the StringObfuscator class.
-
-
方法详细资料
-
reset
Resets the state of the StringObfuscator with the provided blacklist patterns.- 参数:
blacklistPatterns- A set of regular expression patterns for blacklisted strings.
-
removeStrings
Removes a collection of strings from the replacement buffer.- 参数:
collection- The collection of strings to remove.
-
isReplaced
public boolean isReplaced(int id) Checks if a specific identifier has been replaced.- 参数:
id- The identifier to check.- 返回:
- True if the identifier has been replaced; otherwise, false.
-
isInWhiteList
public boolean isInWhiteList(int id) Checks if a specific identifier is in the white list.- 参数:
id- The identifier to check.- 返回:
- True if the identifier is in the white list; otherwise, false.
-
setInWhiteList
public void setInWhiteList(int id) Adds an identifier to the white list.- 参数:
id- The identifier to add to the white list.
-
setInReplaceList
public void setInReplaceList(int id) Adds an identifier to the replacement list.- 参数:
id- The identifier to add to the replacement list.
-
getReplaceString
Gets a replacement string from the buffer based on the provided names.- 参数:
names- A collection of names to exclude from the replacements.- 返回:
- The replacement string.
- 抛出:
IllegalArgumentException- If the replacement buffer is empty.
-