summaryrefslogtreecommitdiff
path: root/binaryninjaapi.h
diff options
context:
space:
mode:
Diffstat (limited to 'binaryninjaapi.h')
-rw-r--r--binaryninjaapi.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h
index 8df46775..ab84afc4 100644
--- a/binaryninjaapi.h
+++ b/binaryninjaapi.h
@@ -374,8 +374,10 @@ namespace BinaryNinja
void InitCorePlugins();
void InitUserPlugins();
+ void InitRepoPlugins();
std::string GetBundledPluginDirectory();
void SetBundledPluginDirectory(const std::string& path);
+ std::string GetInstallDirectory();
std::string GetUserPluginDirectory();
std::string GetPathRelativeToBundledPluginDirectory(const std::string& path);
@@ -2742,4 +2744,69 @@ namespace BinaryNinja
virtual BNMessageBoxButtonResult ShowMessageBox(const std::string& title, const std::string& text,
BNMessageBoxButtonSet buttons = OKButtonSet, BNMessageBoxIcon icon = InformationIcon) = 0;
};
+
+ typedef BNPluginOrigin PluginOrigin;
+ typedef BNPluginUpdateStatus PluginUpdateStatus;
+ typedef BNPluginType PluginType;
+
+ class RepoPlugin: public CoreRefCountObject<BNRepoPlugin, BNNewPluginReference, BNFreePlugin>
+ {
+ public:
+ RepoPlugin(BNRepoPlugin* plugin);
+ std::string GetPath() const;
+ bool IsInstalled() const;
+ std::string GetPluginDirectory() const;
+ void SetEnabled(bool enabled);
+ bool IsEnabled() const;
+ PluginUpdateStatus GetPluginUpdateStatus() const;
+ std::string GetApi() const;
+ std::string GetAuthor() const;
+ std::string GetDescription() const;
+ std::string GetLicense() const;
+ std::string GetLicenseText() const;
+ std::string GetLongdescription() const;
+ std::string GetMinimimVersions() const;
+ std::string GetName() const;
+ std::vector<PluginType> GetPluginTypes() const;
+ std::string GetUrl() const;
+ std::string GetVersion() const;
+ };
+
+ class Repository: public CoreRefCountObject<BNRepository, BNNewRepositoryReference, BNFreeRepository>
+ {
+ public:
+ Repository(BNRepository* repository);
+ ~Repository();
+ std::string GetUrl() const;
+ std::string GetRepoPath() const;
+ std::string GetLocalReference() const;
+ std::string GetRemoteReference() const;
+ std::vector<Ref<RepoPlugin>> GetPlugins() const;
+ bool IsInitialized() const;
+ std::string GetPluginDirectory() const;
+ Ref<RepoPlugin> GetPluginByPath(const std::string& pluginPath);
+ std::string GetFullPath() const;
+ };
+
+ class RepositoryManager: public CoreRefCountObject<BNRepositoryManager, BNNewRepositoryManagerReference, BNFreeRepositoryManager>
+ {
+ bool m_core;
+ public:
+ RepositoryManager(const std::string& enabledPluginsPath);
+ RepositoryManager(BNRepositoryManager* repoManager);
+ RepositoryManager();
+ ~RepositoryManager();
+ bool CheckForUpdates();
+ std::vector<Ref<Repository>> GetRepositories();
+ Ref<Repository> GetRepositoryByPath(const std::string& repoName);
+ bool AddRepository(const std::string& url,
+ const std::string& repoPath, // Relative path within the repositories directory
+ const std::string& localReference="master",
+ const std::string& remoteReference="origin");
+ bool EnablePlugin(const std::string& repoName, const std::string& pluginPath);
+ bool DisablePlugin(const std::string& repoName, const std::string& pluginPath);
+ bool InstallPlugin(const std::string& repoName, const std::string& pluginPath);
+ bool UninstallPlugin(const std::string& repoName, const std::string& pluginPath);
+ Ref<Repository> GetDefaultRepository();
+ };
}