Package jadx.core.utils
Class Utils
java.lang.Object
jadx.core.utils.Utils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendStackTrace(ICodeWriter code, Throwable throwable) static <T> StringarrayToStr(T[] arr) static voidstatic StringcleanObjectName(String obj) private static Stringstatic <T,R> List <R> collectionMap(Collection<T> list, Function<T, R> mapFunc) static <T,R> List <R> collectionMapNoNull(Collection<T> list, Function<T, R> mapFunc) static StringconcatStrings(List<String> list) static <T> booleancontainsInListByRef(List<T> list, T element) static Stringstatic StringcurrentStackTrace(int skipFrames) static Stringprivate static voidprivate static voidstatic <T> Tstatic <T> Tstatic booleangetEnvVarBool(String varName, boolean defValue) Deprecated.env vars shouldn't be used in core modules.static intgetEnvVarInt(String varName, int defValue) Deprecated.env vars shouldn't be used in core modules.static StringgetFullStackTrace(Throwable throwable) static <T> TgetOne(@Nullable Collection<T> collection) static <T> Tstatic <T> TgetOrElse(T obj, T defaultObj) static StringgetStackTrace(Throwable throwable) private static StringgetStackTrace(Throwable throwable, boolean filter) static <K,V> Map <K, V> Build map from list of values with value to key mapping function
Similar to:
list.stream().collect(Collectors.toMap(mapKey, Function.identity()));static <T> intindexInListByRef(List<T> list, T element) static <T> booleanisEmpty(Collection<T> col) static <K,V> boolean static <T> booleanisEmpty(T[] arr) static <T> booleanisSetContainsAny(Set<T> inputSet, Set<T> searchKeys) static StringjavaNameToSmaliName(String descString) static <T> Tstatic <T> Tstatic <T> List<T> Sub list from startIndex (inclusive) to list endstatic StringlistToString(Iterable<?> objects) static StringlistToString(Iterable<?> objects, String joiner) static <T> StringlistToString(Iterable<T> objects, String joiner, Function<T, String> toStr) static <T> StringlistToString(Iterable<T> objects, Function<T, String> toStr) static <T> voidlistToString(StringBuilder sb, Iterable<T> objects, String joiner) static <T> voidlistToString(StringBuilder sb, Iterable<T> objects, String joiner, Function<T, String> toStr) static <T> List<T> static Stringstatic <T> List<T> mergeLists(List<T> first, List<T> second) static <K,V> Map <K, V> Merge two maps.static <T> Set<T> static <T> voidmultiRootTreeDfsVisit(List<T> roots, Function<T, List<T>> childrenProvider, Consumer<T> visitor) newConstStringMap(String... parameters) static <T> booleannotEmpty(Collection<T> col) static <T> booleannotEmpty(T[] arr) static intsafeParseInt(String value, int defValue) static @Nullable IntegersafeParseInteger(@Nullable String value) static ThreadFactorysimpleThreadFactory(String name) static StringsmaliNameToJavaName(String descString) static Stringstatic <T> voidtreeDfsVisit(T root, Function<T, List<T>> childrenProvider, Consumer<T> visitor) Simple DFS visit for tree (cycles not allowed)
-
Field Details
-
JADX_API_PACKAGE
-
STACKTRACE_STOP_CLS_NAME
-
-
Constructor Details
-
Utils
private Utils()
-
-
Method Details
-
cleanObjectName
-
cutObject
-
makeQualifiedObjectName
-
smaliNameToJavaName
-
cleanObjectNameWithInnerClass
-
javaNameToSmaliName
-
strRepeat
-
listToString
-
listToString
-
listToString
-
listToString
-
listToString
-
listToString
public static <T> void listToString(StringBuilder sb, Iterable<T> objects, String joiner, Function<T, String> toStr) -
arrayToStr
-
concatStrings
-
currentStackTrace
-
currentStackTrace
-
getFullStackTrace
-
getStackTrace
-
getStackTrace
-
appendStackTrace
-
filterRecursive
-
filter
-
collectionMap
-
collectionMapNoNull
-
containsInListByRef
-
indexInListByRef
-
lockList
-
listTail
Sub list from startIndex (inclusive) to list end -
mergeLists
-
mergeSets
-
newConstStringMap
-
mergeMaps
Merge two maps. Return HashMap as result. Second map will override values from first map. -
groupBy
Build map from list of values with value to key mapping function
Similar to:
list.stream().collect(Collectors.toMap(mapKey, Function.identity())); -
treeDfsVisit
public static <T> void treeDfsVisit(T root, Function<T, List<T>> childrenProvider, Consumer<T> visitor) Simple DFS visit for tree (cycles not allowed) -
multiRootTreeDfsVisit
-
getOne
-
getOne
-
isSetContainsAny
-
first
-
first
-
last
-
last
-
getOrElse
public static <T> T getOrElse(@Nullable T obj, T defaultObj) -
isEmpty
-
notEmpty
-
isEmpty
-
isEmpty
public static <T> boolean isEmpty(T[] arr) -
notEmpty
public static <T> boolean notEmpty(T[] arr) -
checkThreadInterrupt
public static void checkThreadInterrupt() -
simpleThreadFactory
-
getEnvVarBool
Deprecated.env vars shouldn't be used in core modules. Prefer to parse in `app` (use JadxCommonEnv from 'app-commons') and set in jadx args. -
getEnvVarInt
Deprecated.env vars shouldn't be used in core modules. Prefer to parse in `app` (use JadxCommonEnv from 'app-commons') and set in jadx args. -
safeParseInt
-
safeParseInteger
-