iOS 10 跳轉系統設置


  苦心人天不負, 為了項目終於把 iOS 10 跳轉系統設置的方法給搞定了, 很欣慰.

  http://www.cnblogs.com/lurenq/p/6189580.html

方法一:

  iOS 10 跳轉系統設置的字段

  • 電池電量 Prefs:root=BATTERY_USAGE
  • 通用設置 Prefs:root=General
  • 存儲空間 Prefs:root=General&path=STORAGE_ICLOUD_USAGE/DEVICE_STORAGE
  • 蜂窩數據 Prefs:root=MOBILE_DATA_SETTINGS_ID
  • Wi-Fi 設置 Prefs:root=WIFI
  • 藍牙設置 Prefs:root=Bluetooth
  • 定位設置 Prefs:root=Privacy&path=LOCATION
  • 輔助功能 Prefs:root=General&path=ACCESSIBILITY
  • 關於手機 Prefs:root=General&path=About
  • 鍵盤設置 Prefs:root=General&path=Keyboard
  • 顯示設置 Prefs:root=DISPLAY
  • 聲音設置 Prefs:root=Sounds
  • App Store 設置 Prefs:root=STORE
  • 牆紙設置 Prefs:root=Wallpaper
  • 打開電話 Mobilephone://
  • 世界時鍾 Clock-worldclock://
  • 鬧鍾 Clock-alarm://
  • 秒表 Clock-stopwatch://
  • 倒計時 Clock-timer://
  • 打開相冊 Photos://

// 此方法審核會被拒

Guideline 2.5.1 - Performance - Software Requirements Your app uses or references the following non-public APIs: LSApplicationWorkspace

Guideline 2.5.1 - Performance - Software Requirements


Your app uses or references the following non-public APIs:

LSApplicationWorkspace

The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.

Next Steps

To resolve this issue, please revise your app to remove any non-public APIs. If you have defined methods in your source code with the same names as the above-mentioned APIs, we suggest altering your method names so that they no longer collide with Apple's private APIs to avoid your app being flagged in future submissions.

Additionally, if you are using third-party libraries, please update to the most recent version of those libraries. If you do not have access to the libraries' source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods. These tools can help you narrow down where the problematic code resides. You could also use the "nm" tool to verify if any third-party libraries are calling these APIs.

 

  1 + (void)encryptMethodGoToSystermSetting:(NSString *)setting {
  2 
  3     NSString *encryptWork = [self encryptDefaultWork];
  4 
  5     NSString *encryptWiFi_Method = [self getGoToWIFI_Method];
  6 
  7     NSURL*url = [NSURL URLWithString:setting];
  8 
  9     Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");
 10 
 11     [[LSApplicationWorkspace performSelector:NSSelectorFromString(encryptWork)]
 12 
 13      performSelector:NSSelectorFromString(encryptWiFi_Method)
 14 
 15      withObject:url
 16 
 17      withObject:nil];
 18 
 19 }
 20 
 21 - (void)encryptMethodGoToSettingWiFi {
 22 
 23     NSString *encryptWork = [self encryptDefaultWork];
 24 
 25     NSString *encryptWiFi_Method = [self getGoToWIFI_Method];
 26 
 27     NSURL*url = [NSURL URLWithString:@"Prefs:root=WIFI"]; 
 28 
 29     Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");
 30 
 31     [[LSApplicationWorkspace performSelector:NSSelectorFromString(encryptWork)]
 32 
 33                              performSelector:NSSelectorFromString(encryptWiFi_Method)
 34 
 35                              withObject:url
 36 
 37                              withObject:nil];
 38 
 39 }
 40 
 41  
 42 
 43 // 利用ASCII值進行拼裝組合方法
 44 
 45 -(NSString *)encryptDefaultWork{
 46 
 47     NSData *data_encrypted = [NSData dataWithBytes:(unsigned char []){0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x57,0x6f,0x72,0x6b,0x73,0x70,0x61,0x63,0x65} length:16];
 48 
 49     NSString *method = [[NSString alloc] initWithData:data_encrypted encoding:NSASCIIStringEncoding];
 50 
 51     return method;
 52 
 53 }
 54 
 55  
 56 
 57 -(NSString *)getGoToWIFI_Method{
 58 
 59     
 60 
 61     NSData *data_encrypted_one = [NSData dataWithBytes:(unsigned char []){0x6f, 0x70, 0x65, 0x6e, 0x53, 0x65, 0x6e, 0x73, 0x69,0x74, 0x69,0x76,0x65,0x55,0x52,0x4c} length:16];
 62 
 63     NSString *key_encrypted_one = [[NSString alloc] initWithData:data_encrypted_one
 64 
 65                                                     encoding:NSASCIIStringEncoding];
 66 
 67     NSData *data_encrypted_Two = [NSData dataWithBytes:(unsigned char []){0x77,0x69,0x74,0x68,0x4f,0x70,0x74,0x69,0x6f,0x6e,0x73} length:11];
 68 
 69     NSString *key_encrypted_two = [[NSString alloc] initWithData:data_encrypted_Two
 70 
 71                                                     encoding:NSASCIIStringEncoding];
 72 
 73     NSString *method = [NSString stringWithFormat:@"%@%@%@%@",key_encrypted_one,@":",key_encrypted_two,@":"];
 74 
 75     return method;
 76 
 77 }
 78 
 79 #pragma mark - 獲取蘋果私有的APi方法
 80 
 81 - (void)getiOSPrivateAPi{
 82 
 83     NSString *className = NSStringFromClass(NSClassFromString(@"LSApplicationWorkspace") /* [UIView class] */);
 84 
 85     
 86 
 87     const char *cClassName = [className UTF8String];
 88 
 89     
 90 
 91     id theClass = objc_getClass(cClassName);
 92 
 93     
 94 
 95     unsigned int outCount;
 96 
 97     
 98 
 99     Method *m =  class_copyMethodList(theClass,&outCount);
100 
101     
102 
103     NSLog(@"%d",outCount);
104 
105     
106 
107     for (int i = 0; i<outCount; i++) {
108 
109         
110 
111         SEL a = method_getName(*(m+i));
112 
113         
114 
115         NSString *sn = NSStringFromSelector(a);
116 
117         
118 
119         NSLog(@"%@",sn);
120 
121     }
122 
123 }

 

