带阿里标识的版本

This commit is contained in:
robin
2026-02-28 18:55:33 +08:00
parent 150799f41d
commit 5d0b7c7e91
477 changed files with 10813 additions and 4044 deletions

View File

@@ -44,12 +44,12 @@ static HttpDnsService *httpdnsSharedStubInstance;
@property (nonatomic, copy) NSString *aesSecretKey;
@property (nonatomic, assign) BOOL hasConfiguredAccount;
// 访SDK10
// 访SDK10<EFBFBD><EFBFBD>?
@property (nonatomic, assign) NSUInteger authTimeoutInterval;
@property (nonatomic, copy) NSDictionary<NSString *, NSString *> *presetSdnsParamsDict;
// scheduleCenter HttpdnsService_Internal.h
// scheduleCenter HttpdnsService_Internal.h <EFBFBD><EFBFBD>?
@end
@@ -58,9 +58,9 @@ static HttpDnsService *httpdnsSharedStubInstance;
+ (void)initialize {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
asyncTaskConcurrentQueue = dispatch_queue_create("com.alibaba.sdk.httpdns.asyncTask", DISPATCH_QUEUE_CONCURRENT);
asyncTaskConcurrentQueue = dispatch_queue_create("com.Trust.sdk.httpdns.asyncTask", DISPATCH_QUEUE_CONCURRENT);
httpdnsServiceInstances = [NSMutableDictionary dictionary];
httpdnsServiceInstancesQueue = dispatch_queue_create("com.alibaba.sdk.httpdns.serviceRegistry", DISPATCH_QUEUE_SERIAL);
httpdnsServiceInstancesQueue = dispatch_queue_create("com.Trust.sdk.httpdns.serviceRegistry", DISPATCH_QUEUE_SERIAL);
});
}
@@ -168,7 +168,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
self.requestManager = [[HttpdnsRequestManager alloc] initWithAccountId:accountID ownerService:self];
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
NSString *regionKey = [NSString stringWithFormat:@"%@.%ld", kAlicloudHttpdnsRegionKey, (long)accountID];
NSString *regionKey = [NSString stringWithFormat:@"%@.%ld", kTrustHttpdnsRegionKey, (long)accountID];
NSString *cachedRegion = [userDefault objectForKey:regionKey];
HttpdnsScheduleCenter *scheduleCenter = [[HttpdnsScheduleCenter alloc] initWithAccountId:accountID];
@@ -235,7 +235,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
- (void)setRegion:(NSString *)region {
if ([HttpdnsUtil isEmptyString:region]) {
region = ALICLOUD_HTTPDNS_DEFAULT_REGION_KEY;
region = Trust_HTTPDNS_DEFAULT_REGION_KEY;
}
if (![[HttpdnsRegionConfigLoader getAvailableRegionList] containsObject:region]) {
@@ -244,7 +244,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
}
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
NSString *regionKey = [NSString stringWithFormat:@"%@.%ld", kAlicloudHttpdnsRegionKey, (long)self.accountID];
NSString *regionKey = [NSString stringWithFormat:@"%@.%ld", kTrustHttpdnsRegionKey, (long)self.accountID];
NSString *oldRegion = [userDefault objectForKey:regionKey];
if (![region isEqualToString:oldRegion]) {
[userDefault setObject:region forKey:regionKey];
@@ -262,16 +262,16 @@ static HttpDnsService *httpdnsSharedStubInstance;
}
- (void)setPreResolveHosts:(NSArray *)hosts queryIPType:(AlicloudHttpDNS_IPType)ipType {
- (void)setPreResolveHosts:(NSArray *)hosts queryIPType:(TrustHttpDNS_IPType)ipType {
HttpdnsQueryIPType ipQueryType;
switch (ipType) {
case AlicloudHttpDNS_IPTypeV4:
case TrustHttpDNS_IPTypeV4:
ipQueryType = HttpdnsQueryIPTypeIpv4;
break;
case AlicloudHttpDNS_IPTypeV6:
case TrustHttpDNS_IPTypeV6:
ipQueryType = HttpdnsQueryIPTypeIpv6;
break;
case AlicloudHttpDNS_IPTypeV64:
case TrustHttpDNS_IPTypeV64:
ipQueryType = HttpdnsQueryIPTypeIpv4 | HttpdnsQueryIPTypeIpv6;
break;
default:
@@ -284,7 +284,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
- (void)setPreResolveHosts:(NSArray *)hosts byIPType:(HttpdnsQueryIPType)ipType {
// regionregion
// sdk0.5
// sdk<EFBFBD><EFBFBD>?.5
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), asyncTaskConcurrentQueue, ^{
[self->_requestManager preResolveHosts:hosts queryType:ipType];
});
@@ -320,20 +320,20 @@ static HttpDnsService *httpdnsSharedStubInstance;
}
- (void)setIPv6Enabled:(BOOL)enable {
//
// <EFBFBD><EFBFBD>?
}
- (void)enableNetworkInfo:(BOOL)enable {
//
// <EFBFBD><EFBFBD>?
}
- (void)setReadNetworkInfoEnabled:(BOOL)enable {
//
// <EFBFBD><EFBFBD>?
}
- (void)enableCustomIPRank:(BOOL)enable {
//
// IPIPRankingDatasourceIPRankingDatasourcehostIP
// <EFBFBD><EFBFBD>?
// IPIPRankingDatasourceIPRankingDatasourcehostIP<EFBFBD><EFBFBD>?
}
- (NSString *)getSessionId {
@@ -357,7 +357,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
- (nullable HttpdnsResult *)resolveHostSync:(HttpdnsRequest *)request {
if ([NSThread isMainThread]) {
// 线
// 线<EFBFBD><EFBFBD>?
return [self resolveHostSyncNonBlocking:request];
}
@@ -456,7 +456,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
if (specifiedQueryIpType == HttpdnsQueryIPTypeAuto) {
HttpdnsIPStackType stackType = [[HttpdnsIpStackDetector sharedInstance] currentIpStack];
switch (stackType) {
// ipv6only
// ipv6only<EFBFBD><EFBFBD>?
// ipv6onlyipv4
// typeipv6
case kHttpdnsIpDual:
@@ -470,7 +470,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
}
}
//
// <EFBFBD><EFBFBD>?
return specifiedQueryIpType;
}
@@ -681,7 +681,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
}
//线线
if ([NSThread isMainThread]) {
//线使
//线使<EFBFBD><EFBFBD>?
HttpdnsRequest *request = [[HttpdnsRequest alloc] initWithHost:host queryIpType:HttpdnsQueryIPTypeIpv4];
[self attachAccountInfoToRequest:request];
[request becomeNonBlockingRequest];
@@ -839,7 +839,7 @@ static HttpDnsService *httpdnsSharedStubInstance;
}
if ([NSThread isMainThread]) {
// 线使
// 线使<EFBFBD><EFBFBD>?
HttpdnsRequest *request = [[HttpdnsRequest alloc] initWithHost:host queryIpType:HttpdnsQueryIPTypeIpv6];
[self attachAccountInfoToRequest:request];
[request becomeNonBlockingRequest];
@@ -888,9 +888,9 @@ static HttpDnsService *httpdnsSharedStubInstance;
if ([HttpdnsUtil isAnIP:host]) {
HttpdnsLogDebug("The host is just an IP: %@", host);
if ([HttpdnsUtil isIPv4Address:host]) {
return @{ALICLOUDHDNS_IPV4: @[host?:@""]};
return @{TrustHDNS_IPV4: @[host?:@""]};
} else if ([HttpdnsUtil isIPv6Address:host]) {
return @{ALICLOUDHDNS_IPV6: @[host?:@""]};
return @{TrustHDNS_IPV6: @[host?:@""]};
}
return nil;
}
@@ -909,10 +909,10 @@ static HttpDnsService *httpdnsSharedStubInstance;
NSArray *ip6s = [hostObject getV6IpStrings];
NSMutableDictionary *resultMDic = [NSMutableDictionary dictionary];
if ([HttpdnsUtil isNotEmptyArray:ip4s]) {
[resultMDic setObject:ip4s forKey:ALICLOUDHDNS_IPV4];
[resultMDic setObject:ip4s forKey:TrustHDNS_IPV4];
}
if ([HttpdnsUtil isNotEmptyArray:ip6s]) {
[resultMDic setObject:ip6s forKey:ALICLOUDHDNS_IPV6];
[resultMDic setObject:ip6s forKey:TrustHDNS_IPV6];
}
NSLog(@"getIPv4_v6ByHostAsync result is %@", resultMDic);
return resultMDic;
@@ -935,9 +935,9 @@ static HttpDnsService *httpdnsSharedStubInstance;
if ([HttpdnsUtil isAnIP:host]) {
HttpdnsLogDebug("The host is just an IP: %@", host);
if ([HttpdnsUtil isIPv4Address:host]) {
return @{ALICLOUDHDNS_IPV4: @[host?:@""]};
return @{TrustHDNS_IPV4: @[host?:@""]};
} else if ([HttpdnsUtil isIPv6Address:host]) {
return @{ALICLOUDHDNS_IPV6: @[host?:@""]};
return @{TrustHDNS_IPV6: @[host?:@""]};
}
return nil;
}
@@ -957,10 +957,10 @@ static HttpDnsService *httpdnsSharedStubInstance;
NSMutableDictionary *httpdnsResult = [NSMutableDictionary dictionary];
NSLog(@"getHttpDnsResultHostAsync result is %@", httpdnsResult);
if ([HttpdnsUtil isNotEmptyArray:ip4s]) {
[httpdnsResult setObject:ip4s forKey:ALICLOUDHDNS_IPV4];
[httpdnsResult setObject:ip4s forKey:TrustHDNS_IPV4];
}
if ([HttpdnsUtil isNotEmptyArray:ip6s]) {
[httpdnsResult setObject:ip6s forKey:ALICLOUDHDNS_IPV6];
[httpdnsResult setObject:ip6s forKey:TrustHDNS_IPV6];
}
return httpdnsResult;
}
@@ -981,9 +981,9 @@ static HttpDnsService *httpdnsSharedStubInstance;
if ([HttpdnsUtil isAnIP:host]) {
HttpdnsLogDebug("The host is just an IP: %@", host);
if ([HttpdnsUtil isIPv4Address:host]) {
return @{ALICLOUDHDNS_IPV4: @[host?:@""]};
return @{TrustHDNS_IPV4: @[host?:@""]};
} else if ([HttpdnsUtil isIPv6Address:host]) {
return @{ALICLOUDHDNS_IPV6: @[host?:@""]};
return @{TrustHDNS_IPV6: @[host?:@""]};
}
return nil;
}
@@ -1005,10 +1005,10 @@ static HttpDnsService *httpdnsSharedStubInstance;
NSMutableDictionary *resultMDic = [NSMutableDictionary dictionary];
NSLog(@"getIPv4_v6ByHostAsync result is %@", resultMDic);
if ([HttpdnsUtil isNotEmptyArray:ip4s]) {
[resultMDic setObject:ip4s forKey:ALICLOUDHDNS_IPV4];
[resultMDic setObject:ip4s forKey:TrustHDNS_IPV4];
}
if ([HttpdnsUtil isNotEmptyArray:ip6s]) {
[resultMDic setObject:ip6s forKey:ALICLOUDHDNS_IPV6];
[resultMDic setObject:ip6s forKey:TrustHDNS_IPV6];
}
return resultMDic;
}
@@ -1026,10 +1026,10 @@ static HttpDnsService *httpdnsSharedStubInstance;
NSArray *ip6s = [hostObject getV6IpStrings];
resultMDic = [NSMutableDictionary dictionary];
if ([HttpdnsUtil isNotEmptyArray:ip4s]) {
[resultMDic setObject:ip4s forKey:ALICLOUDHDNS_IPV4];
[resultMDic setObject:ip4s forKey:TrustHDNS_IPV4];
}
if ([HttpdnsUtil isNotEmptyArray:ip6s]) {
[resultMDic setObject:ip6s forKey:ALICLOUDHDNS_IPV6];
[resultMDic setObject:ip6s forKey:TrustHDNS_IPV6];
}
NSLog(@"###### getHttpDnsResultHostSync result is %@", resultMDic);
}
@@ -1045,12 +1045,12 @@ static HttpDnsService *httpdnsSharedStubInstance;
} else if (stackType == kHttpdnsIpv4Only) {
NSArray* ipv4Ips = [self getIpsByHostAsync:host];
if (ipv4Ips != nil) {
[ipv4_ipv6 setObject:ipv4Ips forKey:ALICLOUDHDNS_IPV4];
[ipv4_ipv6 setObject:ipv4Ips forKey:TrustHDNS_IPV4];
}
} else if (stackType == kHttpdnsIpv6Only) {
NSArray* ipv6Ips = [self getIPv6sByHostAsync:host];
if (ipv6Ips != nil) {
[ipv4_ipv6 setObject:ipv6Ips forKey:ALICLOUDHDNS_IPV6];
[ipv4_ipv6 setObject:ipv6Ips forKey:TrustHDNS_IPV6];
}
}
@@ -1065,12 +1065,12 @@ static HttpDnsService *httpdnsSharedStubInstance;
} else if (stackType == kHttpdnsIpv4Only) {
NSArray* ipv4IpList = [self getIPv4ListForHostAsync:host];
if (ipv4IpList) {
[httpdnsResult setObject:ipv4IpList forKey:ALICLOUDHDNS_IPV4];
[httpdnsResult setObject:ipv4IpList forKey:TrustHDNS_IPV4];
}
} else if (stackType == kHttpdnsIpv6Only) {
NSArray* ipv6List = [self getIPv6ListForHostAsync:host];
if (ipv6List) {
[httpdnsResult setObject:ipv6List forKey:ALICLOUDHDNS_IPV6];
[httpdnsResult setObject:ipv6List forKey:TrustHDNS_IPV6];
}
}
@@ -1083,14 +1083,14 @@ static HttpDnsService *httpdnsSharedStubInstance;
if (stackType == kHttpdnsIpv4Only) {
NSArray* ipv4IpList = [self getIPv4ListForHostSync:host];
if (ipv4IpList) {
[httpdnsResult setObject:ipv4IpList forKey:ALICLOUDHDNS_IPV4];
[httpdnsResult setObject:ipv4IpList forKey:TrustHDNS_IPV4];
}
} else if (stackType == kHttpdnsIpDual) {
httpdnsResult = [[self getHttpDnsResultHostSync:host] mutableCopy];
} else if (stackType == kHttpdnsIpv6Only) {
NSArray* ipv6List = [self getIPv6ListForHostSync:host];
if (ipv6List) {
[httpdnsResult setObject:ipv6List forKey:ALICLOUDHDNS_IPV6];
[httpdnsResult setObject:ipv6List forKey:TrustHDNS_IPV6];
}
}
return httpdnsResult;