iOS 10 跳转系统设置

2017-06-01 09:04 出处:360java.com 作者:360java  阅读()
苦心人天不负, 为了项目终于把 iOS 10 跳转系统设置的方法给搞定了, 很欣慰. http://www.cnblogs.com/lurenq/p/6189580.html 方法一: iOS 10 跳转系统设置的字段 电池电量 Prefs:root=BATTERY_USAGE 通用设置

  苦心人天不负, 为了项目终于把 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.

+ (void)encryptMethodGoToSystermSetting:(NSString *)setting {

    NSString *encryptWork = [self encryptDefaultWork];

    NSString *encryptWiFi_Method = [self getGoToWIFI_Method];

    NSURL*url = [NSURL URLWithString:setting];

    Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");

    [[LSApplicationWorkspace performSelector:NSSelectorFromString(encryptWork)]

     performSelector:NSSelectorFromString(encryptWiFi_Method)

     withObject:url

     withObject:nil];

}

- (void)encryptMethodGoToSettingWiFi {

    NSString *encryptWork = [self encryptDefaultWork];

    NSString *encryptWiFi_Method = [self getGoToWIFI_Method];

    NSURL*url = [NSURL URLWithString:@"Prefs:root=WIFI"]; 

    Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");

    [[LSApplicationWorkspace performSelector:NSSelectorFromString(encryptWork)]

                             performSelector:NSSelectorFromString(encryptWiFi_Method)

                             withObject:url

                             withObject:nil];

}

 

// 利用ASCII值进行拼装组合方法

-(NSString *)encryptDefaultWork{

    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];

    NSString *method = [[NSString alloc] initWithData:data_encrypted encoding:NSASCIIStringEncoding];

    return method;

}

 

-(NSString *)getGoToWIFI_Method{

    

    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];

    NSString *key_encrypted_one = [[NSString alloc] initWithData:data_encrypted_one

                                                    encoding:NSASCIIStringEncoding];

    NSData *data_encrypted_Two = [NSData dataWithBytes:(unsigned char []){0x77,0x69,0x74,0x68,0x4f,0x70,0x74,0x69,0x6f,0x6e,0x73} length:11];

    NSString *key_encrypted_two = [[NSString alloc] initWithData:data_encrypted_Two

                                                    encoding:NSASCIIStringEncoding];

    NSString *method = [NSString stringWithFormat:@"%@%@%@%@",key_encrypted_one,@":",key_encrypted_two,@":"];

    return method;

}

方法二: 此方法不会被拒

NSString * urlString = @"App-Prefs:root=WIFI";
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:urlString]]) {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
}else {

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[urlString stringByReplacingOccurrencesOfString:@"App-P" withString:@"p"]]];

}

当前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
分享到:
本文标签: 跳转, 系统, 设置

相关文章

发表评论(共条评论)愿您的每句评论,都能给大家的生活添色彩,带来共鸣,带来思索,带来快乐。

Copyright (C) java学习 360java 360java.com, All Rights Reserved.

苏ICP备16022210号