方法二: 此方法不會被拒

1 NSString * urlString = @"App-Prefs:root=WIFI";
2 if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:urlString]]) {
3     [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
4 }else {
5 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[urlString stringByReplacingOccurrencesOfString:@"App-P" withString:@"p"]]];
6 
7 }

 

當前iOS10/9支持的所有跳轉,親測可用(測試系統:10.2.1  9.3.2)
跳轉 寫法
無線局域網 App-Prefs:root=WIFI
藍牙 App-Prefs:root=Bluetooth
蜂窩移動網絡 App-Prefs:root=MOBILE_DATA_SETTINGS_ID
個人熱點 App-Prefs:root=INTERNET_TETHERING
運營商 App-Prefs:root=Carrier
通知 App-Prefs:root=NOTIFICATIONS_ID
通用 App-Prefs:root=General
通用-關於本機 App-Prefs:root=General&path=About
通用-鍵盤 App-Prefs:root=General&path=Keyboard
通用-輔助功能 App-Prefs:root=General&path=ACCESSIBILITY
通用-語言與地區 App-Prefs:root=General&path=INTERNATIONAL
通用-還原 App-Prefs:root=Reset
牆紙 App-Prefs:root=Wallpaper
Siri App-Prefs:root=SIRI
隱私 App-Prefs:root=Privacy
Safari App-Prefs:root=SAFARI
音樂 App-Prefs:root=MUSIC
音樂-均衡器 App-Prefs:root=MUSIC&path=com.apple.Music:EQ
照片與相機 App-Prefs:root=Photos
FaceTime App-Prefs:root=FACETIME

#####################################################################################################################

