Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions binaryninjaapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -20915,6 +20915,11 @@ namespace BinaryNinja {
bool Uninstall();
bool CancelUninstall();
bool Install(std::string versionID);
// Like Install, but also permits installing a version of a plugin that has since been marked

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't leave these AI-generated comments here. These don't do us any good. If this information is necessary (and I think it is, I would have no idea what this is for), we should have this documented in each externally-facing API we provide (e.g. in pluginmanager.cpp) so that it shows up in user-facing documentation.

// deprecated. Intended only for migrating a plugin the user already had installed under a previous
// extension manager: deprecation should block fresh installs, but must never strand a
// previously-installed plugin where it can't be registered as installed (and so can't be uninstalled).
bool InstallForMigration(std::string versionID);
bool InstallDependencies();
bool InstallDependencies(const std::string& versionID);
bool InstallDependencies(const std::vector<std::string>& excludedPackageNames);
Expand Down
3 changes: 2 additions & 1 deletion binaryninjacore.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
// Current ABI version for linking to the core. This is incremented any time
// there are changes to the API that affect linking, including new functions,
// new types, or modifications to existing functions or types.
#define BN_CURRENT_CORE_ABI_VERSION 188
#define BN_CURRENT_CORE_ABI_VERSION 189

// Minimum ABI version that is supported for loading of plugins. Plugins that
// are linked to an ABI version less than this will not be able to load and
Expand Down Expand Up @@ -8910,6 +8910,7 @@ extern "C"
BINARYNINJACOREAPI bool BNPluginEnable(BNPlugin* p, bool force);
BINARYNINJACOREAPI bool BNPluginDisable(BNPlugin* p);
BINARYNINJACOREAPI bool BNPluginInstall(BNPlugin* p, const char* versionID);
BINARYNINJACOREAPI bool BNPluginInstallForMigration(BNPlugin* p, const char* versionID);
BINARYNINJACOREAPI bool BNPluginInstallDependencies(BNPlugin* p);
BINARYNINJACOREAPI bool BNPluginInstallDependenciesForVersion(BNPlugin* p, const char* versionID);
BINARYNINJACOREAPI bool BNPluginInstallDependenciesWithExclusions(BNPlugin* p,
Expand Down
9 changes: 9 additions & 0 deletions pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,15 @@ bool Extension::Install(std::string versionID)
}


bool Extension::InstallForMigration(std::string versionID)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine, but where are the Python and Rust equivalents? Also, see other note about moving documentation to here.

{
char* versionIDStr = BNAllocString(versionID.c_str());
auto success = BNPluginInstallForMigration(m_object, versionIDStr);
BNFreeString(versionIDStr);
return success;
}


bool Extension::InstallDependencies()
{
return InstallDependencies("");
Expand Down