當前位置:編程學習大全網 - 源碼下載 - iOS15下canOpenUrl異常問題思考

iOS15下canOpenUrl異常問題思考

case現象:

原包app:iOS15.4-正常,iOS14.5-正常

打sdk包:iOS15.4-異常,iOS14.5(越獄/normal)-正常,15.3.1-異常

空sdk-iOS15.4-異常,iOS14.5-正常

Demo-iOS15.4-正常

報錯信息: -canOpenURL: failed for URL: "weixin://" - error: "This app is not allowed to query for scheme weixin"

比較差異點:

原包-rs:iOS15.4-正常

空sdk:iOS15.4-異常

Info.plist有差異

原因:原包LSApplicationQueriesSchemes是50個,sdk化後新加了個url,超過50個(cmd+shift+0可查看官方文檔canOpenURL:),該scheme url在列表裏面位置超過50就會報錯。

If your app is linked against an earlier version of iOS but is running in iOS 9.0 or later, you can call this method up to 50 times. After reaching that limit, subsequent calls always return NO. If the user reinstalls or upgrades the app, iOS resets the limit.

1、下斷點

2、查找庫的位置

3、查看源碼

用hopper打開CoreService源碼,搜索_LSCanOpenURLManager查看,有如下方法

1、有異常先找差異點,逐個對比

2、新特性怎麽提前預知,先去看官方文檔(cmd+shift+0)

3、借助hopper分析底層源碼

iOSDeviceSupport列表

iOSDeviceSupport路徑: /Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

解決Github訪問不了

真機源碼路徑:

~/Library/Developer/Xcode/iOS DeviceSupport/15.5 (19F77)/Symbols/System/Library/Frameworks/CoreServices.framework

LLDB調試利器及高級用法-2個lldb插件

  • 上一篇:太祖完顏阿骨打
  • 下一篇:服務器藍屏是怎麽回事?從小白問問題很容易。
  • copyright 2024編程學習大全網