Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
language: objective-c
before_install: true
#- brew update
#- brew upgrade xctool
#- gem install cocoapods
before_install:
- rvm install 2.3.1
- rvm use 2.3.1
- brew update
- brew outdated xctool || brew upgrade xctool
- gem install cocoapods --pre
- pod --version
- pod repo remove master
- pod setup
- pod install --verbose --no-repo-update
before_script:
- export QINIU_TEST_ENV="travis"
script:
- xctool -workspace QiniuSDK.xcworkspace -scheme "QiniuSDK iOS" -sdk iphonesimulator -configuration Release test -test-sdk iphonesimulator7.0 -freshInstall -freshSimulator
- xctool -workspace QiniuSDK.xcworkspace -scheme "QiniuSDK Mac" -sdk macosx -configuration Release test -test-sdk macosx
- xctool -workspace QiniuSDK.xcworkspace -scheme QiniuSDK_iOS -sdk iphonesimulator -configuration Release test -test-sdk iphonesimulator7.0 -freshInstall -freshSimulator
- xctool -workspace QiniuSDK.xcworkspace -scheme QiniuSDK_Mac -sdk macosx -configuration Release test -test-sdk macosx
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#Changelog

## 7.0.20 (2016-05-30)

### 修正
* iOS8 ipv6 问题
* 为ipv6兼容,happydns 指定为 0.3以上

## 7.0.19 (2016-05-23)

### 修正
Expand Down
29 changes: 19 additions & 10 deletions Podfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
source 'https://github.com/CocoaPods/Specs.git'

target "QiniuSDK iOS" do
def shared_dependencies
pod "AFNetworking", "~> 2.5.0"
pod "HappyDNS", ">= 0.3"
end

def test_dependencies
pod "AGAsyncTestHelper/Shorthand"
end

target "QiniuSDK_iOS" do
platform :ios, "6.0"
pod 'AFNetworking', '~> 2.5.0'
pod 'HappyDNS', '>= 0.2'
shared_dependencies
end

target "QiniuSDK iOSTests" do
target "QiniuSDK_iOSTests" do
platform :ios, "6.0"
pod 'AGAsyncTestHelper/Shorthand'
shared_dependencies
test_dependencies
end

target "QiniuSDK Mac" do
target "QiniuSDK_Mac" do
platform :osx, "10.8"
pod 'AFNetworking', '~> 2.5.0'
pod 'HappyDNS', '>= 0.2'
shared_dependencies
end