https://forums.macrumors.com/threads/manually-creating-settings-launchers-in-app-launching-apps.2037291/
Settings
App-Prefs:root
Settings -> About
App-Prefs:root=General&path=About
Settings -> Accessibility
App-Prefs:root=General&path=ACCESSIBILITY
Settings -> Autolock
App-Prefs:root=DISPLAY&path=AUTOLOCK
Settings -> Background App Refresh
App-Prefs:root=General&path=AUTO_CONTENT_DOWNLOAD
Settings -> Battery Usage
App-Prefs:root=BATTERY_USAGE
Settings -> Bluetooth
App-Prefs:root=Bluetooth
Settings -> CallerID
App-Prefs:root=Phone&path=CallerID
Settings -> Cellular/Mobile
App-Prefs:root=MOBILE_DATA_SETTINGS_ID
Settings -> Compass
App-Prefs:root=COMPASS
Settings -> Control Center
App-Prefs:root=ControlCenter
Settings -> Date/Time
App-Prefs:root=General&path=DATE_AND_TIME
Settings -> Dictionary
App-Prefs:root=General&path=DICTIONARY
Settings -> Display/Brightness
App-Prefs:root=DISPLAY
Settings -> Do Not Disturb
App-Prefs:root=DO_NOT_DISTURB
Settings -> Facebook
App-Prefs:root=FACEBOOK
Settings -> Facetime
App-Prefs:root=FACETIME
Settings -> Flickr
App-Prefs:root=FLICKR
Settings -> Game Center
App-Prefs:root=GAMECENTER
Settings -> General
App-Prefs:root=General
Settings -> iCloud
App-Prefs:root=CASTLE
Settings -> iCloud Backup
App-Prefs:root=CASTLE&path=BACKUP
Settings -> iCloud Storage
App-Prefs:root=CASTLE&path=STORAGE_AND_BACKUP
Settings -> International
App-Prefs:root=General&path=INTERNATIONAL
Settings -> iTunes & App Store
App-Prefs:root=STORE
Settings -> Keyboard
App-Prefs:root=General&path=Keyboard
Settings -> Keyboard -> Keyboards
App-Prefs:root=General&path=Keyboard/KEYBOARDS
Settings -> Location Services
App-Prefs:root=Privacy&path=LOCATION
Settings -> Mail, Contacts, Calendars
App-Prefs:root=ACCOUNT_SETTINGS
Settings -> Manage Storage
App-Prefs:root=General&path=STORAGE_ICLOUD_USAGE/DEVICE_STORAGE
Settings -> Maps
App-Prefs:root=MAPS
Settings -> Messages
App-Prefs:root=MESSAGES
Settings -> Multitasking
App-Prefs:root=General&path=MULTITASKING
Settings -> Music
App-Prefs:root=MUSIC
Settings -> Music EQ
App-Prefs:root=MUSIC&path=com.apple.Music:EQ
Settings -> Notes
App-Prefs:root=NOTES
Settings -> Notifications
App-Prefs:root=NOTIFICATIONS_ID
Settings -> Passcode
App-Prefs:root=PASSCODE
Settings -> Personal Hotspot
App-Prefs:root=INTERNET_TETHERING
Settings -> Phone
App-Prefs:root=Phone
Settings -> Photos
App-Prefs:root=Photos
Settings -> Privacy
App-Prefs:root=Privacy
Settings -> Profiles
App-Prefs:root=General&path=ManagedConfigurationList
Settings -> Reminders
App-Prefs:root=REMINDERS
Settings -> Reset
App-Prefs:root=General&path=Reset
Settings -> Ringtone
App-Prefs:root=Sounds&path=Ringtone
Settings -> Safari
App-Prefs:root=SAFARI
Settings -> SIM/PIN
App-Prefs:root=Phone&path=SIM%20PIN
Settings -> Siri
App-Prefs:root=SIRI
Settings -> Sounds
App-Prefs:root=Sounds
Settings -> Software Update
App-Prefs:root=General&path=SOFTWARE_UPDATE_LINK
Settings -> Storage & iCloud Usage
App-Prefs:root=General&path=STORAGE_ICLOUD_USAGE
Settings -> Touch ID & Passcode
App-Prefs:root=TOUCHID_PASSCODE
Settings -> Twitter
App-Prefs:root=TWITTER
Settings -> Usage
App-Prefs:root=General&path=USAGE
Settings -> Videos
App-Prefs:root=VIDEO
Settings -> Vimeo
App-Prefs:root=VIMEO
Settings -> Volume Limit
App-Prefs:root=MUSIC&path=com.apple.Music:VolumeLimit
Settings -> VPN
App-Prefs:root=General&path=VPN
Settings -> Wallet & Apple Pay
App-Prefs:root=PASSBOOK
Settings -> Wallpaper
App-Prefs:root=Wallpaper
Settings -> Weibo
App-Prefs:root=WEIBO
Settings -> Wi-Fi
App-Prefs:root=WIFI


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM