Skip to content

Commit 0988b0c

Browse files
author
0cyn
committed
Expose 'is_paid' Extension field in API
1 parent e616cde commit 0988b0c

5 files changed

Lines changed: 18 additions & 0 deletions

File tree

binaryninjaapi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19218,6 +19218,7 @@ namespace BinaryNinja {
1921819218
VersionInfo GetMaximumVersionInfo() const;
1921919219
std::string GetCreationDate();
1922019220
bool IsViewOnly() const;
19221+
bool IsPaid() const;
1922119222
bool IsBeingDeleted() const;
1922219223
bool IsBeingUpdated() const;
1922319224
bool IsInstalled() const;

binaryninjacore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7986,6 +7986,7 @@ extern "C"
79867986
BINARYNINJACOREAPI void BNPluginFreeVersion(BNPluginVersion v);
79877987
BINARYNINJACOREAPI const char* BNPluginGetCommit(BNPlugin* p);
79887988
BINARYNINJACOREAPI const bool BNPluginGetViewOnly(BNPlugin* p);
7989+
BINARYNINJACOREAPI const bool BNPluginGetIsPaid(BNPlugin* p);
79897990
BINARYNINJACOREAPI void BNFreePluginTypes(BNPluginType* r);
79907991
BINARYNINJACOREAPI BNPlugin* BNNewPluginReference(BNPlugin* r);
79917992
BINARYNINJACOREAPI void BNFreePlugin(BNPlugin* plugin);

pluginmanager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ bool Extension::IsViewOnly() const
219219
}
220220

221221

222+
bool Extension::IsPaid() const
223+
{
224+
return BNPluginGetIsPaid(m_object);
225+
}
226+
227+
222228
string Extension::GetRepository() const
223229
{
224230
RETURN_STRING(BNPluginGetRepository(m_object));

python/pluginmanager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ def package_url(self) -> Optional[str]:
221221
"""String URL of the plugin's zip file"""
222222
return core.BNPluginGetPackageUrl(self.handle)
223223

224+
@property
225+
def is_paid(self) -> bool:
226+
"""Boolean True if this plugin requires payment, False otherwise"""
227+
return core.BNPluginGetIsPaid(self.handle)
228+
224229
@property
225230
def author_url(self) -> Optional[str]:
226231
"""String URL of the plugin author's url"""

rust/src/repository/plugin.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ impl Extension {
150150
unsafe { BnString::into_string(result as *mut c_char) }
151151
}
152152

153+
/// Boolean True if this plugin requires payment, False otherwise
154+
pub fn is_paid(&self) -> bool {
155+
unsafe { BNPluginGetIsPaid(self.handle.as_ptr()) }
156+
}
157+
153158
/// String URL of the plugin author's url
154159
pub fn author_url(&self) -> String {
155160
let result = unsafe { BNPluginGetAuthorUrl(self.handle.as_ptr()) };

0 commit comments

Comments
 (0)