Post

Replies

Boosts

Views

Activity

Reply to What triggers Game Mode?
I set GCSupportsGameMode to true in MyApp's Info.plist, then GameMode is triggered. After you set this value, Game Mode will not be triggered every time you launch the game. Instead, you must wait at least five minutes after the last time the App was closed before launching it again for Game Mode to be triggered.
Nov ’24
Reply to [UIDictationConnection cancelSpeech] Keyboard Dictation Error
Reason: This crash was caused by multiple threads accessing the lastHypothesis function of the UIDictationController, causing a wild pointer problem Solution: Lock the setLastHypothesis and lastHypothesis functions of UIDictationController, // hd_hookMethod is hook components similar to aspect [NSClassFromString(@"UIDictationController") hd_hookMethod:NSSelectorFromString(@"setLastHypothesis:") option:HDHookOptionInstead handle:^(HDInvocation *invocation){ [[invocation.target hdcore_lock] lock]; [invocation invoke]; [[invocation.target hdcore_lock] unlock]; } error:nil]; [NSClassFromString(@"UIDictationController") hd_hookMethod:NSSelectorFromString(@"lastHypothesis") option:HDHookOptionInstead handle:^NSString * (HDInvocation *invocation){ [[invocation.target hdcore_lock] lock]; __autoreleasing NSString *orgHypothesis; [invocation invokeWithReturnValue:&orgHypothesis]; orgHypothesis = orgHypothesis.mutableCopy; [[invocation.target hdcore_lock] unlock]; return orgHypothesis; } error:nil]; The solution comes from the HuolalaTech team, I just translated it into English Reference material: https://juejin.cn/post/7396463744186515465
Aug ’24
Reply to iOS 16.x - Keyboard and speech crash
Reason: This crash was caused by multiple threads accessing the lastHypothesis function of the UIDictationController, causing a wild pointer problem Solution: Lock the setLastHypothesis and lastHypothesis functions of UIDictationController, // hd_hookMethod is hook components similar to aspect [NSClassFromString(@"UIDictationController") hd_hookMethod:NSSelectorFromString(@"setLastHypothesis:") option:HDHookOptionInstead handle:^(HDInvocation *invocation){ [[invocation.target hdcore_lock] lock]; [invocation invoke]; [[invocation.target hdcore_lock] unlock]; } error:nil]; [NSClassFromString(@"UIDictationController") hd_hookMethod:NSSelectorFromString(@"lastHypothesis") option:HDHookOptionInstead handle:^NSString * (HDInvocation *invocation){ [[invocation.target hdcore_lock] lock]; __autoreleasing NSString *orgHypothesis; [invocation invokeWithReturnValue:&orgHypothesis]; orgHypothesis = orgHypothesis.mutableCopy; [[invocation.target hdcore_lock] unlock]; return orgHypothesis; } error:nil]; The solution comes from the HuolalaTech team, I just translated it into English Reference material: https://juejin.cn/post/7396463744186515465
Aug ’24