ios NSExtension -运行时警告- [NSXPCDecoder验证允许的类:对于密钥:]

mutmk8jj  于 2023-01-27  发布在  iOS
关注(0)|答案(2)|浏览(497)

我正在使用共享扩展,收到以下运行时警告:
注意:即使在新项目上添加共享扩展并运行,也会抛出相同的运行时警告

  1. [Foundation] *** -[NSXPCDecoder validateAllowedClass:forKey:]: NSSecureCoding allowed classes list contains [NSObject class], which bypasses security by allowing any Objective-C class to be implicitly decoded. Consider reducing the scope of allowed classes during decoding by listing only the classes you expect to decode, or a more specific base class than NSObject. This will become an error in the future. Allowed class list: {(
  2. "'NSObject' (0x7fff862bc6e8) [/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib]"
  3. )}

下面给出的是扩展模块的信息列表

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  3. <plist version="1.0">
  4. <dict>
  5. <key>NSExtension</key>
  6. <dict>
  7. <key>NSExtensionAttributes</key>
  8. <dict>
  9. <key>NSExtensionActivationRule</key>
  10. <dict>
  11. <key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
  12. <integer>1</integer>
  13. </dict>
  14. </dict>
  15. <key>NSExtensionMainStoryboard</key>
  16. <string>MainInterface</string>
  17. <key>NSExtensionPointIdentifier</key>
  18. <string>com.apple.share-services</string>
  19. </dict>
  20. </dict>
  21. </plist>

问题:

  • 我应该怎么做才能修复此警告?
nqwrtyyt

nqwrtyyt1#

结论:

  • 我得到了苹果的官方确认,这是他们在使用共享功能时的一个错误
  • 我已经提交了一个错误报告,并告诉他们关于反馈ID。
  • 我被告知,只要我没有看到我的应用程序有任何问题,我就可以忽略这个错误。

备注:

作为新的操作系统,Xcode已经发布,最好提出一个bug并与Apple DTS进行检查以确认这一点

8zzbczxx

8zzbczxx2#

只需在IOS16.1和Xcode 14上遇到这个问题。
如果这仍然是一个bug,有谁能证实这一点吗?有什么方法可以抑制警告?

相关问题