Interface IDOptimizer
- All Superinterfaces:
IPlugin
- All Known Implementing Classes:
AbstractDCollectionOptimizer,AbstractDOptimizer
Plugin interface for
dexdec (DEX decompiler) IR optimizer plugins. They are used to
optimize a method's IR or a collection of methods IRs.
Implementors should not implement this interface directly: extend AbstractDOptimizer
instead.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA well-known optimizer tag used to indicate that an optimizer is categorized as an explicit deobfuscator.static final StringA well-known optimizer tag used to indicate that an optimizer inlines method invocations.static final StringA well-known optimizer tag indicating that this optimizer, as part of its work, reorders the graph's nodes into a more natural way, better suitable for AST generation.static final StringA well-known optimizer tag used to indicate that an optimizer is likely to perform slowly on large graphs. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Retrieve the plugin name.doubleGet the optimizer priority.getTags()Get the optimizer tags.getType()Get the optimizer type.booleanDetermine whether this optimizer performs on a single method or an a collection of methods.booleanDetermine whether the optimizer is enabled or not.intperform(IDMethodContext ctx) Run the optimizer on the provided target method.intperformOnCollection(List<IDMethodContext> ctxlist, Map<IDMethodContext, Integer> pmcntmap) Run the optimizer on the provided collection of methods.Methods inherited from interface com.pnfsoftware.jeb.core.IPlugin
dispose, getData, getPluginInformation, setData
-
Field Details
-
DEOBFUSCATOR
A well-known optimizer tag used to indicate that an optimizer is categorized as an explicit deobfuscator.- See Also:
-
INLINER
A well-known optimizer tag used to indicate that an optimizer inlines method invocations.- See Also:
-
REORDERER
A well-known optimizer tag indicating that this optimizer, as part of its work, reorders the graph's nodes into a more natural way, better suitable for AST generation. That process is also called "layouting". Note that such optimizers may report no-optimizations performed but still have reordered the graph.- See Also:
-
SLOW
A well-known optimizer tag used to indicate that an optimizer is likely to perform slowly on large graphs.- See Also:
-
-
Method Details
-
getName
String getName()Retrieve the plugin name. Should be consistent with the value returned bygetPluginInformation().getName().- Returns:
-
getType
DOptimizerType getType()Get the optimizer type. Types are used byoptimizer orchestratorsto determine whether an optimizer should run.- Returns:
-
getTags
Get the optimizer tags. An optimizer may have 0, 1, or more tags. A tag is a non-null, non-empty string.- Returns:
- a collection of tags; may be empty (tags are optional), but never null
-
getPriority
double getPriority()Get the optimizer priority. A higher value means a higher priority. Priorities are used byoptimizer orchestratorsto determine in which order optimizers should be executed.- Returns:
- the default priority
-
isEnabled
boolean isEnabled()Determine whether the optimizer is enabled or not. This method is used byoptimizer orchestratorsto determine whether an optimizer can be scheduled for execution.- Returns:
- true if this optimizer is enabled
-
isCollectionOptimizer
boolean isCollectionOptimizer()Determine whether this optimizer performs on a single method or an a collection of methods.- Returns:
-
perform
Run the optimizer on the provided target method.For this method to be called by an
orchestrator,isCollectionOptimizer()must returnfalse.- Parameters:
ctx- a method context- Returns:
- number of optimizations performed
-
performOnCollection
Run the optimizer on the provided collection of methods.For this method to be called by an
orchestrator,isCollectionOptimizer()must returntrue.- Parameters:
ctxlist- a collection of method contextspmcntmap- optional output map that will receive the per-method optimization counts- Returns:
- number of optimizations performed
-