java.lang.Object
io.github.amsonix.molt.internal.reschiper.obfuscation.StringObfuscator

public class StringObfuscator extends Object
A utility class for generating obfuscated replacement strings.
  • 构造器详细资料

    • StringObfuscator

      public StringObfuscator()
      Initializes a new instance of the StringObfuscator class.
  • 方法详细资料

    • reset

      public void reset(HashSet<Pattern> blacklistPatterns)
      Resets the state of the StringObfuscator with the provided blacklist patterns.
      参数:
      blacklistPatterns - A set of regular expression patterns for blacklisted strings.
    • removeStrings

      public void removeStrings(Collection<String> collection)
      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

      public String getReplaceString(Collection<String> names) throws IllegalArgumentException
      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.