diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 405768b6..1aed5bc9 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ android-gradle-plugin = "9.3.1" androidx-activity = "1.13.0" androidx-camera = "1.6.1" -androidx-compose-bom = "2026.06.01" -androidx-compose-material3 = "1.5.0-alpha25" +androidx-compose-bom = "2026.08.00" +androidx-compose-material3 = "1.5.0-alpha26" androidx-core = "1.19.0" androidx-lifecycle-viewmodel-compose = "2.11.0" androidx-preference = "1.2.1" diff --git a/gradle/update_verification.py b/gradle/update_verification.py index 3ef8bf1a..2dbbe11c 100755 --- a/gradle/update_verification.py +++ b/gradle/update_verification.py @@ -1,8 +1,10 @@ #!/usr/bin/env python3 -# SPDX-FileCopyrightText: 2023-2024 Andrew Gunnerson +# SPDX-FileCopyrightText: 2023-2026 Andrew Gunnerson # SPDX-License-Identifier: GPL-3.0-only +from collections.abc import Callable, Iterable +import dataclasses import hashlib import io import os @@ -12,12 +14,14 @@ import urllib.request import xml.etree.ElementTree as ET - GOOGLE_MAVEN_REPO = 'https://dl.google.com/android/maven2' -def add_source_exclusions(ns, root): +def add_source_exclusions(ns: str, root: ET.Element): configuration = root.find(f'{{{ns}}}configuration') + if configuration is None: + raise ValueError(' tag not found') + trusted_artifacts = ET.SubElement( configuration, f'{{{ns}}}trusted-artifacts') @@ -32,29 +36,54 @@ def add_source_exclusions(ns, root): }) -def add_missing_aapt2_platforms(ns, root): - components = root.find(f'{{{ns}}}components') - aapt2 = components.find(f'{{{ns}}}component[@name="aapt2"]') +@dataclasses.dataclass +class ArtifactInfo: + group: str + name: str + version: str - for platform in ['linux', 'osx', 'windows']: - group = aapt2.attrib['group'] - name = aapt2.attrib['name'] - version = aapt2.attrib['version'] - filename = f'{name}-{version}-{platform}.jar' - if aapt2.find(f'{{{ns}}}artifact[@name="{filename}"]') is not None: - continue +@dataclasses.dataclass +class ArtifactAssets: + repo: str + files: list[str] + - path = f'{group.replace(".", "/")}/{name}/{version}/{filename}' - url = f'{GOOGLE_MAVEN_REPO}/{path}' +def add_missing_components( + ns: str, + root: ET.Element, + name: str, + assets_for: Callable[[ArtifactInfo], ArtifactAssets], +): + components = root.find(f'{{{ns}}}components') + if components is None: + raise ValueError(' tag not found') + + component = components.find(f'{{{ns}}}component[@name="{name}"]') + if component is None: + raise ValueError(f' tag not found') + + info = ArtifactInfo( + group=component.attrib['group'], + name=component.attrib['name'], + version=component.attrib['version'], + ) + assets = assets_for(info) + + for filename in assets.files: + if component.find(f'{{{ns}}}artifact[@name="{filename}"]') is not None: + continue - with urllib.request.urlopen(url) as r: - if r.status != 200: - raise Exception(f'{url} returned HTTP {r.status}') + path = f'{info.group.replace(".", "/")}/{name}/{info.version}/{filename}' + url = f'{assets.repo}/{path}' - digest = hashlib.file_digest(r, 'sha512') + try: + with urllib.request.urlopen(url) as r: + digest = hashlib.file_digest(r, 'sha512') + except urllib.request.HTTPError as e: + raise Exception(f'Failed to download: {e.url}') from e - artifact = ET.SubElement(aapt2, f'{{{ns}}}artifact', + artifact = ET.SubElement(component, f'{{{ns}}}artifact', attrib={'name': filename}) ET.SubElement(artifact, f'{{{ns}}}sha512', attrib={ @@ -62,10 +91,24 @@ def add_missing_aapt2_platforms(ns, root): 'origin': 'Generated by Gradle', }) - aapt2[:] = sorted(aapt2, key=lambda child: child.attrib['name']) + component[:] = sorted(component, key=lambda child: child.attrib['name']) + + +def add_missing_aapt2_platforms(ns: str, root: ET.Element): + platforms = ['linux', 'osx', 'windows'] + + add_missing_components( + ns, + root, + 'aapt2', + lambda info: ArtifactAssets( + repo=GOOGLE_MAVEN_REPO, + files=[f'{info.name}-{info.version}-{p}.jar' for p in platforms], + ), + ) -def patch_xml(path): +def patch_xml(path: str | os.PathLike[str]): tree = ET.parse(path) root = tree.getroot() @@ -75,8 +118,8 @@ def patch_xml(path): # Add exclusions to allow Android Studio to download sources. add_source_exclusions(ns, root) - # Gradle only adds the aapt2 entry for the host OS. We have to manually add - # the checksums for the other major desktop OSs. + # Gradle only adds entries for the host OS. We have to manually add the + # checksums for the other major desktop OSs. add_missing_aapt2_platforms(ns, root) # Match gradle's formatting exactly. diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 54ac3b84..de471040 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -1,5 +1,5 @@ - + true false @@ -233,68 +233,53 @@ - - - + + + - - - + + + - - - - - - - - - - - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - - - - - - + + + @@ -302,66 +287,56 @@ - - - - - - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - - - - - - + + + @@ -369,58 +344,43 @@ - - - - - - - - + + + - + - - - + + + - - - - - - - - + + + - + - - - + + + - - - + + + - - - - - - + - - - + + + @@ -428,17 +388,12 @@ - - - - - - - - + + + - + @@ -446,14 +401,9 @@ - - - - - - - - + + + @@ -461,186 +411,116 @@ - - - - - - - - + + + - - - - - - + - - - + + + - - - - - - - - + + + - - - - - - + - - - + + + - - - - - - - - + + + - + - - - + + + - - - + + + - - - - - - + - - - + + + - - - - - - - - + + + - - - - - - + - - - + + + - - - - - - - - + + + - - - - - - + - - - + + + - - - - - - - - + + + - - - - - - + - - - + + + - - - - - - - - + + + - - - - - - + - - - + + + - - - + + + - + @@ -1194,6 +1074,11 @@ + + + + + @@ -1207,16 +1092,6 @@ - - - - - - - - - - @@ -1227,11 +1102,6 @@ - - - - - @@ -1260,6 +1130,11 @@ + + + + + @@ -1358,11 +1233,6 @@ - - - - - @@ -3572,12 +3442,12 @@ - - - + + + - - + + @@ -3628,14 +3498,6 @@ - - - - - - - - diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index b1b8ef56..eddabd2e 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dbe66e1d..760c4596 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14 -distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip +distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a +distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip networkTimeout=10000 retries=0 retryBackOffMs=500 diff --git a/stbridge/go.mod b/stbridge/go.mod index b52ea7bf..23e4d54f 100644 --- a/stbridge/go.mod +++ b/stbridge/go.mod @@ -5,7 +5,7 @@ go 1.26 require ( github.com/syncthing/syncthing v0.0.0 go.foxforensics.eu/go-zip v1.0.0 - golang.org/x/mobile v0.0.0-20260803200217-62cee1672c8e + golang.org/x/mobile v0.0.0-20260820023541-8e8303b9da6c golang.org/x/sys v0.47.0 ) diff --git a/stbridge/go.sum b/stbridge/go.sum index 4a81628f..8254dc5d 100644 --- a/stbridge/go.sum +++ b/stbridge/go.sum @@ -224,11 +224,11 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= -golang.org/x/mobile v0.0.0-20260803200217-62cee1672c8e h1:hi1b7Lmv+xvnrjeEv8BoDmU7H/FAOuH7hEHSvjMl2VM= -golang.org/x/mobile v0.0.0-20260803200217-62cee1672c8e/go.mod h1:YX+n47s+53POxN3dx9cIGxG3hGUm/lD64hvrRJFbcSA= +golang.org/x/mobile v0.0.0-20260820023541-8e8303b9da6c h1:7EniRn2M+iJ4/2OQ/WpcHY8t5Ntv4aa1qzjh0h9FZ5A= +golang.org/x/mobile v0.0.0-20260820023541-8e8303b9da6c/go.mod h1:jMwjxoDSx9jqhNaZqPnr6nnKzb7cs+Dy1Czk7wdX+R8= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= -golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= +golang.org/x/mod v0.39.0 h1:UF5zwQdCRRUpHfyPwr7d4UrGiVeldIsogtzWVnczL74= +golang.org/x/mod v0.39.0/go.mod h1:bvIbwjQ0HUFFf5AKukeeYQG4ZBUG9yxQbR9aEweIwYY= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -280,8 +280,8 @@ golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE= -golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= +golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= +golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=