From 516a9c8adda96fa72eff38c1ba94fc6607240910 Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sun, 19 Nov 2023 15:02:49 +0100 Subject: [PATCH] auto-update.py: Added aarch64 check for pwngrid/bettercap Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/plugins/default/auto-update.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pwnagotchi/plugins/default/auto-update.py b/pwnagotchi/plugins/default/auto-update.py index 759d617a..09cb73a9 100644 --- a/pwnagotchi/plugins/default/auto-update.py +++ b/pwnagotchi/plugins/default/auto-update.py @@ -28,17 +28,27 @@ def check(version, repo, native=True): latest = resp.json() info['available'] = latest_ver = latest['tag_name'].replace('v', '') is_arm = info['arch'].startswith('arm') + is_arm64 = info['arch'].startwith('aarch') local = version_to_tuple(info['current']) remote = version_to_tuple(latest_ver) if remote > local: if not native: info['url'] = "https://github.com/%s/archive/%s.zip" % (repo, latest['tag_name']) - else: + elif is_arm: # check if this release is compatible with arm6 for asset in latest['assets']: download_url = asset['browser_download_url'] - if download_url.endswith('.zip') and (info['arch'] in download_url or (is_arm and 'armhf' in download_url)): + if (download_url.endswith('.zip') and + (info['arch'] in download_url or (is_arm and 'armhf' in download_url))): + info['url'] = download_url + break + elif is_arm64: + # check if this release is compatible with aarch64 + for asset in latest['assets']: + download_url = asset['browser_download_url'] + if (download_url.endswith('.zip') and + (info['arch'] in download_url or (is_arm64 and 'aarch64' in download_url))): info['url'] = download_url break