Package jadx.core.xmlgen
Class ResNameUtils
java.lang.Object
jadx.core.xmlgen.ResNameUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static StringconvertToRFieldName(String resourceName) Converts the resource name to a field name of the R class.private static booleanisValidAapt2ResourceNamePart(int codePoint) Determines whether the code point may be part of a resource name as other than the first character (aapt2).private static booleanisValidAapt2ResourceNameStart(int codePoint) Determines whether the code point may be part of a resource name as the first character (aapt2).private static booleanisValidResourceNamePart(int codePoint, boolean allowNonPrintable) Determines whether the code point may be part of a resource name as other than the first character (aapt2 + R class gen).private static booleanisValidResourceNameStart(int codePoint, boolean allowNonPrintable) Determines whether the code point may be part of a resource name as the first character (aapt2 + R class gen).private static booleanisXidContinue(int codePoint) private static booleanisXidStart(int codePoint) (package private) static StringsanitizeAsResourceName(String name, String postfix, boolean allowNonPrintable) Sanitizes the name so that it can be used as a resource name.
-
Constructor Details
-
ResNameUtils
private ResNameUtils()
-
-
Method Details
-
sanitizeAsResourceName
Sanitizes the name so that it can be used as a resource name. By resource name is meant that:- It can be used by aapt2 as a resource entry name.
- It can be converted to a valid R class field name.
If the
nameis already a valid resource name, the method returns it unchanged. If not, the method creates a valid resource name based onname, appends thepostfix, and returns the result. -
convertToRFieldName
Converts the resource name to a field name of the R class. -
isValidResourceNameStart
private static boolean isValidResourceNameStart(int codePoint, boolean allowNonPrintable) Determines whether the code point may be part of a resource name as the first character (aapt2 + R class gen). -
isValidResourceNamePart
private static boolean isValidResourceNamePart(int codePoint, boolean allowNonPrintable) Determines whether the code point may be part of a resource name as other than the first character (aapt2 + R class gen). -
isValidAapt2ResourceNameStart
private static boolean isValidAapt2ResourceNameStart(int codePoint) Determines whether the code point may be part of a resource name as the first character (aapt2).Source: aapt2/text/Unicode.cpp#L112
-
isValidAapt2ResourceNamePart
private static boolean isValidAapt2ResourceNamePart(int codePoint) Determines whether the code point may be part of a resource name as other than the first character (aapt2).Source: aapt2/text/Unicode.cpp#L118
-
isXidStart
private static boolean isXidStart(int codePoint) -
isXidContinue
private static boolean isXidContinue(int codePoint)
-