Last active
January 13, 2023 12:59
-
-
Save olxios/a52aabece2432bad77520d8b7beeacaf to your computer and use it in GitHub Desktop.
[Private iOS API] Toggle cellular data: http://swiftiostutorials.com/jailbreak-development-toggle-mobile-data-programmatically/
This file contains 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
/* 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 | |
You can find the reversed CoreTelephony header here: https://raw.githubusercontent.com/Cykey/ios-reversed-headers/master/CoreTelephony/CTCellularDataPlan.h | |
*/ | |
#import <CoreTelephony/CTCellularDataPlan.h> | |
@implementation Cellular | |
+ (void)toggleMobileData:(BOOL)cellularEnabled | |
{ | |
CTCellularDataPlanSetIsEnabled(cellularEnabled); | |
} | |
/* | |
Entitlements: | |
CTCellularDataPlanSetIsEnabled needs com.apple.CommCenter.fine-grained entitlement starting with iOS 8.3. | |
*/ | |
@end |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>com.apple.CommCenter.fine-grained</key> | |
<array> | |
<string>spi</string> | |
</array> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment