Skip to content

build: avoid VSSubscription type unavailable on Mac Catalyst in newer SDKs - #244

Open
jokerlin wants to merge 1 commit into
PlayCover:masterfrom
jokerlin:fix/vssubscription-catalyst-signature
Open

jokerlin wants to merge 1 commit into
PlayCover:masterfrom
jokerlin:fix/vssubscription-catalyst-signature

Conversation

@jokerlin

Copy link
Copy Markdown

Problem

VSSubscription is unavailable on Mac Catalyst in the Xcode 27 SDK, so the hook_setCurrentSubscription: parameter type fails to build.

Fix

Type the argument as id. The hook ignores its argument, so runtime behaviour is unchanged.

Split out of #240.

… SDKs

The hook ignores its argument; typing it as id keeps runtime behaviour
identical and lets PlayTools build with Xcode 27.
@TheMoonThatRises

Copy link
Copy Markdown
Member

Should the swizzle hook be runtime restricted to versions below 18.0 since setCurrentSubscription is also deprecated?

@jokerlin

jokerlin commented Oct 21, 2026 •

Copy link
Copy Markdown
Author

I tested calling -[VSSubscriptionRegistrationCenter setCurrentSubscription:] at runtime under Mac Catalyst on macOS 27.0.1 (26A434) with Xcode 27.0 (27A266a, target arm64-apple-ios18.0-macabi). Even though the API is marked deprecated in iOS 18 headers, the class and selector still exist in VideoSubscriberAccount.framework at runtime, and invoking setCurrentSubscription: without the restricted entitlement throws an Objective-C NSException.

In a small test harness that wraps the call in @try / @catch to log the exception (Caught exception: below):

2026-10-21 22:30:19.236 test_vss[99470:13768961] Class: VSSubscriptionRegistrationCenter
2026-10-21 22:30:19.237 test_vss[99470:13768961] Center: <VSSubscriptionRegistrationCenter: 0x1009068e0>
2026-10-21 22:30:19.237 test_vss[99470:13768961] IMP: 0x1db8c031c
2026-10-21 22:30:19.237 test_vss[99470:13768961] Caught exception: The -[VSSubscriptionRegistrationCenter setCurrentSubscription:] method requires an entitlement.

In a real app where callers don't wrap setCurrentSubscription: in @try / @catch, that exception goes uncaught and crashes the process. Since PlayCover runs pre-compiled iOS IPAs (which may still call setCurrentSubscription: regardless of the host macOS/Catalyst version) with entitlements stripped/re-signed, restricting the swizzle to < 18.0 would cause those apps to crash on macOS 27.0.1. So keeping the no-op swizzle unconditional on all OS versions seems safer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants