Skip to content

Commit 1cbfe5f

Browse files
committed
# 5.6.7
- 修复预签名徒步没有透传的bug - 修复swift工程中使用sdk的若干警告 - 修复文件过大,int越界的bug - 支持Read_ACP和Write_ACP枚举 \ - 其他bug修复
1 parent 154ca62 commit 1cbfe5f

File tree

160 files changed

+6782
-255
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+6782
-255
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 5.6.7
2+
- 修复预签名徒步没有透传的bug
3+
- 修复swift工程中使用sdk的若干警告
4+
- 修复文件过大,int越界的bug
5+
- 支持Read_ACP和Write_ACP枚举 \
6+
- 其他bug修复
7+
18
# 5.6.6
29
- 优先级修复
310

QCloudCOSXML.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "QCloudCOSXML"
33

4-
s.version = "5.6.6"
4+
s.version = "5.6.7"
55

66
s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件"
77

@@ -17,7 +17,7 @@ s.version = "5.6.6"
1717
s.default_subspec = 'Default'
1818
s.subspec 'Default' do |default|
1919
default.source_files = 'QCloudCOSXML/Classes/**/*','Models/request.model','QCloudCOSXML/Classes/QCloudCOSXML/*'
20-
default.dependency "QCloudCore",'5.6.6'
20+
default.dependency "QCloudCore",'5.6.7'
2121
end
2222
s.subspec 'Slim' do |slim|
2323
slim.source_files = 'QCloudCOSXML/Classes/**/*','Models/request.model','QCloudCOSXML/Classes/QCloudCOSXML/*'

