Class DexBulkItemRenamer

java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.DexBulkItemRenamer

public class DexBulkItemRenamer extends Object
A bulk renamer for dex items such as classes, fields, and methods. This item can be used directly or by issuing a Actions.AUTO_RENAME_ALL action via the dex unit's execution facility.
  • Field Details

    • TARGET_FLAG_CLASSES

      public static final int TARGET_FLAG_CLASSES
      Rename class names.
      See Also:
    • TARGET_FLAG_FIELDS

      public static final int TARGET_FLAG_FIELDS
      Rename field names.
      See Also:
    • TARGET_FLAG_METHODS

      public static final int TARGET_FLAG_METHODS
      Rename method names.
      See Also:
    • TARGET_ALL

      public static final int TARGET_ALL
      Rename all supported target types.
      See Also:
    • POLICY_ASCII_PRINT

      public static final int POLICY_ASCII_PRINT
      strict: accept only printable, non-WSP ascii
      See Also:
    • POLICY_ASCII_ALPHANUM

      public static final int POLICY_ASCII_ALPHANUM
      very strict: accept only printable, non-WSP ascii
      See Also:
    • POLICY_NOTHING

      public static final int POLICY_NOTHING
      impossibly strict: accept nothing
      See Also:
  • Constructor Details

    • DexBulkItemRenamer

      public DexBulkItemRenamer(IDexUnit dex, int targets, int policy, String filter)
      Create a bulk item renamer.
      Parameters:
      dex - the target dex unit
      targets - a combination of TARGET_FLAG_xxx to determine which kind of items may be renamed
      policy - one of POLICY_xxx to determine which names items may be candidate for renaming
      filter - an optional 'start of signature' filter, e.g. Lcom/foo/ would only rename items in the com.foo.** packages and subpackages
  • Method Details

    • getCountOfCandidates

      public int getCountOfCandidates()
      Get the number of candidate items.
      Returns:
      the candidate count
    • getCountOfExamined

      public int getCountOfExamined()
      Get the number of examined items.
      Returns:
      the examined item count
    • getCountOfRenames

      public int getCountOfRenames()
      Get the number of successful renames.
      Returns:
      the rename count
    • getCountOfFailures

      public int getCountOfFailures()
      Get the number of failed renames.
      Returns:
      the failure count
    • process

      public boolean process(boolean interruptible, boolean notifyChanges)
      Process candidate items.
      Parameters:
      interruptible - true to stop early if the current thread is interrupted
      notifyChanges - true to notify the Dex unit after successful renames
      Returns:
      true if the method completed, false if it was interrupted