Class Utils

java.lang.Object
jadx.core.utils.Utils

public class Utils extends Object
  • Field Details

    • JADX_API_PACKAGE

      private static final String JADX_API_PACKAGE
    • STACKTRACE_STOP_CLS_NAME

      private static final String STACKTRACE_STOP_CLS_NAME
  • Constructor Details

    • Utils

      private Utils()
  • Method Details

    • cleanObjectName

      public static String cleanObjectName(String obj)
    • cutObject

      public static String cutObject(String obj)
    • makeQualifiedObjectName

      public static String makeQualifiedObjectName(String obj)
    • smaliNameToJavaName

      public static String smaliNameToJavaName(String descString)
    • cleanObjectNameWithInnerClass

      private static String cleanObjectNameWithInnerClass(String obj)
    • javaNameToSmaliName

      public static String javaNameToSmaliName(String descString)
    • strRepeat

      public static String strRepeat(String str, int count)
    • listToString

      public static String listToString(Iterable<?> objects)
    • listToString

      public static String listToString(Iterable<?> objects, String joiner)
    • listToString

      public static <T> String listToString(Iterable<T> objects, Function<T,String> toStr)
    • listToString

      public static <T> String listToString(Iterable<T> objects, String joiner, Function<T,String> toStr)
    • listToString

      public static <T> void listToString(StringBuilder sb, Iterable<T> objects, String joiner)
    • listToString

      public static <T> void listToString(StringBuilder sb, Iterable<T> objects, String joiner, Function<T,String> toStr)
    • arrayToStr

      public static <T> String arrayToStr(T[] arr)
    • concatStrings

      public static String concatStrings(List<String> list)
    • currentStackTrace

      public static String currentStackTrace()
    • currentStackTrace

      public static String currentStackTrace(int skipFrames)
    • getFullStackTrace

      public static String getFullStackTrace(Throwable throwable)
    • getStackTrace

      public static String getStackTrace(Throwable throwable)
    • getStackTrace

      private static String getStackTrace(Throwable throwable, boolean filter)
    • appendStackTrace

      public static void appendStackTrace(ICodeWriter code, Throwable throwable)
    • filterRecursive

      private static void filterRecursive(Throwable th)
    • filter

      private static void filter(Throwable th)
    • collectionMap

      public static <T, R> List<R> collectionMap(Collection<T> list, Function<T,R> mapFunc)
    • collectionMapNoNull

      public static <T, R> List<R> collectionMapNoNull(Collection<T> list, Function<T,R> mapFunc)
    • containsInListByRef

      public static <T> boolean containsInListByRef(List<T> list, T element)
    • indexInListByRef

      public static <T> int indexInListByRef(List<T> list, T element)
    • lockList

      public static <T> List<T> lockList(List<T> list)
    • listTail

      public static <T> List<T> listTail(List<T> list, int startIndex)
      Sub list from startIndex (inclusive) to list end
    • mergeLists

      public static <T> List<T> mergeLists(List<T> first, List<T> second)
    • mergeSets

      public static <T> Set<T> mergeSets(Set<T> first, Set<T> second)
    • newConstStringMap

      public static Map<String,String> newConstStringMap(String... parameters)
    • mergeMaps

      public static <K, V> Map<K,V> mergeMaps(Map<K,V> first, Map<K,V> second)
      Merge two maps. Return HashMap as result. Second map will override values from first map.
    • groupBy

      public static <K, V> Map<K,V> groupBy(List<V> list, Function<V,K> mapKey)
      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

      public static <T> void multiRootTreeDfsVisit(List<T> roots, Function<T,List<T>> childrenProvider, Consumer<T> visitor)
    • getOne

      @Nullable public static <T> T getOne(@Nullable @Nullable List<T> list)
    • getOne

      @Nullable public static <T> T getOne(@Nullable @Nullable Collection<T> collection)
    • isSetContainsAny

      public static <T> boolean isSetContainsAny(Set<T> inputSet, Set<T> searchKeys)
    • first

      @Nullable public static <T> T first(List<T> list)
    • first

      @Nullable public static <T> T first(Iterable<T> list)
    • last

      @Nullable public static <T> T last(List<T> list)
    • last

      @Nullable public static <T> T last(Iterable<T> list)
    • getOrElse

      public static <T> T getOrElse(@Nullable T obj, T defaultObj)
    • isEmpty

      public static <T> boolean isEmpty(Collection<T> col)
    • notEmpty

      public static <T> boolean notEmpty(Collection<T> col)
    • isEmpty

      public static <K, V> boolean isEmpty(Map<K,V> map)
    • isEmpty

      public static <T> boolean isEmpty(T[] arr)
    • notEmpty

      public static <T> boolean notEmpty(T[] arr)
    • checkThreadInterrupt

      public static void checkThreadInterrupt()
    • simpleThreadFactory

      public static ThreadFactory simpleThreadFactory(String name)
    • getEnvVarBool

      @Deprecated public static boolean getEnvVarBool(String varName, boolean defValue)
      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 public static int getEnvVarInt(String varName, int defValue)
      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

      public static int safeParseInt(String value, int defValue)
    • safeParseInteger

      @Nullable public static @Nullable Integer safeParseInteger(@Nullable @Nullable String value)