target "QiniuSDK MacTests" do
target "QiniuSDK_MacTests" do
platform :osx, "10.8"
pod 'AGAsyncTestHelper/Shorthand'
shared_dependencies
test_dependencies
end
4 changes: 2 additions & 2 deletions Qiniu.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Qiniu'
s.version = "7.0.19.1"
s.version = "7.0.20"
s.summary = "Qiniu Resource Storage SDK for iOS and Mac"
s.homepage = "https://github.com/qiniu/objc-sdk"
s.social_media_url = "http://weibo.com/qiniutek"
Expand All @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.libraries = "z"
s.dependency "AFNetworking", "~> 2.0"
s.dependency "HappyDNS", "~> 0.2"
s.dependency "HappyDNS", "~> 0.3"
s.license = { :type => "MIT", :text => <<-LICENSE
The MIT License (MIT)

Expand Down
454 changes: 201 additions & 253 deletions QiniuSDK.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -15,57 +15,60 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDDFE19DAC05500CE01FB"
BuildableName = "libQiniuSDK Mac.dylib"
BlueprintName = "QiniuSDK Mac"
BuildableName = "QiniuSDK_Mac.dylib"
BlueprintName = "QiniuSDK_Mac"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDE0919DAC05500CE01FB"
BuildableName = "QiniuSDK MacTests.xctest"
BlueprintName = "QiniuSDK MacTests"
BuildableName = "QiniuSDK_MacTests.xctest"
BlueprintName = "QiniuSDK_MacTests"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDDFE19DAC05500CE01FB"
BuildableName = "libQiniuSDK Mac.dylib"
BlueprintName = "QiniuSDK Mac"
BuildableName = "QiniuSDK_Mac.dylib"
BlueprintName = "QiniuSDK_Mac"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "0730"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -15,26 +15,26 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDE1919DAC08400CE01FB"
BuildableName = "libQiniuSDK iOS.a"
BlueprintName = "QiniuSDK iOS"
BuildableName = "libQiniuSDK_iOS.a"
BlueprintName = "QiniuSDK_iOS"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDE2319DAC08400CE01FB"
BuildableName = "QiniuSDK iOSTests.xctest"
BlueprintName = "QiniuSDK iOSTests"
BuildableName = "QiniuSDK_iOSTests.xctest"
BlueprintName = "QiniuSDK_iOSTests"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</TestableReference>
Expand All @@ -43,45 +43,48 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDE1919DAC08400CE01FB"
BuildableName = "libQiniuSDK iOS.a"
BlueprintName = "QiniuSDK iOS"
BuildableName = "libQiniuSDK_iOS.a"
BlueprintName = "QiniuSDK_iOS"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDE1919DAC08400CE01FB"
BuildableName = "libQiniuSDK iOS.a"
BlueprintName = "QiniuSDK iOS"
BuildableName = "libQiniuSDK_iOS.a"
BlueprintName = "QiniuSDK_iOS"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DF2CDE1919DAC08400CE01FB"
BuildableName = "libQiniuSDK iOS.a"
BlueprintName = "QiniuSDK iOS"
BuildableName = "libQiniuSDK_iOS.a"
BlueprintName = "QiniuSDK_iOS"
ReferencedContainer = "container:QiniuSDK.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand Down
3 changes: 1 addition & 2 deletions QiniuSDK/Common/QNSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ BOOL hasAts();

BOOL allowsArbitraryLoads();

//iOS8判断
BOOL isIOS8();
BOOL isIpV6FullySupported();

#endif /* QNSystem_h */
26 changes: 18 additions & 8 deletions QiniuSDK/Common/QNSystem.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ BOOL hasNSURLSession() {
}
#else
NSOperatingSystemVersion sysVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
if ((sysVersion.majorVersion <= 10 && sysVersion.minorVersion < 9)) {
if (sysVersion.majorVersion < 10) {
return NO;
} else if (sysVersion.majorVersion == 10) {
return sysVersion.minorVersion >= 9;
}
#endif
return YES;
Expand All @@ -38,9 +40,10 @@ BOOL hasAts() {
}
#else
NSOperatingSystemVersion sysVersion = [[NSProcessInfo processInfo] operatingSystemVersion];

if ((sysVersion.majorVersion <= 10 && sysVersion.minorVersion < 11)) {
if (sysVersion.majorVersion < 10) {
return NO;
} else if (sysVersion.majorVersion == 10) {
return sysVersion.minorVersion >= 11;
}
#endif
return YES;
Expand Down Expand Up @@ -68,12 +71,19 @@ BOOL allowsArbitraryLoads() {
return ats.boolValue;
}

BOOL isIOS8() {
BOOL isIpV6FullySupported() {
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED)
float sysVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
if ((sysVersion >= 8.0) && sysVersion < 9.0) {
return YES;
if (sysVersion < 9.0) {
return NO;
}
#else
NSOperatingSystemVersion sysVersion = [[NSProcessInfo processInfo] operatingSystemVersion];
if (sysVersion.majorVersion < 10) {
return NO;
} else if (sysVersion.majorVersion == 10) {
return sysVersion.minorVersion >= 11;
}
#endif
return NO;
}
return YES;
}
3 changes: 2 additions & 1 deletion QiniuSDK/Http/QNHttpManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#import "QNConfiguration.h"
#import "QNHttpManager.h"
#import "QNResponseInfo.h"
#include "QNSystem.h"
#import "QNUserAgent.h"

@interface QNHttpManager ()
Expand Down Expand Up @@ -176,7 +177,7 @@ - (void)sendRequest:(NSMutableURLRequest *)request
url = [[NSURL alloc] initWithString:_converter(u)];
request.URL = url;
domain = url.host;
} else if (_dns != nil && [url.scheme isEqual:@"http"]) {
} else if (_dns != nil && [url.scheme isEqual:@"http"] && !(isIpV6FullySupported() && [QNIP isV6])) {
ips = [_dns queryWithDomain:[[QNDomain alloc] init:domain hostsFirst:NO hasCname:YES maxTtl:1000]];
double duration = [[NSDate date] timeIntervalSinceDate:startTime];
if (ips == nil || ips.count == 0) {
Expand Down
4 changes: 2 additions & 2 deletions QiniuSDK/Http/QNSessionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#import "QNConfiguration.h"
#import "QNResponseInfo.h"
#import "QNSessionManager.h"
#import "QNSystem.h"
#include "QNSystem.h"
#import "QNUserAgent.h"

#if (defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000) || (defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090)
Expand Down Expand Up @@ -163,7 +163,7 @@ - (void)sendRequest:(NSMutableURLRequest *)request
url = [[NSURL alloc] initWithString:_converter(u)];
request.URL = url;
domain = url.host;
} else if (_noProxy && _dns != nil && [url.scheme isEqualToString:@"http"]) {
} else if (_noProxy && _dns != nil && [url.scheme isEqualToString:@"http"] && !(isIpV6FullySupported() && [QNIP isV6])) {
ips = [_dns queryWithDomain:[[QNDomain alloc] init:domain hostsFirst:NO hasCname:YES maxTtl:1000]];
double duration = [[NSDate date] timeIntervalSinceDate:startTime];

Expand Down
2 changes: 1 addition & 1 deletion QiniuSDK/Storage/QNConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ - (instancetype)init {
_proxy = nil;
_converter = nil;

if (hasAts() && !allowsArbitraryLoads() && isIOS8()) {
if (hasAts() && !allowsArbitraryLoads()) {
_disableATS = NO;
} else {
_disableATS = YES;
Expand Down
Loading