File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7982,6 +7982,7 @@ extern "C"
79827982 BINARYNINJACOREAPI BNPluginVersion* BNPluginGetVersions(BNPlugin* p, size_t* count);
79837983 BINARYNINJACOREAPI void BNFreePluginVersions(BNPluginVersion* r, size_t count);
79847984 BINARYNINJACOREAPI const char* BNPluginGetCurrentVersionID(BNPlugin* p);
7985+ BINARYNINJACOREAPI const char* BNPluginGetLatestVersionID(BNPlugin* p);
79857986 BINARYNINJACOREAPI BNPluginVersion BNPluginGetCurrentVersion(BNPlugin* p);
79867987 BINARYNINJACOREAPI void BNPluginFreeVersion(BNPluginVersion v);
79877988 BINARYNINJACOREAPI const char* BNPluginGetCommit(BNPlugin* p);
Original file line number Diff line number Diff line change @@ -194,10 +194,7 @@ std::string Extension::GetCurrentVersionID() const
194194
195195std::string Extension::GetLatestVersionID () const
196196{
197- auto versions = GetVersions ();
198- if (versions.empty ())
199- return " " ;
200- return versions.front ().id ;
197+ RETURN_STRING (BNPluginGetLatestVersionID (m_object));
201198}
202199
203200
Original file line number Diff line number Diff line change @@ -262,6 +262,13 @@ def current_version(self) -> ExtensionVersion:
262262 finally :
263263 core .BNPluginFreeVersion (version )
264264
265+ @property
266+ def latest_version_id (self ) -> str :
267+ """Repository-provided latest version id for the plugin"""
268+ result = core .BNPluginGetLatestVersionID (self .handle )
269+ assert result is not None , "core.BNPluginGetLatestVersionID returned None"
270+ return result
271+
265272 @property
266273 def versions (self ) -> List [ExtensionVersion ]:
267274 """Version metadata for all available plugin versions"""
Original file line number Diff line number Diff line change @@ -129,6 +129,13 @@ impl Extension {
129129 ExtensionVersion :: from_owned_raw ( result)
130130 }
131131
132+ /// Repository-provided latest version id for this plugin
133+ pub fn latest_version_id ( & self ) -> String {
134+ let result = unsafe { BNPluginGetLatestVersionID ( self . handle . as_ptr ( ) ) } ;
135+ assert ! ( !result. is_null( ) ) ;
136+ unsafe { BnString :: into_string ( result as * mut c_char ) }
137+ }
138+
132139 /// String plugin name
133140 pub fn name ( & self ) -> String {
134141 let result = unsafe { BNPluginGetName ( self . handle . as_ptr ( ) ) } ;
You can’t perform that action at this time.
0 commit comments