为什么Sierra要求联系人(AddressBook)权限?

时间:2016-10-14 19:22:04

标签: cocoa abaddressbook macos-sierra

当人们使用我的应用程序过渡到Sierra(MacOS 10.12)时,操作系统突然要求他们允许访问他们的联系人。我不知道它为什么要这样做;它在任何以前的操作系统上都没有。

更重要的是,应用程序无法访问联系人;事实上,我根本没有加载ABAddresssBook框架。我搜索了地址和联系人的来源没有结果。 Xcode没有显示"功能"。我唯一使用的第三方框架是Sparkle。 (我静态链接mp4v2库,它对MacOS一无所知。)仅供参考,此应用程序作为已签名的第三方分发,而不是通过App Store分发。它确实有一些嵌入式命令行可执行文件(例如ffmpeg等),同样不是OS X特定的。

我尝试使用调试器来查看触发通知的内容。它显示了一个后台线程,其中一个块执行以获取[ABAddressBook sharedAddressBook],然后启动用户请求,但没有指示是谁启动了该块。

有关其他地方的建议吗?

这里是应用和Sparkle的otool -L库列表。

<<App>>/Contents/MacOS/app
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.4.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57740.1.18)
/System/Library/Frameworks/QTKit.framework/Versions/A/QTKit (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Quartz.framework/Versions/A/Quartz (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 888.1.2)
/System/Library/Frameworks/ScriptingBridge.framework/Versions/A/ScriptingBridge (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
@rpath/Sparkle.framework/Versions/A/Sparkle (compatibility version 1.6.0, current version 1.11.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1349.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1500.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.0.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1070.0.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 775.7.0)
/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore (compatibility version 1.2.0, current version 1.11.0)

<<App>>//Contents/Frameworks/sparkle.framework/Sparkle:
@rpath/Sparkle.framework/Versions/A/Sparkle (compatibility version 1.6.0, current version 1.11.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1391.12.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1229.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/usr/lib/libbz2.1.0.dylib (compatibility version 1.0.0, current version 1.0.5)
/usr/lib/libxar.1.dylib (compatibility version 1.0.0, current version 1.3.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 57324.0.0)
/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration (compatibility version 1.0.0, current version 800.0.0)
/System/Library/Frameworks/WebKit.framework/Versions/A/WebKit (compatibility version 1.0.0, current version 601.1.43)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.0.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1229.11.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 726.4.0)

````

1 个答案:

答案 0 :(得分:1)

原来是Cocoa Lumberjack日志框架。其中一个方法要求所有类查看它们是否已启用日志记录,并执行&#34; class_getClassMethod&#34;记录。如果使用ABAddressBook执行此操作,则会触发用户访问请求。