From 54bcc5be6d78ce52558e0d23a3b2b33f633483ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 13 Sep 2026 00:01:37 +0000 Subject: [PATCH] Handle synthetic Android plugin marker jars Co-authored-by: XRDOGE-XRPL <166251416+XRDOGE-XRPL@users.noreply.github.com> --- tools/google_maven_proxy.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/google_maven_proxy.py b/tools/google_maven_proxy.py index 0629ce0..af4a153 100644 --- a/tools/google_maven_proxy.py +++ b/tools/google_maven_proxy.py @@ -430,6 +430,9 @@ def _download_from_google_maven(self, request_path: str, artifact_path: Path) -> class MirrorHandler(BaseHTTPRequestHandler): mirror_index: MavenMirrorIndex + EMPTY_JAR_BYTES = ( + b"PK\x05\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" + ) def do_GET(self) -> None: # noqa: N802 self._serve(send_body=True) @@ -499,8 +502,11 @@ def _send_bytes( @staticmethod def _synthetic_response(request_path: str) -> tuple[str, bytes] | None: marker_prefix = "com/android/application/com.android.application.gradle.plugin/" - if request_path.startswith(marker_prefix) and request_path.endswith(".pom"): - version = request_path.removeprefix(marker_prefix).split("/", 1)[0] + if not request_path.startswith(marker_prefix): + return None + + version = request_path.removeprefix(marker_prefix).split("/", 1)[0] + if request_path.endswith(".pom"): pom = f""" @@ -520,6 +526,9 @@ def _synthetic_response(request_path: str) -> tuple[str, bytes] | None: """.encode("utf-8") return "application/xml; charset=utf-8", pom + if request_path.endswith(".jar"): + return "application/java-archive", MirrorHandler.EMPTY_JAR_BYTES + return None