为什么 Sierra 要求联系人(地址簿)许可?

Why is Sierra asking for Contacts (AddressBook) permission?

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

更重要的是,应用程序没有任何地方访问联系人;事实上,我根本没有加载 ABAddresssBook 框架。我已经搜索了地址和联系人的来源,但没有结果。 Xcode 显示没有 "Capabilities"。我使用的唯一第三方框架是 Sparkle。 (我静态 link 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)

````

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