Weex 应用发布苹果应用商店审核被拒 - 移除 ATSDK 解决

更新日期: 2017-11-10 阅读次数: 12385 分类: weex

收到苹果审核的拒绝邮件,提示说 Weex 应用使用了非公开的 API,IOKit.framework APIs.

Guideline 2.5.1 - Performance - Software Requirements

Your app uses or references the following non-public APIs:

IOKit.framework APIs.

The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change. 

Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.

Next Steps

If you are using third-party libraries, please update to the most recent version of those libraries. If you do not have access to the libraries' source, you may be able to search the compiled binary using the "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 tools can help you narrow down where the problematic code resides. You could also use the "nm" tool to verify if any third-party libraries are calling these APIs.

网上看到其他人也有遇到 Weex 类似的问题,但是调用的 API 更具体:

kIOMasterPortDefault, _IOServiceMatching, _IOServiceGetMatchingService, _IORegistryEntryCreateCFProperties, _IOObjectRelease

排查

在 platforms/ios 目录下

$ grep "IOKit.framework" -r .
Binary file ./Pods/ATSDK/ATSDK.framework/ATSDK matches
Binary file ./Pods/ATSDK/ATSDK.framework/Versions/A/ATSDK matches
Binary file ./Pods/ATSDK/ATSDK.framework/Versions/Current/ATSDK matches

ATSDK 是内部做调试的一个工具,所以去掉之后不会对线上有影响。

$ grep ATManager -r .
Binary file ./Pods/ATSDK/ATSDK.framework/ATSDK matches
./Pods/ATSDK/ATSDK.framework/Headers/ATManager.h://  ATManager.h
./Pods/ATSDK/ATSDK.framework/Headers/ATManager.h:@interface ATManager : NSObject
./Pods/ATSDK/ATSDK.framework/Headers/ATManager.h:+ (ATManager *)shareInstance;
Binary file ./Pods/ATSDK/ATSDK.framework/Versions/A/ATSDK matches
./Pods/ATSDK/ATSDK.framework/Versions/A/Headers/ATManager.h://  ATManager.h
./Pods/ATSDK/ATSDK.framework/Versions/A/Headers/ATManager.h:@interface ATManager : NSObject
./Pods/ATSDK/ATSDK.framework/Versions/A/Headers/ATManager.h:+ (ATManager *)shareInstance;
Binary file ./Pods/ATSDK/ATSDK.framework/Versions/Current/ATSDK matches
./Pods/ATSDK/ATSDK.framework/Versions/Current/Headers/ATManager.h://  ATManager.h
./Pods/ATSDK/ATSDK.framework/Versions/Current/Headers/ATManager.h:@interface ATManager : NSObject
./Pods/ATSDK/ATSDK.framework/Versions/Current/Headers/ATManager.h:+ (ATManager *)shareInstance;
./Pods/Headers/Public/ATSDK/ATSDK/ATManager.h://  ATManager.h
./Pods/Headers/Public/ATSDK/ATSDK/ATManager.h:@interface ATManager : NSObject
./Pods/Headers/Public/ATSDK/ATSDK/ATManager.h:+ (ATManager *)shareInstance;
./WeexDemo/AppDelegate.m:#import <ATSDK/ATManager.h>
./WeexDemo/AppDelegate.m:    [[ATManager shareInstance] addPluginWithId:@"weex" andName:@"weex" andIconName:@"../weex" andEntry:@"" andArgs:@[@""]];
./WeexDemo/AppDelegate.m:    [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"logger" andName:@"logger" andIconName:@"log" andEntry:@"WXATLoggerPlugin" andArgs:@[@""]];
./WeexDemo/AppDelegate.m://    [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"viewHierarchy" andName:@"hierarchy" andIconName:@"log" andEntry:@"WXATViewHierarchyPlugin" andArgs:@[@""]];
./WeexDemo/AppDelegate.m:    [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"test2" andName:@"test" andIconName:@"at_arr_refresh" andEntry:@"" andArgs:@[]];
./WeexDemo/AppDelegate.m:    [[ATManager shareInstance] addSubPluginWithParentId:@"weex" andSubId:@"test3" andName:@"test" andIconName:@"at_arr_refresh" andEntry:@"" andArgs:@[]];

处理流程

  • 注释掉 ./WeexDemo/AppDelegate.m 中的 ATSDK/ATManager 相关代码
  • 删除 ./Pods/ATSDK 目录
  • 删掉 Podfile 中的 ATSDK 项目
  • 打开 XCode,搜索 ATSDK,依次处理掉

重新编译即可

开发环境

$ weex --version
   v1.0.5
 - weex-builder : v0.2.6
 - weex-previewer : v1.3.8
 - weexpack : v0.4.1

参考

  • http://www.jianshu.com/p/93cc9891f8cf
  • https://segmentfault.com/q/1010000011806166

关于作者 🌱

我是来自山东烟台的一名开发者,有敢兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊, 查看更多联系方式