QCloudCOSXML/Classes/Base/QCloudCOSXMLService+Configuration.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ @implementation QCloudCOSXMLService (Configuration)
3333
- (instancetype) initWithConfiguration:(QCloudServiceConfiguration *)configuration
3434
{
3535
configuration = [configuration copy];
36-
//
37-
configuration.productVersion = @"5.0.0";
38-
configuration.userAgentProductKey = @"cosxml";
39-
//
4036
self = [super initWithConfiguration:configuration];
4137
if (!self) {
4238
return self;

QCloudCOSXML/Classes/Base/QCloudCOSXMLService+Quality.m

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,24 @@
55
// Created by erichmzhang(张恒铭) on 2018/8/23.
66
//
77
#define kQAUploadStrategy @(2)
8-
#define kQAccount @"Iqcloud103800"
8+
#define kQAccount @"I79GMXS2ZR8Y"
99
#import "QCloudCOSXMLService+Quality.h"
1010
#import <objc/runtime.h>
1111

12-
12+
1313
#import <QCloudCore/QCloudCore.h>
1414
#import <QCloudCore/QCloudLogger.h>
1515
#import "QCloudCOSXMLVersion.h"
16+
17+
18+
#define SuppressPerformSelectorLeakWarning(Stuff) \
19+
do { \
20+
_Pragma("clang diagnostic push") \
21+
_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"") \
22+
Stuff; \
23+
_Pragma("clang diagnostic pop") \
24+
} while (0)
25+
1626
@implementation QCloudCOSXMLService (Quality)
1727

1828
+ (void)load {
@@ -44,16 +54,18 @@ + (void) initMTA {
4454
Class cls = NSClassFromString(@"TACMTAConfig");
4555
if (cls) {
4656
QCloudLogDebug(@"Quality assurence service start");
47-
Class config = [cls performSelector:NSSelectorFromString(@"getInstance")];
48-
[config performSelector:NSSelectorFromString(@"setReportStrategy:") withObject:kQAUploadStrategy];
49-
[config performSelector:NSSelectorFromString(@"setCustomerAppVersion:") withObject:QCloudCOSXMLModuleVersion];
50-
Class tacCls = NSClassFromString(@"TACMTA");
51-
if (tacCls) {
52-
[tacCls performSelector:NSSelectorFromString(@"startWithAppkey:") withObject:kQAccount];
53-
}
54-
55-
56-
57+
SuppressPerformSelectorLeakWarning(
58+
Class config = [cls performSelector:NSSelectorFromString(@"getInstance")];
59+
[config performSelector:NSSelectorFromString(@"setReportStrategy:") withObject:kQAUploadStrategy];
60+
[config performSelector:NSSelectorFromString(@"setCustomerAppVersion:") withObject:QCloudCOSXMLModuleVersion];
61+
Class tacCls = NSClassFromString(@"TACMTA");
62+
if (tacCls) {
63+
[tacCls performSelector:NSSelectorFromString(@"startWithAppkey:") withObject:kQAccount];
64+
}
65+
66+
67+
);
68+
5769
}else{
5870
QCloudLogDebug(@"please pod MTA");
5971
}

QCloudCOSXML/Classes/Base/QCloudLogManager.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ -(void)onHandleBeginShowlogs{
179179
if ([currentViewController isKindOfClass:UINavigationController.class]) {
180180
[((UINavigationController *)currentViewController) pushViewController:tableViewController animated:YES];
181181
} else {
182-
[currentViewController presentViewController:tableViewController animated:YES completion:nil];
182+
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:tableViewController];
183+
[currentViewController presentViewController:nav animated:YES completion:nil];
183184
}
184185
}
185186
- (UIViewController *)currentViewController {

QCloudCOSXML/Classes/Base/QCloudService+Quality.m

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,24 @@ + (void)load {
1919

2020
+ (void) changeImplementation {
2121
Class class = [self class];
22-
Method originMethod = class_getInstanceMethod(class, @selector(performRequest:));
23-
Method replacedMethod = class_getInstanceMethod(class, @selector(__quality_performRequest:));
22+
23+
Method originMethod = class_getInstanceMethod(class, @selector(performRequest:isHaveBody:));
24+
Method replacedMethod = class_getInstanceMethod(class, @selector(__quality_performRequest:isHaveBody:));
25+
method_exchangeImplementations(originMethod, replacedMethod);
26+
27+
originMethod = class_getInstanceMethod(class, @selector(performRequest:isHaveBody:withFinishBlock:));
28+
replacedMethod = class_getInstanceMethod(class, @selector(__quality_performRequest:isHaveBody:withFinishBlock:));
2429
method_exchangeImplementations(originMethod, replacedMethod);
2530
}
2631

32+
- (int) __quality_performRequest:(QCloudBizHTTPRequest*)httpRequst isHaveBody:(BOOL)body {
33+
int result = [self __quality_performRequest:httpRequst isHaveBody:body];
34+
[QualityDataUploader trackRequestSentWithType:object_getClass(httpRequst)];
35+
return result;
36+
}
2737

28-
- (int) __quality_performRequest:(QCloudBizHTTPRequest*)httpRequst {
29-
int result = [self __quality_performRequest:httpRequst];
38+
- (int) __quality_performRequest:(QCloudBizHTTPRequest*)httpRequst isHaveBody:(BOOL)body withFinishBlock:(QCloudRequestFinishBlock)block {
39+
int result = [self __quality_performRequest:httpRequst isHaveBody:body withFinishBlock:block];
3040
[QualityDataUploader trackRequestSentWithType:object_getClass(httpRequst)];
3141
return result;
3242
}

QCloudCOSXML/Classes/Base/QualityDataUploader.m

Lines changed: 54 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#import <QCloudCore/QCloudLogger.h>
1010
#import <QCloudCore/NSError+QCloudNetworking.h>
1111

12+
#define AppKey @"I79GMXS2ZR8Y"
13+
1214
static NSString * kRequestSentKey = @"request_sent";
1315
static NSString * kRequestFailKey = @"request_failed";
1416
static NSString * kErrorCodeKey = @"error_code";
@@ -48,7 +50,12 @@ + (NSString*)stringWithClass:(Class)cls {
4850
@implementation QualityDataUploader
4951

5052
NSArray * filterUploadEventClass(){
51-
NSArray *arr = @[@"QCloudPutObjectRequest",@"QCloudInitiateMultipartUploadRequest",@"QCloudUploadPartRequest",@"QCloudCompleteMultipartUploadRequest",@"QCloudAbortMultipfartUploadRequest",@"QCloudGetObjectRequest",@"QCloudListMultipartRequest",@"QCloudAbortMultipfartUploadRequest",@"QCloudPutObjectCopyRequest",@"QCloudUploadPartCopyRequest"];
53+
NSArray *arr = @[@"QCloudHeadObjectRequest",
54+
@"QCloudPutObjectRequest",
55+
@"QCloudUploadPartRequest",
56+
@"QCloudGetObjectRequest",
57+
@"QCloudPutObjectCopyRequest",
58+
@"QCloudUploadPartCopyRequest"];
5259
return arr;
5360
}
5461

@@ -61,15 +68,16 @@ +(BOOL)isNeedQuality:(Class)cls{
6168
return NO;
6269
}
6370

64-
+(NSInteger)internalUploadEvent:(NSString *)eventKey withParamter:(NSDictionary *)paramter {
65-
71+
+(BOOL)isErrorInsterested:(NSError *)error {
72+
return [NSError isNetworkErrorAndRecoverable:error];
73+
}
74+
75+
+(void)internalUploadEvent:(NSString *)eventKey withParamter:(NSDictionary *)paramter {
6676
Class cls = NSClassFromString(@"TACMTA");
6777
if (cls) {
68-
NSInteger result = [[cls performSelector:NSSelectorFromString(@"trackCustomKeyValueEvent:props:") withObject:eventKey withObject:paramter] integerValue];
69-
NSLog(@"test result === %ld",result);
70-
return result;
78+
[self invokeClassMethod:cls sel:NSSelectorFromString(@"trackCustomKeyValueEvent:props:appkey:isRealTime:")
79+
withObjects:@[eventKey, paramter, AppKey, @(NO)]];
7180
}
72-
return 0;
7381
}
7482

7583
+ (void)trackRequestSentWithType:(Class)cls {
@@ -80,15 +88,52 @@ + (void)trackRequestSentWithType:(Class)cls {
8088
}
8189

8290
+ (void)trackRequestFailWithType:(Class)cls Error:(NSError *)error {
83-
if ([self isNeedQuality:cls]) {
91+
if ([self isNeedQuality:cls] && [self isErrorInsterested:error]) {
8492
NSMutableDictionary *parameters = [error.toUploadEventParamters mutableCopy];
8593
parameters[kClassNameKey] = [NSString stringWithClass:cls];
8694
[self internalUploadEvent:kRequestFailKey withParamter:parameters];
8795
}
8896

8997
}
9098

91-
99+
//可以传多个参数的方法
100+
+ (NSInteger)invokeClassMethod:(Class) cls sel:(SEL)selector withObjects:(NSArray *)objects
101+
{
102+
NSInteger returnValue = -1;
103+
104+
// 方法签名
105+
NSMethodSignature *signature = [NSClassFromString(@"TACMTA") methodSignatureForSelector:selector];
106+
if (signature == nil) {
107+
return returnValue;
108+
}
109+
110+
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
111+
if (signature.numberOfArguments < 1) {
112+
return returnValue;
113+
}
114+
115+
invocation.target = cls;
116+
invocation.selector = selector;
117+
118+
// 设置参数
119+
NSInteger paramsCount = signature.numberOfArguments - 2; // 除self、_cmd以外的参数个数
120+
paramsCount = MIN(paramsCount, objects.count);
121+
for (NSInteger i = 0; i < paramsCount; i++) {
122+
id object = objects[i];
123+
if ([object isKindOfClass:[NSNull class]]) continue;
124+
[invocation setArgument:&object atIndex:i + 2];
125+
}
126+
127+
// 调用方法
128+
[invocation invoke];
129+
130+
// 获取返回值
131+
if (signature.methodReturnLength) {
132+
[invocation getReturnValue:&returnValue];
133+
}
134+
135+
return returnValue;
136+
}
92137

93138

94139

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// COSXMLCompressionType.h
3+
// COSXMLCompressionType
4+
//
5+
// Created by tencent
6+
// Copyright (c) 2015年 tencent. All rights reserved.
7+
//
8+
// ██████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗ ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗
9+
// ██╔═══██╗██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██╔══██╗██║ ██║ ██╔══██╗██╔══██╗
10+
// ██║ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║███████║██║ ██║ ███████║██████╔╝
11+
// ██║▄▄ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██╔══██║██║ ██║ ██╔══██║██╔══██╗
12+
// ╚██████╔╝╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║██║ ██║███████╗ ███████╗██║ ██║██████╔╝
13+
// ╚══▀▀═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝ ╚══════╝╚═╝ ╚═╝╚═════╝
14+
//
15+
//
16+
// _ __ _ _
17+
// (_) / _| | | | |
18+
// ___ ___ _ ____ ___ ___ ___ | |_ ___ _ __ __| | _____ _____| | ___ _ __ ___ _ __ ___
19+
// / __|/ _ \ '__\ \ / / |/ __/ _ \ | _/ _ \| '__| / _` |/ _ \ \ / / _ \ |/ _ \| '_ \ / _ \ '__/ __|
20+
// \__ \ __/ | \ V /| | (_| __/ | || (_) | | | (_| | __/\ V / __/ | (_) | |_) | __/ | \__
21+
// |___/\___|_| \_/ |_|\___\___| |_| \___/|_| \__,_|\___| \_/ \___|_|\___/| .__/ \___|_| |___/
22+
// ______ ______ ______ ______ ______ ______ ______ ______ | |
23+
// |______|______|______|______|______|______|______|______| |_|
24+
//
25+
26+
27+
NS_ASSUME_NONNULL_BEGIN
28+
29+
typedef NS_ENUM(NSInteger, QCloudCOSXMLCompressionType) {
30+
31+
QCloudCOSXMLCompressionTypeNONE = 0,
32+
QCloudCOSXMLCompressionTypeGZIP = 1,
33+
QCloudCOSXMLCompressionTypeBZIP2 = 2,
34+
};
35+
36+
FOUNDATION_EXTERN QCloudCOSXMLCompressionType QCloudCOSXMLCompressionTypeDumpFromString(NSString* key);
37+
FOUNDATION_EXTERN NSString* QCloudCOSXMLCompressionTypeTransferToString(QCloudCOSXMLCompressionType type);
38+
NS_ASSUME_NONNULL_END
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//
2+
// COSXMLCompressionType.h
3+
// COSXMLCompressionType
4+
//
5+
// Created by tencent
6+
// Copyright (c) 2015年 tencent. All rights reserved.
7+
//
8+
9+
10+
#import "QCloudCOSXMLCompressionTypeEnum.h"
11+
12+
QCloudCOSXMLCompressionType QCloudCOSXMLCompressionTypeDumpFromString(NSString* key) {
13+
if (NO) {}
14+
else if ([key isEqualToString:@"NONE"]) {
15+
return QCloudCOSXMLCompressionTypeNONE;
16+
}
17+
else if ([key isEqualToString:@"GZIP"]) {
18+
return QCloudCOSXMLCompressionTypeGZIP;
19+
}
20+
else if ([key isEqualToString:@"BZIP2"]) {
21+
return QCloudCOSXMLCompressionTypeBZIP2;
22+
}
23+
return 0;
24+
}
25+
NSString* QCloudCOSXMLCompressionTypeTransferToString(QCloudCOSXMLCompressionType type) {
26+
switch(type) {
27+
case QCloudCOSXMLCompressionTypeNONE:
28+
{
29+
return @"NONE";
30+
}
31+
case QCloudCOSXMLCompressionTypeGZIP:
32+
{
33+
return @"GZIP";
34+
}
35+
case QCloudCOSXMLCompressionTypeBZIP2:
36+
{
37+
return @"BZIP2";
38+
}
39+
default:
40+
return nil;
41+
}
42+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// ExpressionType.h
3+
// ExpressionType
4+
//
5+
// Created by tencent
6+
// Copyright (c) 2015年 tencent. All rights reserved.
7+
//
8+
// ██████╗ ██████╗██╗ ██████╗ ██╗ ██╗██████╗ ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗ █████╗ ██╗ ██╗ █████╗ ██████╗
9+
// ██╔═══██╗██╔════╝██║ ██╔═══██╗██║ ██║██╔══██╗ ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██╔══██╗██║ ██║ ██╔══██╗██╔══██╗
10+
// ██║ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║███████║██║ ██║ ███████║██████╔╝
11+
// ██║▄▄ ██║██║ ██║ ██║ ██║██║ ██║██║ ██║ ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██╔══██║██║ ██║ ██╔══██║██╔══██╗
12+
// ╚██████╔╝╚██████╗███████╗╚██████╔╝╚██████╔╝██████╔╝ ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║██║ ██║███████╗ ███████╗██║ ██║██████╔╝
13+
// ╚══▀▀═╝ ╚═════╝╚══════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝ ╚══════╝╚═╝ ╚═╝╚═════╝
14+
//
15+
//
16+
// _ __ _ _
17+
// (_) / _| | | | |
18+
// ___ ___ _ ____ ___ ___ ___ | |_ ___ _ __ __| | _____ _____| | ___ _ __ ___ _ __ ___
19+
// / __|/ _ \ '__\ \ / / |/ __/ _ \ | _/ _ \| '__| / _` |/ _ \ \ / / _ \ |/ _ \| '_ \ / _ \ '__/ __|
20+
// \__ \ __/ | \ V /| | (_| __/ | || (_) | | | (_| | __/\ V / __/ | (_) | |_) | __/ | \__
21+
// |___/\___|_| \_/ |_|\___\___| |_| \___/|_| \__,_|\___| \_/ \___|_|\___/| .__/ \___|_| |___/
22+
// ______ ______ ______ ______ ______ ______ ______ ______ | |
23+
// |______|______|______|______|______|______|______|______| |_|
24+
//
25+
26+
27+
NS_ASSUME_NONNULL_BEGIN
28+
29+
typedef NS_ENUM(NSInteger, QCloudExpressionType) {
30+
31+
QCloudExpressionTypeSQL = 0,
32+
};
33+
34+
FOUNDATION_EXTERN QCloudExpressionType QCloudExpressionTypeDumpFromString(NSString* key);
35+
FOUNDATION_EXTERN NSString* QCloudExpressionTypeTransferToString(QCloudExpressionType type);
36+
NS_ASSUME_NONNULL_END

0 commit comments

Comments
 (0)