├── .gitignore ├── MobileDataSwitch.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── MobileDataSwitch ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── GLViewController.h ├── GLViewController.m ├── Images.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ ├── Icon-Spotlight-40@2x.png │ │ └── Icon-Spotlight-40@3x.png ├── Info.plist └── main.m ├── MobileDataSwitchTests ├── Info.plist └── MobileDataSwitchTests.m ├── MobileSwitch ├── GLBluetoothController.h ├── GLBluetoothController.m ├── Info.plist ├── MainInterface.storyboard ├── MoblieSwitch.xcassets │ ├── bluetooth.imageset │ │ ├── Contents.json │ │ └── bluetooth@2x.png │ ├── location.imageset │ │ ├── Contents.json │ │ └── location@2x.png │ ├── private.imageset │ │ ├── Contents.json │ │ └── private@2x.png │ ├── remind.imageset │ │ ├── Contents.json │ │ └── remind@2x.png │ ├── shareNetwork.imageset │ │ ├── Contents.json │ │ └── shareNetwork.png │ └── wifi.imageset │ │ ├── Contents.json │ │ └── wifi@2x.png ├── TodayViewController.h └── TodayViewController.m ├── MobileWiFi.framework ├── Headers │ ├── MobileWiFi.h │ ├── WiFiDeviceClient.h │ ├── WiFiManager.h │ └── WiFiNetwork.h ├── MobileWiFi └── _CodeSignature │ └── CodeResources └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | # Pods/ 27 | -------------------------------------------------------------------------------- /MobileDataSwitch.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3E1F0CD019E5119E0034C490 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E1F0CCF19E5119E0034C490 /* CoreTelephony.framework */; }; 11 | 3E9D074519E50FE1008C21CA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E9D074419E50FE1008C21CA /* main.m */; }; 12 | 3E9D074819E50FE1008C21CA /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E9D074719E50FE1008C21CA /* AppDelegate.m */; }; 13 | 3E9D074B19E50FE1008C21CA /* GLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E9D074A19E50FE1008C21CA /* GLViewController.m */; }; 14 | 3E9D074E19E50FE1008C21CA /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E9D074C19E50FE1008C21CA /* Main.storyboard */; }; 15 | 3E9D075019E50FE1008C21CA /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3E9D074F19E50FE1008C21CA /* Images.xcassets */; }; 16 | 3E9D075319E50FE1008C21CA /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3E9D075119E50FE1008C21CA /* LaunchScreen.xib */; }; 17 | 3EF4522E1A08B24E00C822F3 /* MoblieSwitch.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3EF4522D1A08B24E00C822F3 /* MoblieSwitch.xcassets */; }; 18 | 3EFD83481A03825D0030FC5A /* NotificationCenter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3EFD83471A03825D0030FC5A /* NotificationCenter.framework */; }; 19 | 3EFD834E1A03825D0030FC5A /* TodayViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EFD834D1A03825D0030FC5A /* TodayViewController.m */; }; 20 | 3EFD83501A03825D0030FC5A /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3EFD834F1A03825D0030FC5A /* MainInterface.storyboard */; }; 21 | 3EFD83531A03825D0030FC5A /* MobileSwitch.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 3EFD83451A03825D0030FC5A /* MobileSwitch.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 22 | 3EFD835B1A038C4E0030FC5A /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E1F0CCF19E5119E0034C490 /* CoreTelephony.framework */; }; 23 | 488AFFEF1ACD41C5008E1ED1 /* GLBluetoothController.m in Sources */ = {isa = PBXBuildFile; fileRef = 488AFFEE1ACD41C5008E1ED1 /* GLBluetoothController.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 3EFD83511A03825D0030FC5A /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 3E9D073719E50FE1008C21CA /* Project object */; 30 | proxyType = 1; 31 | remoteGlobalIDString = 3EFD83441A03825D0030FC5A; 32 | remoteInfo = MobileSwitch; 33 | }; 34 | /* End PBXContainerItemProxy section */ 35 | 36 | /* Begin PBXCopyFilesBuildPhase section */ 37 | 3EFD83571A03825D0030FC5A /* Embed App Extensions */ = { 38 | isa = PBXCopyFilesBuildPhase; 39 | buildActionMask = 2147483647; 40 | dstPath = ""; 41 | dstSubfolderSpec = 13; 42 | files = ( 43 | 3EFD83531A03825D0030FC5A /* MobileSwitch.appex in Embed App Extensions */, 44 | ); 45 | name = "Embed App Extensions"; 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXCopyFilesBuildPhase section */ 49 | 50 | /* Begin PBXFileReference section */ 51 | 3E1F0CCF19E5119E0034C490 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; }; 52 | 3E9D073F19E50FE1008C21CA /* MobileDataSwitch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MobileDataSwitch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 3E9D074319E50FE1008C21CA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 54 | 3E9D074419E50FE1008C21CA /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 55 | 3E9D074619E50FE1008C21CA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 56 | 3E9D074719E50FE1008C21CA /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 57 | 3E9D074919E50FE1008C21CA /* GLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GLViewController.h; sourceTree = ""; }; 58 | 3E9D074A19E50FE1008C21CA /* GLViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GLViewController.m; sourceTree = ""; }; 59 | 3E9D074D19E50FE1008C21CA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 60 | 3E9D074F19E50FE1008C21CA /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 61 | 3E9D075219E50FE1008C21CA /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 62 | 3E9D075D19E50FE1008C21CA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 63 | 3E9D075E19E50FE1008C21CA /* MobileDataSwitchTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MobileDataSwitchTests.m; sourceTree = ""; }; 64 | 3EF4522D1A08B24E00C822F3 /* MoblieSwitch.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = MoblieSwitch.xcassets; sourceTree = ""; }; 65 | 3EFD83451A03825D0030FC5A /* MobileSwitch.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MobileSwitch.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 3EFD83471A03825D0030FC5A /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; 67 | 3EFD834B1A03825D0030FC5A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 68 | 3EFD834C1A03825D0030FC5A /* TodayViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TodayViewController.h; sourceTree = ""; }; 69 | 3EFD834D1A03825D0030FC5A /* TodayViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TodayViewController.m; sourceTree = ""; }; 70 | 3EFD834F1A03825D0030FC5A /* MainInterface.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = MainInterface.storyboard; sourceTree = ""; }; 71 | 488AFFED1ACD41C5008E1ED1 /* GLBluetoothController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLBluetoothController.h; sourceTree = ""; }; 72 | 488AFFEE1ACD41C5008E1ED1 /* GLBluetoothController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GLBluetoothController.m; sourceTree = ""; }; 73 | /* End PBXFileReference section */ 74 | 75 | /* Begin PBXFrameworksBuildPhase section */ 76 | 3E9D073C19E50FE1008C21CA /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | 3E1F0CD019E5119E0034C490 /* CoreTelephony.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 3EFD83421A03825D0030FC5A /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 3EFD835B1A038C4E0030FC5A /* CoreTelephony.framework in Frameworks */, 89 | 3EFD83481A03825D0030FC5A /* NotificationCenter.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | /* End PBXFrameworksBuildPhase section */ 94 | 95 | /* Begin PBXGroup section */ 96 | 3E9D073619E50FE1008C21CA = { 97 | isa = PBXGroup; 98 | children = ( 99 | 3E1F0CCF19E5119E0034C490 /* CoreTelephony.framework */, 100 | 3E9D074119E50FE1008C21CA /* MobileDataSwitch */, 101 | 3E9D075B19E50FE1008C21CA /* MobileDataSwitchTests */, 102 | 3EFD83491A03825D0030FC5A /* MobileSwitch */, 103 | 3EFD83461A03825D0030FC5A /* Frameworks */, 104 | 3E9D074019E50FE1008C21CA /* Products */, 105 | ); 106 | sourceTree = ""; 107 | }; 108 | 3E9D074019E50FE1008C21CA /* Products */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 3E9D073F19E50FE1008C21CA /* MobileDataSwitch.app */, 112 | 3EFD83451A03825D0030FC5A /* MobileSwitch.appex */, 113 | ); 114 | name = Products; 115 | sourceTree = ""; 116 | }; 117 | 3E9D074119E50FE1008C21CA /* MobileDataSwitch */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 3E9D074619E50FE1008C21CA /* AppDelegate.h */, 121 | 3E9D074719E50FE1008C21CA /* AppDelegate.m */, 122 | 3E9D074919E50FE1008C21CA /* GLViewController.h */, 123 | 3E9D074A19E50FE1008C21CA /* GLViewController.m */, 124 | 3E9D074C19E50FE1008C21CA /* Main.storyboard */, 125 | 3E9D074F19E50FE1008C21CA /* Images.xcassets */, 126 | 3E9D075119E50FE1008C21CA /* LaunchScreen.xib */, 127 | 3E9D074219E50FE1008C21CA /* Supporting Files */, 128 | ); 129 | path = MobileDataSwitch; 130 | sourceTree = ""; 131 | }; 132 | 3E9D074219E50FE1008C21CA /* Supporting Files */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 3E9D074319E50FE1008C21CA /* Info.plist */, 136 | 3E9D074419E50FE1008C21CA /* main.m */, 137 | ); 138 | name = "Supporting Files"; 139 | sourceTree = ""; 140 | }; 141 | 3E9D075B19E50FE1008C21CA /* MobileDataSwitchTests */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | 3E9D075E19E50FE1008C21CA /* MobileDataSwitchTests.m */, 145 | 3E9D075C19E50FE1008C21CA /* Supporting Files */, 146 | ); 147 | path = MobileDataSwitchTests; 148 | sourceTree = ""; 149 | }; 150 | 3E9D075C19E50FE1008C21CA /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 3E9D075D19E50FE1008C21CA /* Info.plist */, 154 | ); 155 | name = "Supporting Files"; 156 | sourceTree = ""; 157 | }; 158 | 3EFD83461A03825D0030FC5A /* Frameworks */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 3EFD83471A03825D0030FC5A /* NotificationCenter.framework */, 162 | ); 163 | name = Frameworks; 164 | sourceTree = ""; 165 | }; 166 | 3EFD83491A03825D0030FC5A /* MobileSwitch */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 3EFD834C1A03825D0030FC5A /* TodayViewController.h */, 170 | 3EFD834D1A03825D0030FC5A /* TodayViewController.m */, 171 | 488AFFED1ACD41C5008E1ED1 /* GLBluetoothController.h */, 172 | 488AFFEE1ACD41C5008E1ED1 /* GLBluetoothController.m */, 173 | 3EF4522D1A08B24E00C822F3 /* MoblieSwitch.xcassets */, 174 | 3EFD834F1A03825D0030FC5A /* MainInterface.storyboard */, 175 | 3EFD834A1A03825D0030FC5A /* Supporting Files */, 176 | ); 177 | path = MobileSwitch; 178 | sourceTree = ""; 179 | }; 180 | 3EFD834A1A03825D0030FC5A /* Supporting Files */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 3EFD834B1A03825D0030FC5A /* Info.plist */, 184 | ); 185 | name = "Supporting Files"; 186 | sourceTree = ""; 187 | }; 188 | /* End PBXGroup section */ 189 | 190 | /* Begin PBXNativeTarget section */ 191 | 3E9D073E19E50FE1008C21CA /* MobileDataSwitch */ = { 192 | isa = PBXNativeTarget; 193 | buildConfigurationList = 3E9D076219E50FE1008C21CA /* Build configuration list for PBXNativeTarget "MobileDataSwitch" */; 194 | buildPhases = ( 195 | 3E9D073B19E50FE1008C21CA /* Sources */, 196 | 3E9D073C19E50FE1008C21CA /* Frameworks */, 197 | 3E9D073D19E50FE1008C21CA /* Resources */, 198 | 3EFD83571A03825D0030FC5A /* Embed App Extensions */, 199 | ); 200 | buildRules = ( 201 | ); 202 | dependencies = ( 203 | 3EFD83521A03825D0030FC5A /* PBXTargetDependency */, 204 | ); 205 | name = MobileDataSwitch; 206 | productName = MobileDataSwitch; 207 | productReference = 3E9D073F19E50FE1008C21CA /* MobileDataSwitch.app */; 208 | productType = "com.apple.product-type.application"; 209 | }; 210 | 3EFD83441A03825D0030FC5A /* MobileSwitch */ = { 211 | isa = PBXNativeTarget; 212 | buildConfigurationList = 3EFD83561A03825D0030FC5A /* Build configuration list for PBXNativeTarget "MobileSwitch" */; 213 | buildPhases = ( 214 | 3EFD83411A03825D0030FC5A /* Sources */, 215 | 3EFD83421A03825D0030FC5A /* Frameworks */, 216 | 3EFD83431A03825D0030FC5A /* Resources */, 217 | ); 218 | buildRules = ( 219 | ); 220 | dependencies = ( 221 | ); 222 | name = MobileSwitch; 223 | productName = MobileSwitch; 224 | productReference = 3EFD83451A03825D0030FC5A /* MobileSwitch.appex */; 225 | productType = "com.apple.product-type.app-extension"; 226 | }; 227 | /* End PBXNativeTarget section */ 228 | 229 | /* Begin PBXProject section */ 230 | 3E9D073719E50FE1008C21CA /* Project object */ = { 231 | isa = PBXProject; 232 | attributes = { 233 | LastUpgradeCheck = 0600; 234 | ORGANIZATIONNAME = GL; 235 | TargetAttributes = { 236 | 3E9D073E19E50FE1008C21CA = { 237 | CreatedOnToolsVersion = 6.0.1; 238 | SystemCapabilities = { 239 | com.apple.ApplicationGroups.iOS = { 240 | enabled = 0; 241 | }; 242 | }; 243 | }; 244 | 3EFD83441A03825D0030FC5A = { 245 | CreatedOnToolsVersion = 6.1; 246 | SystemCapabilities = { 247 | com.apple.ApplicationGroups.iOS = { 248 | enabled = 0; 249 | }; 250 | }; 251 | }; 252 | }; 253 | }; 254 | buildConfigurationList = 3E9D073A19E50FE1008C21CA /* Build configuration list for PBXProject "MobileDataSwitch" */; 255 | compatibilityVersion = "Xcode 3.2"; 256 | developmentRegion = English; 257 | hasScannedForEncodings = 0; 258 | knownRegions = ( 259 | en, 260 | Base, 261 | ); 262 | mainGroup = 3E9D073619E50FE1008C21CA; 263 | productRefGroup = 3E9D074019E50FE1008C21CA /* Products */; 264 | projectDirPath = ""; 265 | projectRoot = ""; 266 | targets = ( 267 | 3E9D073E19E50FE1008C21CA /* MobileDataSwitch */, 268 | 3EFD83441A03825D0030FC5A /* MobileSwitch */, 269 | ); 270 | }; 271 | /* End PBXProject section */ 272 | 273 | /* Begin PBXResourcesBuildPhase section */ 274 | 3E9D073D19E50FE1008C21CA /* Resources */ = { 275 | isa = PBXResourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 3E9D074E19E50FE1008C21CA /* Main.storyboard in Resources */, 279 | 3E9D075319E50FE1008C21CA /* LaunchScreen.xib in Resources */, 280 | 3E9D075019E50FE1008C21CA /* Images.xcassets in Resources */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | 3EFD83431A03825D0030FC5A /* Resources */ = { 285 | isa = PBXResourcesBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 3EFD83501A03825D0030FC5A /* MainInterface.storyboard in Resources */, 289 | 3EF4522E1A08B24E00C822F3 /* MoblieSwitch.xcassets in Resources */, 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXResourcesBuildPhase section */ 294 | 295 | /* Begin PBXSourcesBuildPhase section */ 296 | 3E9D073B19E50FE1008C21CA /* Sources */ = { 297 | isa = PBXSourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | 3E9D074B19E50FE1008C21CA /* GLViewController.m in Sources */, 301 | 3E9D074819E50FE1008C21CA /* AppDelegate.m in Sources */, 302 | 3E9D074519E50FE1008C21CA /* main.m in Sources */, 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | }; 306 | 3EFD83411A03825D0030FC5A /* Sources */ = { 307 | isa = PBXSourcesBuildPhase; 308 | buildActionMask = 2147483647; 309 | files = ( 310 | 488AFFEF1ACD41C5008E1ED1 /* GLBluetoothController.m in Sources */, 311 | 3EFD834E1A03825D0030FC5A /* TodayViewController.m in Sources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | /* End PBXSourcesBuildPhase section */ 316 | 317 | /* Begin PBXTargetDependency section */ 318 | 3EFD83521A03825D0030FC5A /* PBXTargetDependency */ = { 319 | isa = PBXTargetDependency; 320 | target = 3EFD83441A03825D0030FC5A /* MobileSwitch */; 321 | targetProxy = 3EFD83511A03825D0030FC5A /* PBXContainerItemProxy */; 322 | }; 323 | /* End PBXTargetDependency section */ 324 | 325 | /* Begin PBXVariantGroup section */ 326 | 3E9D074C19E50FE1008C21CA /* Main.storyboard */ = { 327 | isa = PBXVariantGroup; 328 | children = ( 329 | 3E9D074D19E50FE1008C21CA /* Base */, 330 | ); 331 | name = Main.storyboard; 332 | sourceTree = ""; 333 | }; 334 | 3E9D075119E50FE1008C21CA /* LaunchScreen.xib */ = { 335 | isa = PBXVariantGroup; 336 | children = ( 337 | 3E9D075219E50FE1008C21CA /* Base */, 338 | ); 339 | name = LaunchScreen.xib; 340 | sourceTree = ""; 341 | }; 342 | /* End PBXVariantGroup section */ 343 | 344 | /* Begin XCBuildConfiguration section */ 345 | 3E9D076019E50FE1008C21CA /* Debug */ = { 346 | isa = XCBuildConfiguration; 347 | buildSettings = { 348 | ALWAYS_SEARCH_USER_PATHS = NO; 349 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 350 | CLANG_CXX_LIBRARY = "libc++"; 351 | CLANG_ENABLE_MODULES = YES; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_BOOL_CONVERSION = YES; 354 | CLANG_WARN_CONSTANT_CONVERSION = YES; 355 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 356 | CLANG_WARN_EMPTY_BODY = YES; 357 | CLANG_WARN_ENUM_CONVERSION = YES; 358 | CLANG_WARN_INT_CONVERSION = YES; 359 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 360 | CLANG_WARN_UNREACHABLE_CODE = YES; 361 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 362 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 363 | COPY_PHASE_STRIP = NO; 364 | ENABLE_STRICT_OBJC_MSGSEND = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_DYNAMIC_NO_PIC = NO; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | PROVISIONING_PROFILE = "c7580fef-8a91-4f86-9d69-53f325604f92"; 383 | SDKROOT = iphoneos; 384 | }; 385 | name = Debug; 386 | }; 387 | 3E9D076119E50FE1008C21CA /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 392 | CLANG_CXX_LIBRARY = "libc++"; 393 | CLANG_ENABLE_MODULES = YES; 394 | CLANG_ENABLE_OBJC_ARC = YES; 395 | CLANG_WARN_BOOL_CONVERSION = YES; 396 | CLANG_WARN_CONSTANT_CONVERSION = YES; 397 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 398 | CLANG_WARN_EMPTY_BODY = YES; 399 | CLANG_WARN_ENUM_CONVERSION = YES; 400 | CLANG_WARN_INT_CONVERSION = YES; 401 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 405 | COPY_PHASE_STRIP = YES; 406 | ENABLE_NS_ASSERTIONS = NO; 407 | ENABLE_STRICT_OBJC_MSGSEND = YES; 408 | GCC_C_LANGUAGE_STANDARD = gnu99; 409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 411 | GCC_WARN_UNDECLARED_SELECTOR = YES; 412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 413 | GCC_WARN_UNUSED_FUNCTION = YES; 414 | GCC_WARN_UNUSED_VARIABLE = YES; 415 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 416 | MTL_ENABLE_DEBUG_INFO = NO; 417 | PROVISIONING_PROFILE = "c7580fef-8a91-4f86-9d69-53f325604f92"; 418 | SDKROOT = iphoneos; 419 | VALIDATE_PRODUCT = YES; 420 | }; 421 | name = Release; 422 | }; 423 | 3E9D076319E50FE1008C21CA /* Debug */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 427 | CODE_SIGN_IDENTITY = ""; 428 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 429 | FRAMEWORK_SEARCH_PATHS = ( 430 | "$(inherited)", 431 | "$(PROJECT_DIR)", 432 | ); 433 | INFOPLIST_FILE = MobileDataSwitch/Info.plist; 434 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | PROVISIONING_PROFILE = "c7580fef-8a91-4f86-9d69-53f325604f92"; 437 | TARGETED_DEVICE_FAMILY = "1,2"; 438 | }; 439 | name = Debug; 440 | }; 441 | 3E9D076419E50FE1008C21CA /* Release */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | CODE_SIGN_IDENTITY = ""; 446 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)", 450 | ); 451 | INFOPLIST_FILE = MobileDataSwitch/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | PRODUCT_NAME = "$(TARGET_NAME)"; 454 | PROVISIONING_PROFILE = "c7580fef-8a91-4f86-9d69-53f325604f92"; 455 | TARGETED_DEVICE_FAMILY = "1,2"; 456 | }; 457 | name = Release; 458 | }; 459 | 3EFD83541A03825D0030FC5A /* Debug */ = { 460 | isa = XCBuildConfiguration; 461 | buildSettings = { 462 | CODE_SIGN_ENTITLEMENTS = ""; 463 | CODE_SIGN_IDENTITY = ""; 464 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 465 | FRAMEWORK_SEARCH_PATHS = ( 466 | "$(inherited)", 467 | "$(PROJECT_DIR)", 468 | ); 469 | GCC_PREPROCESSOR_DEFINITIONS = ( 470 | "DEBUG=1", 471 | "$(inherited)", 472 | ); 473 | INFOPLIST_FILE = MobileSwitch/Info.plist; 474 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 475 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; 476 | PRODUCT_NAME = "$(TARGET_NAME)"; 477 | PROVISIONING_PROFILE = "c7580fef-8a91-4f86-9d69-53f325604f92"; 478 | SKIP_INSTALL = YES; 479 | VALID_ARCHS = "armv7 armv7s arm64"; 480 | }; 481 | name = Debug; 482 | }; 483 | 3EFD83551A03825D0030FC5A /* Release */ = { 484 | isa = XCBuildConfiguration; 485 | buildSettings = { 486 | CODE_SIGN_ENTITLEMENTS = ""; 487 | CODE_SIGN_IDENTITY = ""; 488 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 489 | FRAMEWORK_SEARCH_PATHS = ( 490 | "$(inherited)", 491 | "$(PROJECT_DIR)", 492 | ); 493 | INFOPLIST_FILE = MobileSwitch/Info.plist; 494 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; 496 | PRODUCT_NAME = "$(TARGET_NAME)"; 497 | PROVISIONING_PROFILE = "c7580fef-8a91-4f86-9d69-53f325604f92"; 498 | SKIP_INSTALL = YES; 499 | VALID_ARCHS = "armv7 armv7s arm64"; 500 | }; 501 | name = Release; 502 | }; 503 | /* End XCBuildConfiguration section */ 504 | 505 | /* Begin XCConfigurationList section */ 506 | 3E9D073A19E50FE1008C21CA /* Build configuration list for PBXProject "MobileDataSwitch" */ = { 507 | isa = XCConfigurationList; 508 | buildConfigurations = ( 509 | 3E9D076019E50FE1008C21CA /* Debug */, 510 | 3E9D076119E50FE1008C21CA /* Release */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | 3E9D076219E50FE1008C21CA /* Build configuration list for PBXNativeTarget "MobileDataSwitch" */ = { 516 | isa = XCConfigurationList; 517 | buildConfigurations = ( 518 | 3E9D076319E50FE1008C21CA /* Debug */, 519 | 3E9D076419E50FE1008C21CA /* Release */, 520 | ); 521 | defaultConfigurationIsVisible = 0; 522 | defaultConfigurationName = Release; 523 | }; 524 | 3EFD83561A03825D0030FC5A /* Build configuration list for PBXNativeTarget "MobileSwitch" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | 3EFD83541A03825D0030FC5A /* Debug */, 528 | 3EFD83551A03825D0030FC5A /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | /* End XCConfigurationList section */ 534 | }; 535 | rootObject = 3E9D073719E50FE1008C21CA /* Project object */; 536 | } 537 | -------------------------------------------------------------------------------- /MobileDataSwitch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MobileDataSwitch/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MobileDataSwitch 4 | // 5 | // Created by gongliang on 14/10/8. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /MobileDataSwitch/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MobileDataSwitch 4 | // 5 | // Created by gongliang on 14/10/8. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /MobileDataSwitch/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /MobileDataSwitch/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /MobileDataSwitch/GLViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // MobileDataSwitch 4 | // 5 | // Created by gongliang on 14/10/8. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GLViewController : UIViewController 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /MobileDataSwitch/GLViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // MobileDataSwitch 4 | // 5 | // Created by gongliang on 14/10/8. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // 8 | 9 | #import "GLViewController.h" 10 | 11 | @implementation GLViewController 12 | 13 | - (void)viewDidLoad { 14 | [super viewDidLoad]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-Small@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-Small@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-Spotlight-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-Spotlight-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | } 39 | ], 40 | "info" : { 41 | "version" : 1, 42 | "author" : "xcode" 43 | } 44 | } -------------------------------------------------------------------------------- /MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Small@2x.png -------------------------------------------------------------------------------- /MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Small@3x.png -------------------------------------------------------------------------------- /MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png -------------------------------------------------------------------------------- /MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileDataSwitch/Images.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png -------------------------------------------------------------------------------- /MobileDataSwitch/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | 控制开关 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | com.aprilbrother.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /MobileDataSwitch/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MobileDataSwitch 4 | // 5 | // Created by gongliang on 14/10/8. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MobileDataSwitchTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.aprilbrother.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /MobileDataSwitchTests/MobileDataSwitchTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MobileDataSwitchTests.m 3 | // MobileDataSwitchTests 4 | // 5 | // Created by gongliang on 14/10/8. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface MobileDataSwitchTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation MobileDataSwitchTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MobileSwitch/GLBluetoothController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GLBlueController.h 3 | // MobileDataSwitch 4 | // 5 | // Created by markss on 15/4/2. 6 | // Copyright (c) 2015年 GL. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GLBluetoothController : NSObject 12 | 13 | + (instancetype)sharedInstance; 14 | 15 | @property (assign, nonatomic) BOOL enabled; 16 | @property (assign, nonatomic) BOOL powered; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MobileSwitch/GLBluetoothController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GLBlueController.m 3 | // MobileDataSwitch 4 | // 5 | // Created by markss on 15/4/2. 6 | // Copyright (c) 2015年 GL. All rights reserved. 7 | // 8 | 9 | #import "GLBluetoothController.h" 10 | 11 | @interface PrivateApi_BluetoothManager 12 | 13 | @property (assign, nonatomic) BOOL enabled; 14 | @property (assign, nonatomic) BOOL powered; 15 | @end 16 | 17 | @interface GLBluetoothController () 18 | 19 | @end 20 | 21 | @implementation GLBluetoothController { 22 | PrivateApi_BluetoothManager *_blueTooth; 23 | } 24 | 25 | @synthesize enabled = _enabled, powered = _powered; 26 | 27 | + (instancetype)sharedInstance { 28 | static dispatch_once_t onceToken; 29 | static id sharedInstance; 30 | dispatch_once(&onceToken, ^{ 31 | sharedInstance = [[self alloc] init]; 32 | }); 33 | return sharedInstance; 34 | } 35 | 36 | - (instancetype)init { 37 | if (self = [super init]) { 38 | _blueTooth = [NSClassFromString(@"BluetoothManager") new]; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)setEnabled:(BOOL)enabled { 44 | _enabled = enabled; 45 | _blueTooth.enabled = enabled; 46 | } 47 | 48 | - (BOOL)enabled { 49 | return _blueTooth.enabled; 50 | } 51 | 52 | - (void)setPowered:(BOOL)powered { 53 | _powered = powered; 54 | _blueTooth.powered = powered; 55 | } 56 | 57 | - (BOOL)powered { 58 | return _blueTooth.powered; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /MobileSwitch/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | 控制开关 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | com.aprilbrother.MobileDataSwitch.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | XPC! 19 | CFBundleShortVersionString 20 | 1.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.1 25 | NSExtension 26 | 27 | NSExtensionMainStoryboard 28 | MainInterface 29 | NSExtensionPointIdentifier 30 | com.apple.widget-extension 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /MobileSwitch/MainInterface.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/bluetooth.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "bluetooth@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/bluetooth.imageset/bluetooth@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileSwitch/MoblieSwitch.xcassets/bluetooth.imageset/bluetooth@2x.png -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/location.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "location@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/location.imageset/location@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileSwitch/MoblieSwitch.xcassets/location.imageset/location@2x.png -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/private.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "private@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/private.imageset/private@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileSwitch/MoblieSwitch.xcassets/private.imageset/private@2x.png -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/remind.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "remind@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/remind.imageset/remind@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileSwitch/MoblieSwitch.xcassets/remind.imageset/remind@2x.png -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/shareNetwork.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "shareNetwork.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/shareNetwork.imageset/shareNetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileSwitch/MoblieSwitch.xcassets/shareNetwork.imageset/shareNetwork.png -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/wifi.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x", 10 | "filename" : "wifi@2x.png" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MobileSwitch/MoblieSwitch.xcassets/wifi.imageset/wifi@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileSwitch/MoblieSwitch.xcassets/wifi.imageset/wifi@2x.png -------------------------------------------------------------------------------- /MobileSwitch/TodayViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TodayViewController.h 3 | // MobileSwitch 4 | // 5 | // Created by gongliang on 14/10/31. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TodayViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MobileSwitch/TodayViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TodayViewController.m 3 | // MobileSwitch 4 | // 5 | // Created by gongliang on 14/10/31. 6 | // Copyright (c) 2014年 GL. All rights reserved. 7 | // widget 8 | 9 | #import "TodayViewController.h" 10 | #import 11 | #import 12 | #import "GLBluetoothController.h" 13 | 14 | 15 | static CGFloat kDefaultHeight = 48.0f; 16 | 17 | extern BOOL CTCellularDataPlanGetIsEnabled(); 18 | extern void CTCellularDataPlanSetIsEnabled(BOOL enabled); 19 | 20 | @interface TodayViewController () 21 | @property (weak, nonatomic) IBOutlet UISwitch *mobileDataSwitch; 22 | @property (weak, nonatomic) IBOutlet UISwitch *blueToothSwitch; 23 | @property (weak, nonatomic) IBOutlet UIButton *locationButton; 24 | @property (nonatomic, strong) GLBluetoothController *btCont; 25 | 26 | @end 27 | 28 | @implementation TodayViewController 29 | 30 | - (void)viewDidLoad { 31 | [super viewDidLoad]; 32 | // Do any additional setup after loading the view from its nib. 33 | NSLog(@"self.view = %@", self.view); 34 | self.preferredContentSize = CGSizeMake(0, kDefaultHeight); 35 | [self.view bringSubviewToFront:self.mobileDataSwitch]; 36 | self.mobileDataSwitch.on = CTCellularDataPlanGetIsEnabled(); 37 | _btCont = [GLBluetoothController sharedInstance]; 38 | _blueToothSwitch.on = _btCont.enabled; 39 | } 40 | 41 | - (UIEdgeInsets)widgetMarginInsetsForProposedMarginInsets:(UIEdgeInsets)defaultMarginInsets { 42 | return UIEdgeInsetsMake(5, 20, -5, 0); 43 | } 44 | 45 | - (void)didReceiveMemoryWarning { 46 | [super didReceiveMemoryWarning]; 47 | // Dispose of any resources that can be recreated. 48 | } 49 | 50 | - (IBAction)switchMobileData:(UISwitch *)sender { 51 | CTCellularDataPlanSetIsEnabled(sender.on); 52 | } 53 | 54 | - (IBAction)switchBlueTooth:(UISwitch *)sender { 55 | [_btCont setEnabled:sender.on]; 56 | [_btCont setPowered:sender.on]; 57 | } 58 | 59 | - (IBAction)wifiAction:(id)sender { 60 | NSURL *url = [NSURL URLWithString:@"prefs:root=WIFI"]; 61 | [self.extensionContext openURL:url completionHandler:nil]; 62 | } 63 | 64 | - (IBAction)location:(id)sender { 65 | NSURL *url = [NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]; 66 | [self.extensionContext openURL:url completionHandler:nil]; 67 | } 68 | 69 | - (IBAction)blueTooth:(id)sender { 70 | NSURL *url = [NSURL URLWithString:@"prefs:root=Bluetooth"]; 71 | [self.extensionContext openURL:url completionHandler:nil]; 72 | } 73 | 74 | - (IBAction)private:(id)sender { 75 | NSURL *url = [NSURL URLWithString:@"prefs:root=Privacy"]; 76 | [self.extensionContext openURL:url completionHandler:nil]; 77 | } 78 | 79 | - (IBAction)dosage:(id)sender { 80 | NSURL *url = [NSURL URLWithString:@"prefs:root=REMINDERS"]; 81 | [self.extensionContext openURL:url completionHandler:nil]; 82 | } 83 | 84 | - (IBAction)disturbance:(id)sender { 85 | NSURL *url = [NSURL URLWithString:@"prefs:root=DO_NOT_DISTURB"]; 86 | [self.extensionContext openURL:url completionHandler:nil]; 87 | } 88 | 89 | - (IBAction)shareNewwork:(id)sender { 90 | NSURL *url = [NSURL URLWithString:@"prefs:root=INTERNET_TETHERING"]; 91 | [self.extensionContext openURL:url completionHandler:nil]; 92 | } 93 | 94 | - (void)widgetPerformUpdateWithCompletionHandler:(void (^)(NCUpdateResult))completionHandler { 95 | // Perform any setup necessary in order to update the view. 96 | 97 | // If an error is encountered, use NCUpdateResultFailed 98 | // If there's no update required, use NCUpdateResultNoData 99 | // If there's an update, use NCUpdateResultNewData 100 | 101 | completionHandler(NCUpdateResultNewData); 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /MobileWiFi.framework/Headers/MobileWiFi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MobileWiFi framework base header. 3 | * 4 | * Copyright (c) 2013, Cykey (David Murray) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of the nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef MOBILEWIFI_H_ 31 | #define MOBILEWIFI_H_ 32 | 33 | #include "WiFiDeviceClient.h" 34 | #include "WiFiNetwork.h" 35 | #include "WiFiManager.h" 36 | 37 | #if __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | #pragma mark - Constants 42 | 43 | extern CFStringRef kWiFiATJTestModeEnabledKey; 44 | extern CFStringRef kWiFiDeviceCapabilitiesKey; 45 | extern CFStringRef kWiFiDeviceSupportsWAPIKey; 46 | extern CFStringRef kWiFiDeviceSupportsWoWKey; 47 | extern CFStringRef kWiFiDeviceVendorIDKey; 48 | extern CFStringRef kWiFiLocaleTestParamsKey; 49 | extern CFStringRef kWiFiLoggingDriverFileKey; 50 | extern CFStringRef kWiFiLoggingDriverLoggingEnabledKey; 51 | extern CFStringRef kWiFiLoggingEnabledKey; 52 | extern CFStringRef kWiFiLoggingFileEnabledKey; 53 | extern CFStringRef kWiFiLoggingFileKey; 54 | extern CFStringRef kWiFiManagerDisableBlackListKey; 55 | extern CFStringRef kWiFiNetworkEnterpriseProfileKey; 56 | extern CFStringRef kWiFiPreferenceCustomNetworksSettingsKey; 57 | extern CFStringRef kWiFiPreferenceEnhancedWoWEnabledKey; 58 | extern CFStringRef kWiFiPreferenceMStageAutoJoinKey; 59 | extern CFStringRef kWiFiRSSIThresholdKey; // '-80' 60 | extern CFStringRef kWiFiScaledRSSIKey; 61 | extern CFStringRef kWiFiScaledRateKey; 62 | extern CFStringRef kWiFiStrengthKey; 63 | extern CFStringRef kWiFiTetheringCredentialsKey; 64 | 65 | #if __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* MOBILEWIFI_H_ */ 70 | -------------------------------------------------------------------------------- /MobileWiFi.framework/Headers/WiFiDeviceClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MobileWiFi device client header. 3 | * 4 | * Copyright (c) 2013, Cykey (David Murray) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of the nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef WIFIDEVICECLIENT_H_ 31 | #define WIFIDEVICECLIENT_H_ 32 | 33 | #include 34 | #include "WiFiNetwork.h" 35 | 36 | #if __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | #pragma mark - Definitions 41 | 42 | /* 43 | * Opaque structure definition. 44 | */ 45 | 46 | typedef struct __WiFiDeviceClient *WiFiDeviceClientRef; 47 | 48 | /* Callback typedefs. */ 49 | typedef void (*WiFiDeviceClientGenericCallback)(WiFiDeviceClientRef device, CFDictionaryRef data, const void *object); 50 | typedef void (*WiFiDeviceClientLinkOrPowerCallback)(WiFiDeviceClientRef device, const void *object); 51 | typedef void (*WiFiDeviceScanCallback)(WiFiDeviceClientRef device, CFArrayRef results, int error, const void *object); 52 | typedef void (*WiFiDeviceAssociateCallback)(WiFiDeviceClientRef device, WiFiNetworkRef network, CFDictionaryRef dict, int error, const void *object); 53 | 54 | #pragma mark - API 55 | 56 | CFPropertyListRef WiFiDeviceClientCopyProperty(WiFiDeviceClientRef client, CFStringRef property); 57 | 58 | WiFiNetworkRef WiFiDeviceClientCopyCurrentNetwork(WiFiDeviceClientRef client); 59 | 60 | int WiFiDeviceClientGetPower(WiFiDeviceClientRef client); 61 | void WiFiDeviceClientSetPower(WiFiDeviceClientRef client, int power); 62 | 63 | /* 64 | * The following keys in the dict parameter are understood by wifid: 65 | * "SCAN_CHANNELS": An array of dictionaries containing the 'CHANNEL' and 'CHANNEL_FLAGS' keys. 66 | * "SCAN_MAXAGE": Unknown. Use 2. 67 | * "SCAN_MERGE": Unknown. Use 1. 68 | * "SCAN_NUM_SCANS": Number of scans to perform. 69 | * "SCAN_PHY_MODE": Has something to do with PHY. 70 | * "SCAN_RSSI_THRESHOLD": The RSSI theshold level. Apple uses -80, meaning that networks that have a signal strength lower than -80 will be ignored. 71 | * "SCAN_TYPE": Unknown. Use 1. 72 | */ 73 | int WiFiDeviceClientScanAsync(WiFiDeviceClientRef device, CFDictionaryRef dict, WiFiDeviceScanCallback callback, const void *object); 74 | 75 | /* 76 | * Used to connect to a network. Example usage: 77 | * (Get a WiFiNetworkRef instance from the scan results or something.) 78 | * WiFiNetworkSetPassword(network, CFSTR("Password1")); 79 | * WiFiDeviceClientAssociateAsync(client, network, MyCallbackFunction, NULL); 80 | */ 81 | int WiFiDeviceClientAssociateAsync(WiFiDeviceClientRef client, WiFiNetworkRef network, WiFiDeviceAssociateCallback callback, CFDictionaryRef dict); 82 | void WiFiDeviceClientAssociateCancel(WiFiDeviceClientRef client); 83 | void WiFiDeviceClientDisassociate(WiFiDeviceClientRef client); 84 | 85 | CFStringRef WiFiDeviceClientGetInterfaceName(WiFiDeviceClientRef client); 86 | 87 | /* 88 | * LQM stands for 'Link Quality Metrics': 89 | * Jan 23 15:25:01 kernel[0] : 187357.621783 wlan.A[13651] AppleBCMWLANNetManager::updateLinkQualityMetrics(): Report LQM to User Land 50, fAverageRSSI -71 90 | */ 91 | 92 | void WiFiDeviceClientRegisterLQMCallback(WiFiDeviceClientRef device, WiFiDeviceClientGenericCallback callback, const void *object); 93 | void WiFiDeviceClientRegisterExtendedLinkCallback(WiFiDeviceClientRef device, WiFiDeviceClientGenericCallback callback, const void *object); 94 | void WiFiDeviceClientRegisterLinkCallback(WiFiDeviceClientRef device, WiFiDeviceClientLinkOrPowerCallback callback, const void *object); 95 | void WiFiDeviceClientRegisterPowerCallback(WiFiDeviceClientRef device, WiFiDeviceClientLinkOrPowerCallback callback, const void *object); 96 | 97 | #if __cplusplus 98 | } 99 | #endif 100 | 101 | #endif /* WIFIDEVICECLIENT_H_ */ 102 | -------------------------------------------------------------------------------- /MobileWiFi.framework/Headers/WiFiManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MobileWiFi manager header. 3 | * 4 | * Copyright (c) 2013, Cykey (David Murray) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of the nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef WIFIMANAGER_H_ 31 | #define WIFIMANAGER_H_ 32 | 33 | #include 34 | #include "WiFiNetwork.h" 35 | #include "WiFiDeviceClient.h" 36 | 37 | 38 | #if __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | #pragma mark - Definitions 43 | 44 | typedef struct __WiFiManager *WiFiManagerRef; 45 | 46 | #pragma mark - API 47 | 48 | WiFiManagerRef WiFiManagerClientCreate(CFAllocatorRef allocator, int flags); 49 | 50 | CFArrayRef WiFiManagerClientCopyDevices(WiFiManagerRef manager); 51 | CFArrayRef WiFiManagerClientCopyNetworks(WiFiManagerRef manager); 52 | 53 | void WiFiManagerClientRemoveNetwork(WiFiManagerRef manager, WiFiNetworkRef network); 54 | 55 | WiFiDeviceClientRef WiFiManagerClientGetDevice(WiFiManagerRef manager); 56 | 57 | void WiFiManagerClientScheduleWithRunLoop(WiFiManagerRef manager, CFRunLoopRef runLoop, CFStringRef mode); 58 | void WiFiManagerClientUnscheduleFromRunLoop(WiFiManagerRef manager); 59 | void WiFiManagerClientSetProperty(WiFiManagerRef manager, CFStringRef property, CFPropertyListRef value); 60 | 61 | CFPropertyListRef WiFiManagerClientCopyProperty(WiFiManagerRef manager, CFStringRef property); 62 | 63 | void WiFiManagerClientQuiesceWiFi(WiFiManagerRef manager, int state); 64 | 65 | void WiFiManagerClientSetMISState(WiFiManagerRef manager, int state); 66 | void WiFiManagerClientSetMisPassword(WiFiManagerRef manager, CFStringRef password); 67 | void WiFiManagerClientSetMISDiscoveryState(WiFiManagerRef manager, int state); 68 | 69 | int WiFiManagerClientGetMISState(WiFiManagerRef manager); 70 | int WiFiManagerClientGetMISDiscoveryState(WiFiManagerRef manager); 71 | 72 | #if __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* WIFIMANAGER_H_ */ 77 | -------------------------------------------------------------------------------- /MobileWiFi.framework/Headers/WiFiNetwork.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MobileWiFi network header. 3 | * 4 | * Copyright (c) 2013, Cykey (David Murray) 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * * Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of the nor the 15 | * names of its contributors may be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | * DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef WIFINETWORK_H_ 31 | #define WIFINETWORK_H_ 32 | 33 | #include 34 | 35 | #if __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | #pragma mark - Definitions 40 | 41 | /* 42 | * Opaque structure definitions. 43 | */ 44 | 45 | typedef struct __WiFiNetwork *WiFiNetworkRef; 46 | 47 | #pragma mark - API 48 | 49 | CFPropertyListRef WiFiNetworkGetProperty(WiFiNetworkRef network, CFStringRef property); 50 | 51 | int WiFiNetworkGetIntProperty(WiFiNetworkRef network, CFStringRef property); 52 | 53 | float WiFiNetworkGetFloatProperty(WiFiNetworkRef network, CFStringRef property); 54 | 55 | CFStringRef WiFiNetworkCopyPassword(WiFiNetworkRef); 56 | CFStringRef WiFiNetworkGetSSID(WiFiNetworkRef network); 57 | 58 | void WiFiNetworkSetPassword(WiFiNetworkRef network, CFStringRef password); 59 | 60 | float WiFiNetworkGetNetworkUsage(WiFiNetworkRef network); 61 | 62 | Boolean WiFiNetworkIsWEP(WiFiNetworkRef network); 63 | Boolean WiFiNetworkIsWPA(WiFiNetworkRef network); 64 | Boolean WiFiNetworkIsEAP(WiFiNetworkRef network); 65 | Boolean WiFiNetworkIsApplePersonalHotspot(WiFiNetworkRef network); 66 | Boolean WiFiNetworkIsAdHoc(WiFiNetworkRef network); 67 | Boolean WiFiNetworkIsHidden(WiFiNetworkRef network); 68 | Boolean WiFiNetworkRequiresPassword(WiFiNetworkRef network); 69 | Boolean WiFiNetworkRequiresUsername(WiFiNetworkRef network); 70 | 71 | /* This returns NULL a lot, not sure why. */ 72 | CFDateRef WiFiNetworkGetLastAssociationDate(WiFiNetworkRef network); 73 | 74 | CFDictionaryRef WiFiNetworkCopyRecord(WiFiNetworkRef network); 75 | 76 | #if __cplusplus 77 | } 78 | #endif 79 | 80 | #endif /* WIFINETWORK_H_ */ 81 | -------------------------------------------------------------------------------- /MobileWiFi.framework/MobileWiFi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mark-SS/SwitchCellularDataAndBluetooth/d851857ce8ab9ea62ca6dfb0ac2f95038986b30c/MobileWiFi.framework/MobileWiFi -------------------------------------------------------------------------------- /MobileWiFi.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | rules 8 | 9 | ^Resources/ 10 | 11 | ^Resources/.*\.lproj/ 12 | 13 | omit 14 | 15 | weight 16 | 10 17 | 18 | ^Resources/.*\.lproj/locversion.plist$ 19 | 20 | omit 21 | 22 | weight 23 | 30 24 | 25 | ^Resources/.*\.nib/classes\.nib$ 26 | 27 | optional 28 | 29 | weight 30 | 5 31 | 32 | ^Resources/.*\.nib/data\.dependency$ 33 | 34 | optional 35 | 36 | weight 37 | 5 38 | 39 | ^Resources/.*\.nib/info\.nib$ 40 | 41 | optional 42 | 43 | weight 44 | 5 45 | 46 | ^Resources/English\.lproj/ 47 | 48 | optional 49 | 50 | weight 51 | 20 52 | 53 | ^version.plist$ 54 | 55 | omit 56 | 57 | weight 58 | 10 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 开关蜂窝数据和蓝牙 2 | =========================== 3 | 编译![](http://7xi5jw.com1.z0.glb.clouddn.com/widget.png)到真机上 4 | ![](http://7xi5jw.com1.z0.glb.clouddn.com/switchData2.png) 5 | 分支cellularData是只有蜂窝数据的版本 6 | ![](http://7xi5jw.com1.z0.glb.clouddn.com/cellularData.png) 7 | 8 | ## License 9 | 10 | SwitchCellularDataAndBluetootth is available under the MIT license. See the LICENSE file for more info. 11 | --------------------------------------------------------------------------------