gpt4 book ai didi

macos - 如何在 Mac Qt App 中查找非公共(public) API 的使用情况

转载 作者:行者123 更新时间:2023-12-02 05:18:21 34 4
gpt4 key购买 nike

我们基于 qtwebkit 的应用程序在提交到 mac 应用商店后被苹果拒绝。拒绝的原因之一是使用了非公共(public) API。我已经在 qtwebkit 的源代码中找到了其中的六个。但我无处可寻其余的。我搜索了我们应用程序的源代码和 QT 的整个源代码。

我在qtwebkit源码中找到的六个非公开api是:

CFHTTPCookieStorageSetCookieAcceptPolicy
CFURLCacheCopyResponseForRequest
CFURLResponseGetMIMEType
CFURLResponseCopySuggestedFilename
CFURLCacheSetMemoryCapacity
CFURLCacheSetDiskCapacity

以下是苹果发现的违规行为的完整列表:

The use of non-public APIs can lead to a poor user experience should these APIs change in the future, and is therefore not permitted. The following non-public APIs are included in your application:

NSAccessibilityCreateAXUIElementRef NSAccessibilityHandleFocusChanged NSAccessibilityUnregisterUniqueIdForUIElement NSAppKitPropertyCreator NSCarbonWindowPropertyTag NSMouseMovedNotification _NSDrawCarbonThemeBezel _NSDrawCarbonThemeListBox _NSPopUpCarbonMenu3 _NXShowKeyAndMain from the framework: '/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit'

AXTextMarkerCreate AXTextMarkerGetBytePtr AXTextMarkerGetLength AXTextMarkerGetTypeID AXTextMarkerRangeCopyEndMarker AXTextMarkerRangeCopyStartMarker AXTextMarkerRangeCreate AXTextMarkerRangeGetTypeID CTLineCreateWithUniCharProvider CoreDragGetCurrentDrag CoreDragSetImage from the framework: '/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices'

GetNativeWindowFromWindowRef TSMGetInputSourceProperty from the framework: '/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon'

CFReadStreamSignalEvent _CFAppVersionCheckLessThan _CFBundleSetDefaultLocalization _CFStringGetUserDefaultEncoding from the framework: '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation'

CFHTTPCookieStorageCopyCookiesForURL CFHTTPCookieStorageDeleteCookie CFHTTPCookieStorageGetCookieAcceptPolicy CFHTTPCookieStorageSetCookieAcceptPolicy CFHTTPCookieStorageSetCookies CFURLCacheCopyResponseForRequest CFURLCacheSetDiskCapacity CFURLCacheSetMemoryCapacity CFURLRequestCreateMutableCopy CFURLResponseCopySuggestedFilename CFURLResponseGetExpectedContentLength CFURLResponseGetHTTPResponse CFURLResponseGetMIMEType CFURLResponseGetURL CFURLResponseSetExpectedContentLength CFURLResponseSetMIMEType _CFNetworkHTTPConnectionCacheGetLimit _CFNetworkHTTPConnectionCacheSetLimit _CFURLCacheCopyCacheDirectory _CFURLRequestCreateArchiveList _CFURLRequestCreateFromArchiveList _CFURLResponseCreateArchiveList _CFURLResponseCreateFromArchiveList _CFURLResponseGetSSLCertificateContext _LSGetCurrentApplicationASN _LSSetApplicationInformationItem _kLSDisplayNameKey kCFStreamPropertyCONNECTAdditionalHeaders kCFStreamPropertyCONNECTProxy kCFStreamPropertyCONNECTProxyHost kCFStreamPropertyCONNECTProxyPort kCFStreamPropertyCONNECTResponse kCFURLResponseExpectedContentLengthUnknown from the framework: '/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices'

NSPopAutoreleasePool NSPushAutoreleasePool from the framework: '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation'

CARenderCGDestroy CARenderCGNew CARenderCGRender CARenderNotificationAddObserver CARenderNotificationRemoveObserver CARenderServerGetPort CARenderServerStart CARenderUpdateAddContext CARenderUpdateAddRect CARenderUpdateBegin CARenderUpdateFinish kCAContextPortNumber from the framework: '/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore'

If you have defined methods in your source code with the same names as the above-mentioned APIs, we suggest altering your method names so that they no longer collide with Apple's private APIs to avoid your application being flagged in future submissions.

Additionally, one or more of the above-mentioned APIs may reside in a library included with your application. If you do not have access to the library's source, you may be able to search the compiled binary using "strings" or "otool" command line tools. The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods. These techniques can help you narrow down where the problematic code resides.

最佳答案

我终于追溯到了调用这些所谓的私有(private) api 的位置。它们是从 webkit 内部调用的。 webkit使用的是苹果直接提供的webkit系统接口(interface)库,格式为编译后的静态库+头文件。更具体地说,它们是位于路径 src\3rdparty\webkit\WebKitLibraries 下的四个文件:

libWebKitSystemInterfaceLeopard.a
libWebKitSystemInterfaceLion.a
libWebKitSystemInterfaceMountainLion.a
libWebKitSystemInterfaceSnowLeopard.a

我一直想知道它是否真的是一个私有(private) api,如果没有任何文档,还有谁知道如何调用它?现在原来是苹果本身。由于 nokia 或 digia 都没有这些库的源代码,因此他们可能无能为力。

现在,由于来自创建的库的私有(private) api 访问,任何基于 qtwebkit 的应用程序都会被苹果拒绝,这不是很讽刺吗?

如果我错了或遗漏了什么,请纠正我。我真的希望我错了。

关于macos - 如何在 Mac Qt App 中查找非公共(public) API 的使用情况,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14076518/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com