Last active
September 24, 2023 16:46
-
-
Save zats/1f460a4f4709671a98ebdcb24d7f312d to your computer and use it in GitHub Desktop.
Set voice over enabled with private API - not for AppStore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void _setVoiceOver(BOOL enabled) { | |
NSString* const accessibilityUtilitiesPath = [[NSBundle bundleForClass:UIApplication.class] | |
.bundleURL | |
.URLByDeletingLastPathComponent | |
.URLByDeletingLastPathComponent | |
URLByAppendingPathComponent:@"PrivateFrameworks/AccessibilityUtilities.framework/AccessibilityUtilities"] | |
.relativePath; | |
void* handler = dlopen([accessibilityUtilitiesPath cStringUsingEncoding:NSUTF8StringEncoding], RTLD_NOW); | |
if (!handler) { | |
return; | |
} | |
void (*_AXSVoiceOverTouchSetEnabled)(BOOL) = dlsym(handler, "_AXSVoiceOverTouchSetEnabled"); | |
_AXSVoiceOverTouchSetEnabled(enabled); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment