Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jgit = "7.7.1.202607240634-r"
junit = "1.3.0"
kotlin = "2.4.10"
material = "1.14.0"
spotbugs = "4.10.3"
spotbugs = "4.10.4"
tink-android = "1.23.0"

[libraries]
Expand Down
91 changes: 67 additions & 24 deletions gradle/update_verification.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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('<configuration> tag not found')

trusted_artifacts = ET.SubElement(
configuration, f'{{{ns}}}trusted-artifacts')

Expand All @@ -32,40 +36,79 @@ 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('<components> tag not found')

component = components.find(f'{{{ns}}}component[@name="{name}"]')
if component is None:
raise ValueError(f'<component name="{name}"> 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={
'value': digest.hexdigest(),
'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()

Expand All @@ -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.
Expand Down
18 changes: 5 additions & 13 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1771,12 +1771,12 @@
<sha512 value="41557b42be6842eb22407de2d3af716c45882d312cdc572053da2035c5b97ea91ad8ba9f72d4efacb70bd00645d6c5fc9e08894cc1911731352e79a4248d5681" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.github.spotbugs" name="spotbugs-annotations" version="4.10.3">
<artifact name="spotbugs-annotations-4.10.3.jar">
<sha512 value="bd2505c3e3675a50b64572b9acca1ed08bbc3e457206f794a3213eb74bb7f8ac7b9475e8583c3e7b72cd0e021e5e77b8d6ae049ba6f783aef507eb56f239259f" origin="Generated by Gradle"/>
<component group="com.github.spotbugs" name="spotbugs-annotations" version="4.10.4">
<artifact name="spotbugs-annotations-4.10.4.jar">
<sha512 value="360495652cc92447a1215a94a38c6070e4cfc4fb9b749a710f85341c823b1dfcb25ef1d536f38139071f38df81a7c4b584159d5625385df4f1c33fd5f03cda6a" origin="Generated by Gradle"/>
</artifact>
<artifact name="spotbugs-annotations-4.10.3.module">
<sha512 value="91096da585808ba3d8b1331d6893ed80cca652273998bee170c5e7ab6c82780c0ce8839393ce3be707be47b6f987ce71fcd00f33c64e60e88f14310b1453bf40" origin="Generated by Gradle"/>
<artifact name="spotbugs-annotations-4.10.4.module">
<sha512 value="0eb590875fd705443f39a965e3f52a519771f878f0a37cddd06b75f99124baceccb28047b01ebcf32c57649fa2631fd18d63d67a625ecf613a2c540fd65e0ac8" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="com.google.android" name="annotations" version="4.1.1.4">
Expand Down Expand Up @@ -3819,14 +3819,6 @@
<sha512 value="f7f727af2d3a0718f33f3e1a42eaeb645a1b7cb3401349111a6747aab3ef01b767b4d8cfc1b2c1449019207f2d63dc490a2e2632c60ca564ff85a81be00472f8" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="6.1.2">
<artifact name="junit-bom-6.1.2.module">
<sha512 value="96dd73138049f6e3d9d12f1b0003352bd9376d4b2b0d01985d3908e9b2778e258c0889d508a7ee7f1ba8405d610e011ab803b1899d00e316318948e2c9e2f2e5" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-6.1.2.pom">
<sha512 value="7c7c75f45ed08a7a6c9d4573d4e50657b2377e6127fbed89334cf83e522f8ef3a162f132ae192a840119b0ac3a2cac7608c5d6ea9d7506c6c5033c52148d3cc0" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.jvnet.staxex" name="stax-ex" version="1.8.1">
<artifact name="stax-ex-1.8.1.jar">
<sha512 value="d060ea5dcc81508a1078bd0ed947553a5652a5a78da76cd00dc2e384dca014166dfe92777fceb7d7868699894d7e40ecef99fac7771372025bfd7f1fa3e2fe32" origin="Generated by Gradle"/>
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=84fbba45c7f4c64abc77460e1c00f541e9f960e3c7ed2538f1ede19eacd873ae
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.0-bin.zip
distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
Expand Down
6 changes: 3 additions & 3 deletions rcbridge/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25.0

require (
github.com/rclone/rclone v1.75.0
golang.org/x/mobile v0.0.0-20260730202154-c700fe717e6e
golang.org/x/mobile v0.0.0-20260820023541-8e8303b9da6c
)

// https://github.com/chenxiaolong/RSAF/issues/268
Expand Down Expand Up @@ -206,13 +206,13 @@ require (
go.yaml.in/yaml/v2 v2.4.4 // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597 // indirect
golang.org/x/image v0.44.0 // indirect
golang.org/x/image v0.45.0 // indirect
golang.org/x/net v0.57.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0 // indirect
golang.org/x/text v0.40.0 // indirect
golang.org/x/text v0.41.0 // indirect
golang.org/x/time v0.15.0 // indirect
google.golang.org/api v0.279.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260715232425-e75dac1f907d // indirect
Expand Down
16 changes: 8 additions & 8 deletions rcbridge/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw=
golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk=
golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597 h1:qLvzZeaANDgyVOA8pyHCOStGlXn0rseXma+GQjeuv2g=
golang.org/x/exp v0.0.0-20260709172345-9ea1abe57597/go.mod h1:EdfpwwqSu+0Li0mzskwHU6FWDV3t9Q+RZDo3QMUtL3Q=
golang.org/x/image v0.44.0 h1:+tDekMZED9+LrtB3G5xzRggpVh9CARjZqROla3R3R+I=
golang.org/x/image v0.44.0/go.mod h1:V8K3KE9KKKE+pLpQDOeN18w9oacNSvy1tDOirTu4xtY=
golang.org/x/mobile v0.0.0-20260730202154-c700fe717e6e h1:v5PGTbI7uer7FhpDeGryGytfbI8t7CDWkKukozvIsNU=
golang.org/x/mobile v0.0.0-20260730202154-c700fe717e6e/go.mod h1:YX+n47s+53POxN3dx9cIGxG3hGUm/lD64hvrRJFbcSA=
golang.org/x/image v0.45.0 h1:FMb1nTbH5H9vF55SriQHgFw5GnNL9Jg6L25BwXKzhB0=
golang.org/x/image v0.45.0/go.mod h1:n62x/7RqlwXDvGsSU4u6IUTUf6KghUZ9Bt7cG/T9Fx4=
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.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
Expand Down Expand Up @@ -616,8 +616,8 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs=
golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY=
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=
golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U=
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=
Expand All @@ -627,8 +627,8 @@ golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
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=
Expand Down