Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved arm64 support #28

Merged

Conversation

GavinPacini
Copy link
Contributor

The arm64 port of Tor Browser often does not have the same versions available as the official upstream. So, we need to track two hardcoded versions, one for amd64 and one for arm64.

Further to this, fetching the latest remote version does not work for arm64 so we also just fallback to the hardcoded version in this case.

@adrelanos
Copy link
Member

tb_remote_version_parser runs after tb_update_check. This would then output a false console output:

echo "INFO: Find out latest version... Downloading...: $TBB_VERSIONS_FILE_LINK"

But even with that resolved would be kinda stub, hacky implementation... For a full implementation...

Do you think you could parse https://sourceforge.net/projects/tor-browser-ports/files/ instead, add that to the version parser or create an alternative version parser?

Version parser doesn't necessarily need to be written in bash. Could be any language which you might (I dunno) be more comfortable with, seem more suitable. Download could be done by update-torbrowser. Parsing could be done by an externally called script written in a memory safe language to be discussed such as python. (With dependencies available from packages.debian.org.)

@adrelanos
Copy link
Member

Here is a parser but needs some more work integrating it.

#!/usr/bin/python3 -u

# Copyright (C) 2024 - 2024 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
# See the file COPYING for copying conditions.

## TODO: debian/control
## sudo apt install python3-bs4

from bs4 import BeautifulSoup
import re

def get_latest_version(file_path):
    with open(file_path, 'r') as file:
        content = file.read()
        soup = BeautifulSoup(content, 'html.parser')

        # Find the span with class 'sub-label'
        sub_label_span = soup.find('span', class_='sub-label')
        if sub_label_span:
            text = sub_label_span.get_text()
            # Use regular expression to extract the version number
            match = re.search(r'\b\d+\.\d+\.\d+\b', text)
            if match:
                return match.group()
        return None

# Replace this with the path to your local HTML file
file_path = "./html"
latest_version = get_latest_version(file_path)
print(latest_version)

@adrelanos adrelanos merged commit 1dc08d7 into Kicksecure:master Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants