Skip to content

few things#147

Merged
StephenDev0 merged 21 commits intoStephenDev0:mainfrom
neoarz:main
Apr 19, 2025
Merged

few things#147
StephenDev0 merged 21 commits intoStephenDev0:mainfrom
neoarz:main

Conversation

@neoarz
Copy link
Contributor

@neoarz neoarz commented Apr 19, 2025

  1. Make a workflow to automatically update ios version in readme
  2. added direct links to install ipa, get repo, add repo to sidestore/altstore
  3. Create a issue templates (feature request, bug report)

@yodaluca23
Copy link
Contributor

Wouldn't be better to parse a dedicated iOS version tracking site such as appledb? https://appledb.dev/firmware.html instead of Wikipedia, that anyone could edit...

@yodaluca23
Copy link
Contributor

yodaluca23 commented Apr 19, 2025

@yodaluca23
Copy link
Contributor

yodaluca23 commented Apr 19, 2025

Sorry if I'm spamming too much, but if you did want to use the AppleDB API I put together this Python function, this should work, feel free to use it, tweak it, or not. I think this probably would be better than using Wikipedia. Sorry, again, if I wasted your time.

def get_latest_ios_version():

    # Function to parse the version formats into a comparable format.
    def parse_version(v):

        # Split into main and suffix (e.g., "11.2.4b3" or "11.2.4rc2")
        match = re.match(r'^([\d\.]+)(b\d+|rc\d+)?$', v)
        main = match.group(1)
        suffix = match.group(2) or ''
        
        # Convert version parts to integers, suffix stays string for now
        parts = [int(p) for p in main.split('.')]

        if suffix.startswith('b'):
            # Beta versions come before RCs and finals
            parts.append(-2)
            parts.append(int(suffix[1:]))  # remove 'b' and convert to int
        elif suffix.startswith('rc'):
            # RC versions come after betas but before final
            parts.append(-1)
            parts.append(int(suffix[2:]))  # remove 'rc' and convert to int
        else:
            # Final releases come after all betas and RCs
            parts.append(0)  # no suffix is considered highest

        return parts
    
    # Fetch data from the API
    url = "https://api.appledb.dev/ios/iOS/main.json"
    response = requests.get(url)
    data = response.json()

    # Initialize variable to track latest iOS version
    latest_ios = None

    # Loop through all releases
    for versionInfo in data:

        # Try block so it continues for weird entries like iOS 9.0 GM build: 13A341
        try:
            # Consistent beta/RC formatting
            name = versionInfo['version'].replace(" beta ", "b").replace(" beta", "b1").replace(" RC ", "rc").replace(" RC", "rc1")

            # Check if latest_ios is not None before setting latest_name
            if latest_ios is not None:
                latest_name = latest_ios['compactName']
            else:
                latest_name = None

            # Optional debug print statement.
            # print(f"Comparing {name} to latest so far: {latest_name}.")

            # Filter out Simulator releases and Rapid-Security-Response updates, then check if it's greater than the currently marked latest
            if not "Simulator" in name and not "(" in name and (latest_name is None or parse_version(name) > parse_version(latest_name)):

                # Set the latest_ios to this loop item, and create a new entry with our consistently formatted name
                latest_ios = versionInfo
                latest_ios['compactName'] = name
        except:

            # Continue if we get an error
            continue

    # Print the latest iOS version name
    print(f"Latest iOS version: {latest_ios['version']}")

    # Return our consistently formatted name
    return latest_ios['compactName']

@neoarz
Copy link
Contributor Author

neoarz commented Apr 19, 2025

@yodaluca23 apperciate it, ive changed the workflow to use appdbs api and ispws as fallback, tested on my fork and all works well, cheers

@StephenDev0 StephenDev0 merged commit b136195 into StephenDev0:main Apr 19, 2025
1 check passed
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.

4 participants