From ad16d250e366ba7f13f80a56e75c6b8c3f2edaf1 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 14 Oct 2026 00:40:37 +0800 Subject: [PATCH] fix(android): make DEX descriptor pattern portable --- bridge/mitmproxy/capture.py | 2 +- src/domain/android/androidAnalysis.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bridge/mitmproxy/capture.py b/bridge/mitmproxy/capture.py index b1e05e9f5..ce60593bf 100644 --- a/bridge/mitmproxy/capture.py +++ b/bridge/mitmproxy/capture.py @@ -106,7 +106,7 @@ def without_userinfo(value, base_scheme=None): while end < len(parsed_text) and parsed_text[end] not in terminators: end += 1 at = parsed_text.rfind("@", start, end) - if at < 0: + if at <= start: return value parsed_offset = 0 raw_start = 0 diff --git a/src/domain/android/androidAnalysis.ts b/src/domain/android/androidAnalysis.ts index ca4d6db59..f0f65b37f 100644 --- a/src/domain/android/androidAnalysis.ts +++ b/src/domain/android/androidAnalysis.ts @@ -90,6 +90,13 @@ const textCoverage = z.strictObject({ text: z.string(), reported_total_bytes: z.number().int().nonnegative().nullable(), }); +/** A DEX prototype: parameter descriptors followed by the return descriptor. */ +export const dexDescriptorSchema = z + .string() + .regex( + /^\((?:\[*(?:[ZBSCIJFD]|L[^;\x28\x29]+;))*\)(?:V|\[*(?:[ZBSCIJFD]|L[^;\x28\x29]+;))$/u, + ); + const method = z.strictObject({ name: z.string(), reported_signature: z.string(),