Class ExtensionUtils
java.lang.Object
ghidra.framework.project.extensions.ExtensionUtils
Utility class for managing Ghidra Extensions.
Extensions are defined as any archive or folder that contains an extension.properties
file. This properties file can contain the following attributes:
- name (required)
- description
- author
- createdOn (format: MM/dd/yyyy)
- version
Extensions may be installed/uninstalled by users at runtime, using the
ExtensionTableProvider
. Installation consists of unzipping the extension archive to an
installation folder, currently {ghidra user settings dir}/Extensions
. To uninstall,
the unpacked folder is simply removed.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<ExtensionDetails>
Gets all known extensions that have not been marked for removal.static Set<ExtensionDetails>
Returns all archive extensions.static Set<ExtensionDetails>
Returns all installed extensions.static void
Performs extension maintenance.static boolean
Installs the given extension file.static boolean
installExtensionFromArchive
(ExtensionDetails extension) Installs the given extension from its declared archive pathstatic boolean
isExtension
(File file) Returns true if the given file or directory is a valid ghidra extension.
-
Field Details
-
PROPERTIES_FILE_NAME
-
PROPERTIES_FILE_NAME_UNINSTALLED
-
-
Constructor Details
-
ExtensionUtils
public ExtensionUtils()
-
-
Method Details
-
initializeExtensions
public static void initializeExtensions()Performs extension maintenance. This should be called at startup, before any plugins or extension points are loaded. -
getActiveInstalledExtensions
Gets all known extensions that have not been marked for removal.- Returns:
- set of installed extensions
-
getInstalledExtensions
Returns all installed extensions. These are all the extensions found inApplicationLayout.getExtensionInstallationDirs()
.- Returns:
- set of installed extensions
-
getArchiveExtensions
Returns all archive extensions. These are all the extensions found inApplicationLayout.getExtensionArchiveDir()
. This are added to an installation as part of the build processes.Archived extensions may be zip files and directories.
- Returns:
- set of archive extensions
-
install
Installs the given extension file. This can be either an archive (zip) or a directory that contains an extension.properties file.- Parameters:
file
- the extension to install- Returns:
- true if the extension was successfully installed
-
installExtensionFromArchive
Installs the given extension from its declared archive path- Parameters:
extension
- the extension- Returns:
- true if successful
-
isExtension
Returns true if the given file or directory is a valid ghidra extension.Note: This means that the zip or directory contains an extension.properties file.
- Parameters:
file
- the zip or directory to inspect- Returns:
- true if the given file represents a valid extension
-