Package com.pnfsoftware.jeb.core.util
Class DecompilerHelper
java.lang.Object
com.pnfsoftware.jeb.core.util.DecompilerHelper
Helper methods related to
decompiler units.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreatePluginNamesListProperty(Collection<String> pluginNames) Serialize a collection of plugin names into a comma-separated property value.static ProgressCallbackAdapterCreate a progress callback object that logs progress to the global logger, as such:"[current]/[total]: [message]"static ProgressCallbackAdaptercreateProgressLogger(ILogger logger, Integer level) Create a progress callback object that logs progress to a logger, as such:"[current]/[total]: [message]"Retrieve the code unit type names for all registered decompilers.static List<IUnitIdentifier> Retrieve all registered decompiler unit identifiers.getBuildTypesWithDecompilationSupport(String codeUnitType) Retrieve the JEB build types that provide decompilation support for a code unit type.static IDecompilerUnitgetDecompiler(IUnit unit) Retrieve or create a decompiler for the current unit.static IDecompilerUnitgetDecompiler(IUnit unit, boolean createIfNotExist) Retrieve a decompiler for the current unit.static ICodeUnitgetRelatedCodeUnit(IUnit unit) Retrieve the existing code unit for the provided decompiler or source unit.static IDecompilerUnitgetRelatedDecompiler(IUnit unit) Retrieve an existing decompiler for the current code unit or the decompiler that produced the provided source unit.static booleanhasDecompilerFor(ICodeUnit unit) Determine whether or not there is (or could be) an associated decompiler for the provided code unit.static booleanDetermine whether a Dex decompiler is available in the engines context.static Collection<String> parsePluginNamesListProperty(String propertyValue) Parse a comma-separated plugin-name property value into a unique set of plugin names.static StringBuild the decompiler unit type associated with a code unit type.
-
Method Details
-
typeName
Build the decompiler unit type associated with a code unit type.- Parameters:
codeUnitType- the code unit type- Returns:
- the decompiler unit type for the provided code unit type
-
hasDecompilerFor
Determine whether or not there is (or could be) an associated decompiler for the provided code unit.- Parameters:
unit- the code unit to examine- Returns:
trueif a matching decompiler already exists or can be created,falseotherwise
-
getAvailableDecompilers
Retrieve all registered decompiler unit identifiers.- Parameters:
engctx- the engines context- Returns:
- the available decompiler identifiers
-
isDexDecompilerAvailable
Determine whether a Dex decompiler is available in the engines context.- Parameters:
engctx- the engines context- Returns:
trueif a Dex decompiler is available,falseotherwise
-
getAvailableDecompilerNames
Retrieve the code unit type names for all registered decompilers.- Parameters:
engctx- the engines context- Returns:
- the supported code unit type names
-
getDecompiler
Retrieve or create a decompiler for the current unit.- Parameters:
unit- the unit for which a related decompiler is requested- Returns:
- the decompiler unit or null
-
getDecompiler
Retrieve a decompiler for the current unit.- Parameters:
unit- a code unitcreateIfNotExist-trueto create a decompiler when none already exists- Returns:
- the decompiler unit or null
-
getRelatedDecompiler
Retrieve an existing decompiler for the current code unit or the decompiler that produced the provided source unit. No decompiler is created.- Parameters:
unit- acode unitor asource unit- Returns:
- the decompiler unit or null
-
getRelatedCodeUnit
Retrieve the existing code unit for the provided decompiler or source unit.- Parameters:
unit- a decompiler or source unit- Returns:
- the related code unit, or
nullif none can be resolved
-
getBuildTypesWithDecompilationSupport
Retrieve the JEB build types that provide decompilation support for a code unit type.- Parameters:
codeUnitType- the code unit type- Returns:
- the supporting build type names, or an empty list if unsupported
-
parsePluginNamesListProperty
Parse a comma-separated plugin-name property value into a unique set of plugin names.- Parameters:
propertyValue- the property value, may benull- Returns:
- the parsed plugin names, preserving their declaration order
-
createPluginNamesListProperty
Serialize a collection of plugin names into a comma-separated property value.- Parameters:
pluginNames- the plugin names, may benull- Returns:
- the serialized property value, or an empty string if the collection is
null
-
createProgressLogger
Create a progress callback object that logs progress to the global logger, as such:"[current]/[total]: [message]"- Returns:
- the callback object
-
createProgressLogger
Create a progress callback object that logs progress to a logger, as such:"[current]/[total]: [message]"- Parameters:
logger- optional logger; if null, the global anonymous logger is usedlevel- optional level; if null, the informational level is used- Returns:
- the callback object
-