Interface IDexDecompilerUnit
- All Superinterfaces:
IAddressableUnit
,IDecompilerUnit
,IEventSource
,IInteractiveUnit
,IUnit
,IUnitCreator
,IUserDataSupport
Specialized interface representing Dex (Dalvik) decompiler Units.
-
Field Summary
FieldsFields inherited from interface com.pnfsoftware.jeb.core.units.code.IDecompilerUnit
FLAG_BATCH_DECOMPILATION, FLAG_KEEP_IR, FLAG_NO_CONCURRENT_DECOMPILATION, FLAG_NO_DEFERRED_DECOMPILATION, FLAG_NO_INNER_DECOMPILATION, FLAG_NO_METHOD_AST_GENERATION, FLAG_STANDALONE_IR_CONVERSION, FLAG_TEMP_FORCED_REDECOMPILATIONS, propnameListOfDisabledExternalPlugins
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSpecialComment
(String address, String value) void
Forcefully clear the cache of IRs for decompiled methods.void
clearSpecialComments
(String address) Create a limited environment to emulate dex code and native code.Create a generic unpacker, backed by anemulated-android
object, that can be used to attempt to retrieve resources unpacked at runtime.Generate a user-friendly text buffer of the decompilations currently being performed by this unit.Retrieve a previously decompiled AST class object or create an empty AST class element.Get the code unit (possibly the parent, possibly null) that is providing the low-level data to this decompiler.int
Retrieve the number of cached IRs for decompiled methods.Retrieve a DCR used during AST generation.Retrieve a previously decompiled AST field object or create an empty AST field element.Retrieve the list decompilation events, without duplicates.getGlobalDecompilationEvents
(boolean keepDuplicates) Retrieve a copy of the decompilation events.Retrieve the global AST context.getIdentifierName
(IJavaIdentifier ident) Retrieve the effective (renamed) name of an identifier in this method's AST.Retrieve the global IR context.Retrieve a previously decompiled AST method object or create an empty AST method element.void
recordDecompilationEvent
(DexDecompilerEvent<?> event) void
Register a user-controlled event queue that will receive decompilation events.boolean
Remove an AST class object.void
resetDecompilation
(String identifier) Remove a decompiled object (i.e., same asIDecompilerUnit.removeDecompilation(String)
.) For a dex decompiler, reset and removal actions are equivalent.boolean
Remove an AST field object.void
Reset the global decompilation events list.boolean
Remove an AST method object.retrieveCachedIR
(String msig) Attempt to retrieve the Intermediate Representation (IR) of a previously decompiled method.void
setCachePolicy
(int maxCount, int maxSeconds) Set the policy for the cache of decompiled IRs.boolean
setIdentifierName
(IJavaIdentifier ident, String name) Rename an identifier.boolean
setIdentifierName
(IJavaIdentifier ident, String name, boolean failOnNameConflict, boolean notify) Rename an identifier.void
Unregister a previously registered user-controlled decompilation event queue.Methods inherited from interface com.pnfsoftware.jeb.core.units.IAddressableUnit
getAddressLabel, getAddressLabels, getAddressOfItem, getCanonicalAddress, getItemAtAddress, getItemObject, getRelatedItems, getWellKnownAddresses, isValidAddress
Methods inherited from interface com.pnfsoftware.jeb.core.units.code.IDecompilerUnit
canDecompile, canPerformConcurrentDecompilations, decompile, decompileAll, decompileAllClasses, decompileAllMethods, decompileClass, decompileClass, decompileClasses, decompileField, decompileField, decompileMethod, decompileMethod, decompileMethods, decompileToUnit, decompileToUnit, getDecompiledClassText, getDecompiledFieldText, getDecompiledMethodText, getDecompiledText, getDecompiledUnit, getExporter, getOutputType, getThreadPoolSize, removeAllDecompilations, removeDecompilation, removeFreeElements, resetAllDecompilations, runGarbageCollection, setThreadPoolSize
Methods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSource
Methods inherited from interface com.pnfsoftware.jeb.core.units.IInteractiveUnit
addressToLocation, canExecuteAction, executeAction, executeAction, getAddressActions, getCommentManager, getFullComment, getFullComments, getGlobalActions, getInlineComment, getInlineComments, getItemActions, getMetadataManager, locationToAddress, prepareExecution, setInlineComment
Methods inherited from interface com.pnfsoftware.jeb.core.units.IUnit
addChild, addChild, canBePersisted, dispose, execprvfunc, generateQuickState, getChildren, getContributions, getCreationTimestamp, getDescription, getExtraInputs, getFormatter, getFormatType, getIconData, getInput, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getParentArtifact, getParentProject, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, initializePropertyObjects, isDisposed, isProcessed, isStale, isTransientChild, notifyGenericChange, postDeserialization, process, removeChild, setName, setNotes, setParent, setRealName, setUnitProcessor
Methods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Field Details
-
propnameEmulatorConfigPath
- See Also:
-
-
Method Details
-
getCodeUnit
IDexUnit getCodeUnit()Description copied from interface:IDecompilerUnit
Get the code unit (possibly the parent, possibly null) that is providing the low-level data to this decompiler.- Specified by:
getCodeUnit
in interfaceIDecompilerUnit
- Returns:
- a code unit, possibly null
-
getIntermediateContext
IDGlobalContext getIntermediateContext()Retrieve the global IR context.- Returns:
-
getHighLevelContext
IJavaGlobalContext getHighLevelContext()Retrieve the global AST context.- Returns:
-
getDynamicContentManager
IDynamicContentManager getDynamicContentManager()Retrieve a DCR used during AST generation.- Returns:
-
setIdentifierName
Rename an identifier.- Parameters:
ident
-name
-- Returns:
-
setIdentifierName
boolean setIdentifierName(IJavaIdentifier ident, String name, boolean failOnNameConflict, boolean notify) Rename an identifier.- Parameters:
ident
-name
-failOnNameConflict
-notify
-- Returns:
-
getIdentifierName
Retrieve the effective (renamed) name of an identifier in this method's AST.- Parameters:
ident
-- Returns:
-
getClass
Retrieve a previously decompiled AST class object or create an empty AST class element.- Parameters:
csig
-createIfNotExist
-- Returns:
-
getField
Retrieve a previously decompiled AST field object or create an empty AST field element.- Parameters:
fsig
-createIfNotExist
-- Returns:
-
getMethod
Retrieve a previously decompiled AST method object or create an empty AST method element.- Parameters:
msig
-createIfNotExist
-- Returns:
-
resetDecompilation
Remove a decompiled object (i.e., same asIDecompilerUnit.removeDecompilation(String)
.) For a dex decompiler, reset and removal actions are equivalent.- Specified by:
resetDecompilation
in interfaceIDecompilerUnit
-
resetClassElement
Remove an AST class object.- Parameters:
c
-- Returns:
-
resetFieldElement
Remove an AST field object.- Parameters:
f
-- Returns:
-
resetMethodElement
Remove an AST method object.- Parameters:
m
-- Returns:
-
registerEventQueue
Register a user-controlled event queue that will receive decompilation events.- Parameters:
queue
-
-
unregisterEventQueue
Unregister a previously registered user-controlled decompilation event queue.- Parameters:
queue
-
-
getGlobalDecompilationEvents
Collection<DexDecompilerEvent<?>> getGlobalDecompilationEvents()Retrieve the list decompilation events, without duplicates. Note that this queue is managed separately thanuser-controlled event queues
.- Returns:
-
getGlobalDecompilationEvents
Retrieve a copy of the decompilation events. Note that this queue is managed separately thanuser-controlled event queues
.- Parameters:
keepDuplicates
- if true, duplicate events will be present in the returned collection- Returns:
-
resetGlobalDecompilationEvents
void resetGlobalDecompilationEvents()Reset the global decompilation events list. This operation is not reversible. -
recordDecompilationEvent
-
addSpecialComment
-
clearSpecialComments
-
createEmulatedAndroid
IEmulatedAndroid createEmulatedAndroid()Create a limited environment to emulate dex code and native code. Currently, the emulated environment is a simple Arm 64-bit (aarch64) Android 13 system (API level 33). This dex decompiler must be the descendant of an APK unit.- Returns:
- an emulated Android environment
-
createGenericUnpacker
IGenericUnpacker createGenericUnpacker()Create a generic unpacker, backed by anemulated-android
object, that can be used to attempt to retrieve resources unpacked at runtime. This dex decompiler must be the descendant of an APK unit.- Returns:
- an emulated Android environment
-
formatOngoingDecompilations
String formatOngoingDecompilations()Generate a user-friendly text buffer of the decompilations currently being performed by this unit.- Returns:
-
setCachePolicy
void setCachePolicy(int maxCount, int maxSeconds) Set the policy for the cache of decompiled IRs.- Parameters:
maxCount
- maximum number of entries in the cache (-1 means no cap, which is not recommended; 0 can be used to disable caching entirely)maxSeconds
- starting from the last access to an entry, this value is a timeout in seconds after which the entry is auto-removed from the cache (-1 means no time-based removal)
-
clearCachedIRs
void clearCachedIRs()Forcefully clear the cache of IRs for decompiled methods. -
getCountOfCachedIRs
int getCountOfCachedIRs()Retrieve the number of cached IRs for decompiled methods.- Returns:
-
retrieveCachedIR
Attempt to retrieve the Intermediate Representation (IR) of a previously decompiled method.- Parameters:
msig
- original method signature (internal format, e.g.Lcom/xyz/Object;->foo(I)V
)- Returns:
- an IR object or null if it was not found in the cache
-