Skip to content

Commit dbbf95f

Browse files
committed
Legacy API Fixes + Deprecation of APIs that will be removed in a future update
1 parent 3c218e9 commit dbbf95f

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

binaryninjacore.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7977,6 +7977,8 @@ extern "C"
79777977
BINARYNINJACOREAPI const char* BNPluginGetPath(BNPlugin* p);
79787978
BINARYNINJACOREAPI const char* BNPluginGetSubdir(BNPlugin* p);
79797979
BINARYNINJACOREAPI const char* BNPluginGetDependencies(BNPlugin* p);
7980+
BINARYNINJACOREAPI const char* BNPluginGetLongdescription(BNPlugin* p);
7981+
BINARYNINJACOREAPI uint64_t BNPluginGetLastUpdate(BNPlugin* p);
79807982
BINARYNINJACOREAPI bool BNPluginIsInstalled(BNPlugin* p);
79817983
BINARYNINJACOREAPI bool BNPluginIsEnabled(BNPlugin* p);
79827984
BINARYNINJACOREAPI BNPluginStatus BNPluginGetPluginStatus(BNPlugin* p);

python/pluginmanager.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,16 @@ def api(self) -> List[str]:
126126
core.BNFreePluginPlatforms(platforms, count.value)
127127

128128
@property
129+
@deprecation.deprecated(deprecated_in="5.3", details='Use :py:attr:`current_version` in combination with :py:attr:`versions` instead.')
129130
def description(self) -> Optional[str]:
130131
"""String short description of the plugin"""
131132
return core.BNPluginGetDescription(self.handle)
132133

133134
@property
135+
@deprecation.deprecated(deprecated_in="5.3", details='This field will be removed.')
134136
def license_text(self) -> Optional[str]:
135137
"""String complete license text for the given plugin"""
136-
return core.BNPluginGetLicenseText(self.handle)
138+
return ''
137139

138140
@property
139141
def long_description(self) -> Optional[str]:
@@ -185,6 +187,7 @@ def project_url(self) -> Optional[str]:
185187
return core.BNPluginGetProjectUrl(self.handle)
186188

187189
@property
190+
@deprecation.deprecated(deprecated_in="5.3", details='Use :py:attr:`current_version` in combination with :py:attr:`versions` instead.')
188191
def package_url(self) -> Optional[str]:
189192
"""String URL of the plugin's zip file"""
190193
return core.BNPluginGetPackageUrl(self.handle)
@@ -200,9 +203,17 @@ def author(self) -> Optional[str]:
200203
return core.BNPluginGetAuthor(self.handle)
201204

202205
@property
206+
@deprecation.deprecated(deprecated_in="5.3", details='Use :py:attr:`current_version` in combination with :py:attr:`versions` instead.')
203207
def version(self) -> Optional[str]:
204208
"""String version of the plugin"""
205-
return core.BNPluginGetVersion(self.handle)
209+
version: core.BNPluginVersion = core.BNPluginGetCurrentVersion(self.handle)
210+
try:
211+
version_string = version.versionString
212+
except AttributeError:
213+
version_string = ""
214+
finally:
215+
core.BNPluginFreeVersion(version)
216+
return version_string
206217

207218
@property
208219
def install_platforms(self) -> List[str]:
@@ -259,13 +270,15 @@ def dependencies_being_installed(self) -> bool:
259270
return core.BNPluginAreDependenciesBeingInstalled(self.handle)
260271

261272
@property
273+
@deprecation.deprecated(deprecated_in="5.3", details='This field will be removed.')
262274
def project_data(self) -> Dict:
263275
"""Gets a json object of the project data field"""
264276
data = core.BNPluginGetProjectData(self.handle)
265277
assert data is not None, "core.BNPluginGetProjectData returned None"
266278
return json.loads(data)
267279

268280
@property
281+
@deprecation.deprecated(deprecated_in="5.3", details='Use :py:attr:`versions` in combination with :py:attr:`current_version` to check for updates instead.')
269282
def last_update(self) -> date:
270283
"""Returns a datetime object representing the plugins last update"""
271284
return datetime.fromtimestamp(core.BNPluginGetLastUpdate(self.handle))

0 commit comments

Comments
 (0)