iOS,iOS10 跳轉系統設定 WIFI 藍芽

2021-08-01 12:37:13 字數 2875 閱讀 7640

ios自我們熟悉以來,就一直與android有著不一樣的體驗,

系統更加流暢,使用更加舒適,

同時較高與android的**也導致了它的特殊性,

ios系統的封閉和很多許可權的限制導致了我們在開發的時候經常會遇到很多無法條件無法實現

就比如ios10以前,我們開發的應用想要跳轉到系統設定,跳轉到藍芽,跳轉到wifi…

ios開發工程師們都很熟悉,系統給我們提供了一套url,我們只要使用這一套就ok了

在ios10以前,

可能會用到的這些

蜂窩網路:prefs:root=mobile_data_settings_id

wi-fi:prefs:root=wifi

定位服務:prefs:root=location_services

個人熱點:prefs:root=internet_tethering

關於本機:prefs:root=general&path=about

輔助功能:prefs:root=general&path=accessibility

飛行模式:prefs:root=airplane_mode

鎖定:prefs:root=general&path=autolock

亮度:prefs:root=brightness

藍芽:prefs:root=bluetooth

時間設定:prefs:root=general&path=date_and_time

facetime:prefs:root=facetime

設定:prefs:root=general

設定 prefs:root=setting

定位服務 prefs:root=location_services

鍵盤設定:prefs:root=general&path=keyboard

icloud:prefs:root=castle

icloud備份:prefs:root=castle&path=storage_and_backup

語言:prefs:root=general&path=international

定位:prefs:root=location_services

**:prefs:root=music

我們在想要跳轉的時候只要簡單的幾行**

nsurl *url = [nsurl urlwithstring:@"prefs:root=bluetooth"];

}

於是有大神想到了私有的api

nsurl*url=[nsurl urlwithstring:@"prefs:root=bluetooth"];
因為是私有的api,可能會過不了審核,於是又有了下面的變種

利用ascii值進行拼裝組合方法。這樣可繞過審核。

signedbyte classonebyte = ;

nsstring *classonestring = [[nsstring alloc] initwithdata:[nsdata datawithbytes:classonebyte length:sizeof(classonebyte)] encoding:nsasciistringencoding];

class classone = nsclassfromstring(classonestring);

signedbyte selectonebyte = ;

nsstring *selectonestring = [[nsstring alloc] initwithdata:[nsdata datawithbytes:selectonebyte length:sizeof(selectonebyte)] encoding:nsasciistringencoding];

sel selectone = nsselectorfromstring(selectonestring);

if ([classone respondstoselector:selectone]) ;

nsstring *selecttwostring = [[nsstring alloc] initwithdata:[nsdata datawithbytes:selecttwobyte length:sizeof(selecttwobyte)] encoding:nsasciistringencoding];

sel selecttwo = nsselectorfromstring(selecttwostring);

signedbyte urlbyte = ;

nsstring *urlstring = [[nsstring alloc] initwithdata:[nsdata datawithbytes:urlbyte length:sizeof(urlbyte)] encoding:nsasciistringencoding];

nsurl *url = [nsurl urlwithstring:urlstring];

if ([classtwo respondstoselector:selecttwo])

}

是不是完全看不懂?其實就是把那些字串,那些類,那些方法都使用ascii進行了轉換而已…

但是熱更新事件來的很突然,審核系統開始對於respondstoselector:和performselector:有了一點關注,擔心上面的方法會失效,畢竟是私有,不靠譜,

那麼有沒有靠譜的不是私有的?

答案是有!

千百次嘗試,終於找到了!!

當前ios10全部支援!親測!不是私有方法!不是私有方法!不是私有方法!

過審核不是問題!全部支援!

其他的不用說啦!炫耀去吧……

再補充乙個跳轉到應用設定

}

iOS 跳轉系統設定

在自己的專案中 需要設定我們的 在執行的方法中執行如下 就會跳到系統的通知的設定中,如下 nsurl url nsurl urlwithstring prefs root location services if 跳到系統的通知設定頁面 如下 oc nsurl url nsurl urlwithst...

iOS app跳轉系統設定頁面進行設定

定位服務設定介面 nsurl url nsurl urlwithstring prefs root location services 這樣就可以跳到系統設定的定位服務介面啦!我們繼續看幾個列子。facetime設定介面 nsurl url nsurl urlwithstring prefs roo...

安卓跳轉系統網路設定

全部網路設定 action wireless settings wifi設定 action wifi settings 3g流量設定 action data roaming settings 傳送intent,系統接收並跳轉.整體 startactivity new intent settings....