jade_ota.py: fetch and log device info before fetching fw
What changed, and why it matters
This change simply moves and improves the logging of which Jade hardware device is about to receive a firmware update. Before, the device info was shown after the firmware download had already started; now it is fetched and logged first so the user can confirm the correct device before any download or update begins. There is no security vulnerability here.
No security action required. This is a benign UX improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors jade_ota.py to introduce a helper get_version_info() that calls jade.get_version_info() and logs the returned JSON device info with proper formatting. The existing ota() function no longer logs the raw info object, and the main flow now calls the helper before invoking get_firmware()/ota(). This is a UX/logging reordering with no functional change to authentication, cryptography, or update logic.
Changed components
jade_ota.pyInspect captured patch +10 / −5
diff --git a/jade_ota.py b/jade_ota.py
index 9909fd8..251ed08 100755
--- a/jade_ota.py
+++ b/jade_ota.py
@@ -236,6 +236,13 @@ def get_local_compressed_fwfile(fwfilename):
return fwinfo.fwsize, fwinfo2.fwsize if fwinfo2 else None, fwhash, fwcmp
+# Fetch and log the Jade device information
+def get_version_info(jade):
+ info = jade.get_version_info()
+ logger.info(f'Jade device for OTA: {json.dumps(info, indent=4)}')
+ return info
+
+
# Returns whether we have ble and the id of the jade
def get_bleid(info):
has_radio = info['JADE_CONFIG'] == 'BLE'
@@ -282,9 +289,7 @@ def ota(args, jade, info, extended_replies):
# Fetch the firmware to upload
fwlength, patchlen, fwhash, fwcompressed = get_firmware(args)
- logger.info(f'Running OTA on: {info}')
has_pin = info['JADE_HAS_PIN']
-
chunksize = int(info['JADE_OTA_MAX_CHUNK'])
assert chunksize > 0
@@ -503,14 +508,14 @@ if __name__ == '__main__':
with JadeAPI.create_serial(device=args.serialport) as jade:
# By default serial uses extended-replies
extended_replies = not args.noextendedreplies
- info = jade.get_version_info()
+ info = get_version_info(jade)
has_radio, bleid = ota(args, jade, info, extended_replies)
elif not args.skipble:
if has_radio and bleid is None and args.bleidfromserial:
logger.info(f'Jade OTA getting bleid via serial connection')
with JadeAPI.create_serial(device=args.serialport) as jade:
- info = jade.get_version_info()
+ info = get_version_info(jade)
if has_radio:
logger.info(f'Jade OTA over BLE {bleid}')
@@ -518,7 +523,7 @@ if __name__ == '__main__':
# Do not use extended-replies for ble
extended_replies = False
if not info:
- info = jade.get_version_info()
+ info = get_version_info(jade)
ota(args, jade, info, extended_replies)
else:
msg = 'Skipping BLE tests - not enabled on the hardware'
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.