经验之谈:
1.人员审核IP
17.200.11.44
144.178.28.139
2.机器审核IP
144.178.28.142
17.199.223.50
17.199.223.53
...
3.苹果IP段
17.0.0.0 ~ 17.255.255.255
63.92.224.0 ~ 63.92.255.255
65.199.22.0 ~ 65.199.23.255
192.12.74.0 ~ 192.12.74.255
192.42.249.0 ~ 192.42.249.255
204.79.190.0 ~ 204.79.190.255
144.178.0.0 ~ 144.178.63.255
4.访问 http://whatismyip.akamai.com 获取访问IP
5.检测是否是苹果IP
导入 #include <arpa/inet.h>
//检测是否是苹果IP
+ (BOOL)G9X_isAppleIp_A8P:(NSString *)ipStr
{
if (ipStr == nil || [ipStr isEqualToString:@""]) {
return NO;
}
uint32_t intIp = [self G9X_ipTwoLong_A8P:ipStr];
if (intIp != 0) {
if ((intIp >= 285212672 && intIp <= 301989887) || //17.0.0.0 ~ 17.255.255.255
(intIp >= 1063051264 && intIp <= 1063059455) || //63.92.224.0 ~ 63.92.255.255
(intIp >= 1103566336 && intIp <= 1103566847) || //65.199.22.0 ~ 65.199.23.255
(intIp >= 3222030848 && intIp <= 3222031103) || //192.12.74.0 ~ 192.12.74.255
(intIp >= 3224041728 && intIp <= 3224041983) || //192.42.249.0 ~ 192.42.249.255
(intIp >= 3427778048 && intIp <= 3427778303) || //204.79.190.0 ~ 204.79.190.255
(intIp >= 2427584512 && intIp <= 2427600895)) //144.178.0.0 ~ 144.178.63.255
{
NSLog(@"苹果IP:%u",intIp);
//--//G9X_InvokeMethod_A8P
return true;
}
}
return NO;
}
+ (uint32_t)G9X_ipTwoLong_A8P:(NSString *)ipStr
{
NSString *addrString = ipStr;
struct in_addr addr;
if (inet_aton([addrString UTF8String], &addr) != 0) {
uint32_t ip = ntohl(addr.s_addr);
// NSLog(@"%u", ip);
return ip;
} else {
//--//G9X_InvokeMethod_A8P
NSLog(@"invalid address");
return 0;
}
}