You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alert_user('Failed to delete {}, please close Binary Ninja and delete the file/folder manually'.format(ret))
286
+
return
260
287
else:
261
288
# We don't have the latest version, alert user
262
289
alert_user('You are using outdated version of this plugin and it must be updated manually\n1. download the latest version from {}\n2. close Binary Ninja\n3. replace the outdated plugin with the newly downloaded file in {}'.format(file_url, binaryninja.user_plugin_path()))
alert_user('You are using outdated version of this plugin and it must be updated manually\n1. download the latest version from {}\n2. close Binary Ninja\n3. replace the outdated plugin with the newly downloaded file in {}'.format(file_url, binaryninja.user_plugin_path()))
269
296
else:
270
297
# Nope, version noted in data doesn't correspond to the hash of currently installed plugin (user probably replaced the plugin)
271
-
delete_data_file()
298
+
ret=delete_data_file()
299
+
ifret!=True:
300
+
alert_user('Failed to delete {}, please close Binary Ninja and delete the file/folder manually'.format(ret))
301
+
return
272
302
# Download latest version of the plugin and check if we have that version
273
303
download_file_to_temp(file_url, file)
274
304
if (calculate_hash(os.path.join(binaryninja.user_plugin_path(), file)) ==calculate_hash(os.path.join(binaryninja.user_plugin_path(), 'temp', file))):
# Make sure the version in the data directory is actually the version we have installed (we compare hashes - hash now and hash when we downloaded the plugin)
284
314
if (data_hash!=calculate_hash(os.path.join(binaryninja.user_plugin_path(), file))):
285
315
# Nope, hash noted in data doesn't correspond to the hash of currently installed plugin (user probably replaced the plugin with different version)
286
-
delete_data_file()
316
+
ret=delete_data_file()
317
+
ifret!=True:
318
+
alert_user('Failed to delete {}, please close Binary Ninja and delete the file/folder manually'.format(ret))
319
+
return
287
320
# Let's check if our plugin matches the hash in the latest github release (developer could have replaced file in the github release and user updated to it)
288
321
download_file_to_temp(file_url, file)
289
322
if (calculate_hash(os.path.join(binaryninja.user_plugin_path(), file)) ==calculate_hash(os.path.join(binaryninja.user_plugin_path(), 'temp', file))):
290
323
# Yep, hash of the plugin in the github release corresponds to the hash of currently installed plugin so we have the latest one
alert_user('Failed to delete {}, please close Binary Ninja and delete the file/folder manually'.format(ret))
328
+
return
293
329
else:
294
330
# Not the latest one (according to the hash in the github release), but user might be intending to test different version of the plugin, add ignore option
295
331
alert_user('You are using outdated version of this plugin and it must be updated manually\n1. download the latest version from {}\n2. close Binary Ninja\n3. replace the outdated plugin with the newly downloaded file in {}'.format(file_url, binaryninja.user_plugin_path()))
0 commit comments