Class DexBulkItemRenamer
java.lang.Object
com.pnfsoftware.jeb.core.units.code.android.DexBulkItemRenamer
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intvery strict: accept only printable, non-WSP asciistatic final intstrict: accept only printable, non-WSP asciistatic final intmoderately strict: accept legal user-defined namesstatic final intimpossibly strict: accept nothingstatic final intRename all supported target types.static final intRename class names.static final intRename field names.static final intRename method names. -
Constructor Summary
ConstructorsConstructorDescriptionDexBulkItemRenamer(IDexUnit dex, int targets, int policy, String filter) Create a bulk item renamer. -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of candidate items.intGet the number of examined items.intGet the number of failed renames.intGet the number of successful renames.booleanprocess(boolean interruptible, boolean notifyChanges) Process candidate items.
-
Field Details
-
TARGET_FLAG_CLASSES
public static final int TARGET_FLAG_CLASSESRename class names.- See Also:
-
TARGET_FLAG_FIELDS
public static final int TARGET_FLAG_FIELDSRename field names.- See Also:
-
TARGET_FLAG_METHODS
public static final int TARGET_FLAG_METHODSRename method names.- See Also:
-
TARGET_ALL
public static final int TARGET_ALLRename all supported target types.- See Also:
-
POLICY_LEGAL
public static final int POLICY_LEGALmoderately strict: accept legal user-defined names- See Also:
-
POLICY_ASCII_PRINT
public static final int POLICY_ASCII_PRINTstrict: accept only printable, non-WSP ascii- See Also:
-
POLICY_ASCII_ALPHANUM
public static final int POLICY_ASCII_ALPHANUMvery strict: accept only printable, non-WSP ascii- See Also:
-
POLICY_NOTHING
public static final int POLICY_NOTHINGimpossibly strict: accept nothing- See Also:
-
-
Constructor Details
-
DexBulkItemRenamer
Create a bulk item renamer.- Parameters:
dex- the target dex unittargets- a combination ofTARGET_FLAG_xxxto determine which kind of items may be renamedpolicy- one ofPOLICY_xxxto determine which names items may be candidate for renamingfilter- 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 interruptednotifyChanges- true to notify the Dex unit after successful renames- Returns:
- true if the method completed, false if it was interrupted
-