Skip to content

feat: enable isiOSAppOnMac bypass controlled by PlaySettings#225

Open
XiaoChaoConcise wants to merge 1 commit into
PlayCover:masterfrom
XiaoChaoConcise:feat/enable-isiOSAppOnMac-bypass
Open

feat: enable isiOSAppOnMac bypass controlled by PlaySettings#225
XiaoChaoConcise wants to merge 1 commit into
PlayCover:masterfrom
XiaoChaoConcise:feat/enable-isiOSAppOnMac-bypass

Conversation

@XiaoChaoConcise

Copy link
Copy Markdown

Summary

This PR enables the isiOSAppOnMac bypass that was already written but commented out in PlayShadow.m. The bypass is gated behind the existing PlaySettings.bypass per-app plist setting, so it has zero impact on apps that do not have bypass enabled.

Problem

Some Unity-based iOS games (e.g., Teamfight Tactics / Golden Spatula / 金铲铲之战 S17) call [NSProcessInfo isiOSAppOnMac] to detect the runtime environment. When this returns true, Unity disables touch input simulation, breaking PlayCover's keymapping and mouse support. S16 worked fine, but S17 introduced this check.

The original PlayShadow.m code already had the fix written but commented out with the note "disabled as it might be too powerful". This PR re-enables it in a controlled way.

Changes (2 lines)

  1. Line 184: Uncomment bypass gating — [[PlaySettings shared] bypass] now controls whether loadEnvironmentBypass is called
  2. Line 340: Add isiOSAppOnMac → pm_return_false swizzle inside loadEnvironmentBypass

How it works

  • PlayCover app writes bypass: true to the per-app plist (App Settings/com.tencent.jkchess.plist)
  • PlayTools reads this via PlaySettings.shared.bypass
  • On app launch, PlayShadowLoader.load checks bypass → calls loadEnvironmentBypass
  • loadEnvironmentBypass now hooks isiOSAppOnMac to return NO
  • Game thinks it's on a real iPad, touch input works normally

Safety

  • ✅ Fully opt-in per app via existing bypass plist key (default false)
  • ✅ Zero behavioral change for apps with bypass disabled
  • ✅ Uses existing pm_return_false method that's already compiled in
  • ✅ The original code was just commented out, not removed — this restores the intended design

Verification

Tested on: 金铲铲之战 S17 (com.tencent.jkchess)

  • Without bypass: Little Legend cannot move on board
  • With bypass enabled in plist: Expected to restore touch input (requires rebuild with this PR)

🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

- Uncomment bypass-gated loadEnvironmentBypass in PlayShadow +load
- Add isiOSAppOnMac → pm_return_false swizzle in loadEnvironmentBypass
- When PlayCover's bypass setting is enabled for an app, isiOSAppOnMac
  will return NO, making Unity games (e.g. TFT/Golden Spatula S17)
  think they are running on a real iPad instead of macOS
- Fully opt-in per app via existing PlaySettings.bypass plist key
- Zero impact on apps with bypass disabled (default)
@TheMoonThatRises

Copy link
Copy Markdown
Member

@ohaiibuzzle thoughts?

@ohaiibuzzle

Copy link
Copy Markdown
Member

It should be a separate controllable key.

The issue is that iirc macOS itself uses some of these keys to determine the behavior of the target app, so setting can break things, hence me commenting it out.

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.

3 participants