Class KeywordNameMaker

  • All Implemented Interfaces:
    NameMaker

    public class KeywordNameMaker
    extends java.lang.Object
    implements NameMaker
    Name generator that uses (almost) the full Java identifier namespace, and chooses to put some of the keyword names (legal in JVM, illegal in Java language) out front in sequence.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeywordNameMaker()
      Ctor.
      KeywordNameMaker​(java.lang.String[] noObfNames)
      Ctor - block names not to be obfuscated from the mapping target space.
      KeywordNameMaker​(java.lang.String[] noObfNames, boolean useKeywords)
      Ctor - block names not to be obfuscated from the mapping target space.
      KeywordNameMaker​(java.lang.String[] noObfNames, boolean useKeywords, boolean lowerCaseOnly)
      Ctor - block names not to be obfuscated from the mapping target space.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String nextName​(java.lang.String descriptor)
      Return the next unique name for this namespace.
      static void scramble()
      Shuffle the mapping strings in random order, thus making the generator produce a different mapping.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeywordNameMaker

        public KeywordNameMaker()
        Ctor.
      • KeywordNameMaker

        public KeywordNameMaker​(java.lang.String[] noObfNames)
        Ctor - block names not to be obfuscated from the mapping target space.
        Parameters:
        noObfNames - the no obf names
      • KeywordNameMaker

        public KeywordNameMaker​(java.lang.String[] noObfNames,
                                boolean useKeywords)
        Ctor - block names not to be obfuscated from the mapping target space.
        Parameters:
        noObfNames - the no obf names
        useKeywords - the use keywords
      • KeywordNameMaker

        public KeywordNameMaker​(java.lang.String[] noObfNames,
                                boolean useKeywords,
                                boolean lowerCaseOnly)
        Ctor - block names not to be obfuscated from the mapping target space.
        Parameters:
        noObfNames - the no obf names
        useKeywords - the use keywords
        lowerCaseOnly - the lower case only
    • Method Detail

      • scramble

        public static void scramble()
        Shuffle the mapping strings in random order, thus making the generator produce a different mapping. Can be called once (and only once) in each obfuscation run; calling this method repeatedly would produce overlapping names.
      • nextName

        public java.lang.String nextName​(java.lang.String descriptor)
        Return the next unique name for this namespace.
        Specified by:
        nextName in interface NameMaker
        Parameters:
        descriptor - the descriptor
        Returns:
        the string