Daily iOS
Build and distribution

Dynamic code patching

A shipped app has a critical bug and you can't wait for App Store review. Why did Apple ban dynamic code patching like the JSPatch that Chinese apps used to run, and how did they detect it?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

JSPatch ran JavaScript fetched from a server through JavaScriptCore and swapped existing methods with the Objective-C runtime (method swizzling and dynamic method addition). Apple banned it under review guideline 2.5.2 (no changing app behavior with downloaded code) and caught it with static analysis of uploaded binaries, looking for JSPatch symbols and the JSContext plus runtime API combination, then sent warning emails.

Share a question