Skip to content

Instantly share code, notes, and snippets.

@olxios
Last active October 14, 2020 05:10
Show Gist options
  • Save olxios/9a1f96929228958e4a7efc5c47e3146f to your computer and use it in GitHub Desktop.
Save olxios/9a1f96929228958e4a7efc5c47e3146f to your computer and use it in GitHub Desktop.
/* You can find private iOS frameworks bundled with Xcode: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/PrivateFrameworks/
In Xcode 7.3 beta private frameworks have been removed from the Xcode bundle. As a workaround you'd have to load the framework at runtime
Please find the generated RadiosPreferences header here: https://raw.githubusercontent.com/nst/iOS-Runtime-Headers/master/PrivateFrameworks/AppSupport.framework/RadiosPreferences.h
*/
#import <AppSupport/RadiosPreferences.h>
@implementation AirplaneModeUtil
+ (void)toggleAirplaneMode
{
RadiosPreferences *preferences = [[RadiosPreferences alloc] init];
[preferences setAirplaneMode:!preferences.airplaneMode];
[preferences synchronize];
}
@end
@AnthoPakPak
Copy link

Worked for me! iOS 11, injected into SpringBoard. Thanks! 👌

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