From da7982e1052e2c48247fab118c3d152974ecb3d0 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:11:32 +0800 Subject: [PATCH] fix(cli): preserve ADB extra schema in the product catalog (#12060) --- src/domain/adb/adbDeviceAnalysis.ts | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/domain/adb/adbDeviceAnalysis.ts b/src/domain/adb/adbDeviceAnalysis.ts index 71088f50b0..4d61ef2219 100644 --- a/src/domain/adb/adbDeviceAnalysis.ts +++ b/src/domain/adb/adbDeviceAnalysis.ts @@ -178,23 +178,17 @@ export const activityExtraCliEntrySchema = z activityExtraCliPattern("float", patternBody(javaFloatValuePattern)), ), ]) - .transform((entry, context) => { - const typeEnd = entry.indexOf(":"); - const keyEnd = entry.indexOf(":", typeEnd + 1); - const parsed = activityExtraSchema.safeParse({ - type: entry.slice(0, typeEnd), - key: entry.slice(typeEnd + 1, keyEnd), - value: entry.slice(keyEnd + 1), - }); - if (parsed.success) return parsed.data; - context.addIssue({ - code: "custom", - message: - parsed.error.issues[0]?.message ?? - "Extra does not match the activity extra contract", - }); - return z.NEVER; - }); + .pipe( + z.preprocess((entry: string) => { + const typeEnd = entry.indexOf(":"); + const keyEnd = entry.indexOf(":", typeEnd + 1); + return { + type: entry.slice(0, typeEnd), + key: entry.slice(typeEnd + 1, keyEnd), + value: entry.slice(keyEnd + 1), + }; + }, activityExtraSchema), + ); /** * Caller intent for ADB-backed device inspection and acquisition.