Package jadx.api
Class JadxDecompiler
java.lang.Object
jadx.api.JadxDecompiler
- All Implemented Interfaces:
Closeable,AutoCloseable
Jadx API usage example:
JadxArgs args = new JadxArgs();
args.getInputFiles().add(new File("test.apk"));
args.setOutDir(new File("jadx-test-output"));
try (JadxDecompiler jadx = new JadxDecompiler(args)) {
jadx.load();
jadx.save();
}
Instead of 'save()' you can iterate over decompiled classes:
for(JavaClass cls : jadx.getClasses()) {
System.out.println(cls.getCode());
}
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JadxArgsprivate final List<ICodeLoader> private final Map<JadxPassType, List<JadxPass>> private final List<CustomResourcesLoader> private final IDecompileSchedulerprivate IJadxEventsprivate final List<ICodeLoader> private static final org.slf4j.Loggerprivate final JadxPluginManagerprivate List<ResourceFile> private final ResourcesLoaderprivate RootNodeprivate final ZipReader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseable(Closeable closeable) voidaddCustomCodeLoader(ICodeLoader customCodeLoader) voidaddCustomPass(JadxPass pass) voidprivate voidappendResourcesSaveTasks(ITaskExecutor executor, File outDir) private voidappendSourcesSave(ITaskExecutor executor, File outDir) voidclose()private void(package private) JavaClassGet JavaClass by ClassNode without loading and decompilation(package private) JavaField(package private) JavaMethodconvertNodes(Collection<? extends ICodeNodeRef> nodesList) (package private) JavaPackageevents()filterClasses(List<JavaClass> classes) getArgs()@Nullable JavaNodegetClosestJavaNode(ICodeInfo codeInfo, int pos) @Nullable JavaNodegetEnclosingNode(ICodeInfo codeInfo, int pos) int@Nullable JavaNodegetJavaNodeAtPosition(ICodeInfo codeInfo, int pos) @Nullable JavaNodegetJavaNodeByCodeAnnotation(@Nullable ICodeInfo codeInfo, @Nullable ICodeAnnotation ann) @Nullable JavaNodegetRoot()Internal API.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.private TaskExecutorgetSaveTasks(boolean saveSources, boolean saveResources) static Stringintvoidload()private voidprivate voidprivate voidvoidvoidregisterPlugin(JadxPlugin plugin) voidvoidReload passes and plugins without processing classes and inputsprivate voidreset()private JavaVariableresolveVarNode(VarNode varNode) private @Nullable JavaVariableresolveVarRef(ICodeInfo codeInfo, VarRef varRef) voidsave()private voidsave(boolean saveSources, boolean saveResources) voidsave(int intervalInMillis, JadxDecompiler.ProgressListener listener) voidvoid@Nullable ClassNodesearchClassNodeByOrigFullName(String fullName) @Nullable JavaClasssearchJavaClassByAliasFullName(String fullName) @Nullable JavaClasssearchJavaClassByOrigFullName(String fullName) @Nullable JavaClassvoidsetEventsImpl(IJadxEvents eventsImpl) toString()private void
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
args
-
pluginManager
-
loadedInputs
-
zipReader
-
root
-
classes
-
resources
-
decompileScheduler
-
resourcesLoader
-
customCodeLoaders
-
customResourcesLoaders
-
customPasses
-
closeableList
-
events
-
-
Constructor Details
-
JadxDecompiler
public JadxDecompiler() -
JadxDecompiler
-
-
Method Details
-
load
public void load() -
reloadPasses
public void reloadPasses()Reload passes and plugins without processing classes and inputs -
loadInputFiles
private void loadInputFiles() -
reset
private void reset() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
closeAll
-
loadPlugins
private void loadPlugins() -
unloadPlugins
private void unloadPlugins() -
loadFinished
private void loadFinished() -
registerPlugin
-
getVersion
-
save
public void save() -
save
-
saveSources
public void saveSources() -
saveResources
public void saveResources() -
save
private void save(boolean saveSources, boolean saveResources) -
getSaveTaskExecutor
-
getSaveExecutor
Deprecated, for removal: This API element is subject to removal in a future version. -
getSaveTasks
Deprecated, for removal: This API element is subject to removal in a future version. -
getSaveTasks
-
appendResourcesSaveTasks
-
collectCodeSources
-
appendSourcesSave
-
filterClasses
-
getClasses
-
getClassesWithInners
-
getResources
-
getPackages
-
getErrorsCount
public int getErrorsCount() -
getWarnsCount
public int getWarnsCount() -
printErrorsReport
public void printErrorsReport() -
getRoot
Internal API. Not Stable! -
convertClassNode
Get JavaClass by ClassNode without loading and decompilation -
convertFieldNode
-
convertMethodNode
-
convertPackageNode
-
searchJavaClassByOrigFullName
-
searchClassNodeByOrigFullName
-
searchJavaClassOrItsParentByOrigFullName
-
searchJavaClassByAliasFullName
-
getJavaNodeByRef
-
getJavaNodeByCodeAnnotation
@Nullable public @Nullable JavaNode getJavaNodeByCodeAnnotation(@Nullable @Nullable ICodeInfo codeInfo, @Nullable @Nullable ICodeAnnotation ann) -
resolveVarNode
-
resolveVarRef
-
convertNodes
-
getJavaNodeAtPosition
-
getClosestJavaNode
-
getEnclosingNode
-
reloadCodeData
public void reloadCodeData() -
getArgs
-
getPluginManager
-
getDecompileScheduler
-
events
-
setEventsImpl
-
addCustomCodeLoader
-
getCustomCodeLoaders
-
addCustomResourcesLoader
-
getCustomResourcesLoaders
-
addCustomPass
-
getResourcesLoader
-
getZipReader
-
addCloseable
-
toString
-