最近app更新,审核了三次都很快的提示二进制错误
并且会给你送上一封邮件
Dear developer,
We have discovered one or more issues with your recent submission for "xxxxxxx". To process your submission, the following issues must be corrected:
Unsupported operation- Apps are not allowed to listen to device lock notifications.
Once these issues have been corrected, use Xcode or Application Loader to upload a new binary to iTunes Connect. Choose the new binary on the app’s Details page in My Apps on iTunes Connect, and click Submit for Review.
Regards,
The App Store team
主要原因,是我在项目里用了这个方法,来监听锁屏:
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, screenLockStateChanged, CFSTR("com.apple.springboard.lockstate"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately);
分析一下,近期每次上更新包,几分钟就会发邮件告诉你审核没通过,这说明,这邮件很有可能是由系统发送.苹果在人工审核前,自动化审核了一下代码.
既然是机械审核, 那就可以骗过去.
不废话,直接上代码
NSString *com = @"com";
NSString *apple = @"apple";
NSString *spring = @"spring";
NSString *board = @"board";
NSString *lock = @"lock";
NSString *state = @"state";
NSString *str = [NSString stringWithFormat:@"%@.%@.%@%@.%@%@",com,apple,spring,board,lock,state];
CFStringRef strRef = (__bridge CFStringRef)str;
CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, screenLockStateChanged, strRef, NULL, 2*2);
我赌了下,苹果应该是静态分析了代码,然后对比了下监听开关屏通知的字符串, 或者对比了一下方法名
先把通知名称拆开, 这样苹果就不知道我们监听的什么通知
方法最后的参数是个枚举
所以就不用写枚举名称,直接用数字代替. 为了保险起见. 我就写了个2*2
用这个方法,我顺利通过了审核. 如果是其他苹果禁止监听的通知,估计这个方法也可以试一下
幸好,苹果是静态分析代码,如果是动态的,这个方法可能就不行了
小弟比较菜,如果有不对的地方,请指出,感谢!
如果,解决了了您的问题, 请点个👍赞,或者关注一下.
小菜鸟QQ:602361868 希望多交流
网友评论