mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-12 16:08:59 +02:00
fix(ios-qa): compile the private-API touch bridge out of Release builds
PR #2264 claimed DebugBridgeTouch.m (KIF-derived in-process touch synthesis using private UIKit/IOKit symbols: _touchesEvent, IOHIDEventCreateDigitizer*, _AXSSetAutomationEnabled) was "compiled out in Release," but the body was gated only by TARGET_OS_IOS, so a Release iOS build carried the private symbols (App Store rejection risk). The safety half of the fix (closed PR #2269) never landed. Gate the body on `#if TARGET_OS_IOS && DEBUG` and add the cSettings DEBUG define to the DebugBridgeTouch target so `#if DEBUG` is true in debug and false in release (mirrors the Core/UI swiftSettings). A free static tripwire pins both halves; the nm/strings symbol proof needs an iOS-SDK build and belongs in the device/periodic tier. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
3c93aef0ff
commit
33a55562f7
@@ -20,7 +20,12 @@
|
||||
#import "DebugBridgeTouch.h"
|
||||
#import <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
// DEBUG gate in addition to TARGET_OS_IOS: the private-API touch synthesis must
|
||||
// compile out of Release builds entirely (App Store rejection risk + no
|
||||
// automation code in shipped binaries). DEBUG is defined for this target only
|
||||
// in the debug configuration (see cSettings in Package.swift), so a Release iOS
|
||||
// build emits an empty translation unit — zero private symbols.
|
||||
#if TARGET_OS_IOS && DEBUG
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <objc/runtime.h>
|
||||
|
||||
@@ -43,6 +43,13 @@ let package = Package(
|
||||
dependencies: [],
|
||||
path: "Sources/DebugBridgeTouch",
|
||||
publicHeadersPath: "include",
|
||||
cSettings: [
|
||||
// Defines DEBUG for the ObjC translation unit in debug config
|
||||
// only, so DebugBridgeTouch.m's `#if TARGET_OS_IOS && DEBUG`
|
||||
// body compiles out of Release builds. Mirrors the swiftSettings
|
||||
// DEBUG define on the Core/UI targets.
|
||||
.define("DEBUG", .when(configuration: .debug)),
|
||||
],
|
||||
linkerSettings: [
|
||||
// IOKit is loaded dynamically via dlopen at runtime (it's a
|
||||
// private framework on iOS and can't be linked statically).
|
||||
|
||||
Reference in New Issue
Block a user