Skip to content
Closed
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
1 change: 1 addition & 0 deletions binaryninjaapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -19201,6 +19201,7 @@ namespace BinaryNinja {
std::string GetPluginDirectory() const;
std::string GetAuthor() const;
std::string GetDescription() const;
std::string GetLicenseText() const;
std::string GetName() const;
std::vector<PluginType> GetPluginTypes() const;
std::string GetPackageUrl() const;
Expand Down
1 change: 1 addition & 0 deletions binaryninjacore.h
Original file line number Diff line number Diff line change
Expand Up @@ -7970,6 +7970,7 @@ extern "C"
BINARYNINJACOREAPI char** BNPluginGetApis(BNPlugin* p, size_t* count);
BINARYNINJACOREAPI const char* BNPluginGetAuthor(BNPlugin* p);
BINARYNINJACOREAPI const char* BNPluginGetDescription(BNPlugin* p);
BINARYNINJACOREAPI const char* BNPluginGetLicenseText(BNPlugin* p);
BINARYNINJACOREAPI BNVersionInfo BNPluginGetMinimumVersionInfo(BNPlugin* p);
BINARYNINJACOREAPI BNVersionInfo BNPluginGetMaximumVersionInfo(BNPlugin* p);
BINARYNINJACOREAPI BNVersionInfo BNParseVersionString(const char* v);
Expand Down
5 changes: 5 additions & 0 deletions pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ string Extension::GetDescription() const
RETURN_STRING(BNPluginGetDescription(m_object));
}

string Extension::GetLicenseText() const
{
RETURN_STRING(BNPluginGetLicenseText(m_object));
}

static VersionInfo ConvertVersionInfo(const BNVersionInfo& coreInfo)
{
VersionInfo result;
Expand Down
2 changes: 1 addition & 1 deletion python/pluginmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def description(self) -> Optional[str]:
@deprecation.deprecated(deprecated_in="5.3", details='This field will be removed.')
def license_text(self) -> Optional[str]:
"""String complete license text for the given plugin"""
return ''
return core.BNPluginGetLicenseText(self.handle)

@property
def long_description(self) -> Optional[str]:
Expand Down
7 changes: 7 additions & 0 deletions rust/src/repository/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ impl Extension {
unsafe { BnString::into_string(result as *mut c_char) }
}

/// String complete license text for the given plugin
pub fn license_text(&self) -> String {
let result = unsafe { BNPluginGetLicenseText(self.handle.as_ptr()) };
assert!(!result.is_null());
unsafe { BnString::into_string(result as *mut c_char) }
}

/// Minimum version info the plugin was tested on
pub fn minimum_version_info(&self) -> VersionInfo {
let result = unsafe { BNPluginGetMinimumVersionInfo(self.handle.as_ptr()) };
Expand Down
1 change: 1 addition & 0 deletions rust/tests/repository.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ fn test_list() {
for plugin in &plugins {
let plugin_path = plugin.path();
let plugin_by_path = repository.plugin_by_path(&plugin_path).unwrap();
let _license_text = plugin.license_text();
assert_eq!(plugin.package_url(), plugin_by_path.package_url());
}
}
Loading