diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-04-15 10:02:59 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-04-26 11:42:38 -0400 |
| commit | 864d00b8ec723c48ab148bf97ef4fbc93ef9942c (patch) | |
| tree | df5111b0f79ac68cdf10eed82b5ec7fd9a422fbf | |
| parent | e80242c14066c8734ad00b4b015b3a54a4689463 (diff) | |
Add plugin status when dependencies are being installed
| -rw-r--r-- | binaryninjaapi.h | 1 | ||||
| -rw-r--r-- | binaryninjacore.h | 4 | ||||
| -rw-r--r-- | pluginmanager.cpp | 6 | ||||
| -rw-r--r-- | python/pluginmanager.py | 5 | ||||
| -rw-r--r-- | python/scriptingprovider.py | 2 |
5 files changed, 17 insertions, 1 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index e70490f3..6af35d69 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -5202,6 +5202,7 @@ __attribute__ ((format (printf, 1, 2))) bool IsDisablePending() const; bool IsDeletePending() const; bool IsUpdateAvailable() const; + bool AreDependenciesBeingInstalled() const; bool Uninstall(); bool Install(); diff --git a/binaryninjacore.h b/binaryninjacore.h index 9dd5e40e..f47b2852 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -874,7 +874,8 @@ extern "C" DisablePendingPluginStatus = 0x00000080, PendingRestartPluginStatus = 0x00000200, BeingUpdatedPluginStatus = 0x00000400, - BeingDeletedPluginStatus = 0x00000800 + BeingDeletedPluginStatus = 0x00000800, + DependenciesBeingInstalledStatus = 0x00001000 }; enum BNPluginType @@ -4889,6 +4890,7 @@ __attribute__ ((format (printf, 1, 2))) BINARYNINJACOREAPI bool BNPluginIsDisablePending(BNRepoPlugin* p); BINARYNINJACOREAPI bool BNPluginIsDeletePending(BNRepoPlugin* p); BINARYNINJACOREAPI bool BNPluginIsUpdateAvailable(BNRepoPlugin* p); + BINARYNINJACOREAPI bool BNPluginAreDependenciesBeingInstalled(BNRepoPlugin* p); BINARYNINJACOREAPI char* BNPluginGetProjectData(BNRepoPlugin* p); BINARYNINJACOREAPI uint64_t BNPluginGetLastUpdate(BNRepoPlugin* p); diff --git a/pluginmanager.cpp b/pluginmanager.cpp index 049555be..1500c78e 100644 --- a/pluginmanager.cpp +++ b/pluginmanager.cpp @@ -196,6 +196,12 @@ bool RepoPlugin::IsUpdateAvailable() const } +bool RepoPlugin::AreDependenciesBeingInstalled() const +{ + return BNPluginAreDependenciesBeingInstalled(m_object); +} + + uint64_t RepoPlugin::GetLastUpdate() { return BNPluginGetLastUpdate(m_object); diff --git a/python/pluginmanager.py b/python/pluginmanager.py index 1a3187af..15b98b55 100644 --- a/python/pluginmanager.py +++ b/python/pluginmanager.py @@ -235,6 +235,11 @@ class RepoPlugin(object): return core.BNPluginIsUpdateAvailable(self.handle) @property + def dependencies_being_installed(self): + """Boolean status indicating that the plugin's dependencies are currently being installed""" + return core.BNPluginAreDependenciesBeingInstalled(self.handle) + + @property def project_data(self): """Gets a json object of the project data field""" return json.loads(core.BNPluginGetProjectData(self.handle)) diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 3b088d4a..bdf8e620 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -914,6 +914,8 @@ class PythonScriptingProvider(ScriptingProvider): def _install_modules(self, ctx, modules): # This callback should not be called directly it is indirectly # executed binary ninja is executed with --pip option + if len(modules.strip()) == 0: + return True python_lib = settings.Settings().get_string("python.interpreter") python_bin_override = settings.Settings().get_string("python.binaryOverride") python_bin, status = self._get_executable_for_libpython(python_lib, python_bin_override) |
