Skip to content

Commit 0d87b39

Browse files
author
jordanqin
committed
update qcloud sdk to 5.5.8
1 parent 0040b02 commit 0d87b39

File tree

16 files changed

+46
-322
lines changed

16 files changed

+46
-322
lines changed

QCloudCosXml/cosext/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ android {
2929
minSdkVersion 19
3030
targetSdkVersion 28
3131
versionCode sdkVersionCode
32-
versionName "5.5.7"
32+
versionName "5.5.8"
3333

3434
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3535

QCloudCosXml/cosxml-ktx/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
defaultConfig {
99
minSdkVersion 15
1010
targetSdkVersion 29
11-
versionCode 50507
12-
versionName "5.5.7"
11+
versionCode 50508
12+
versionName "5.5.8"
1313

1414
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1515
consumerProguardFiles "consumer-rules.pro"

QCloudCosXml/cosxml/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ android {
1515
minSdkVersion 15
1616
targetSdkVersion 28
1717

18-
versionCode 50507
19-
versionName "5.5.7"
18+
versionCode 50508
19+
versionName "5.5.8"
2020

2121
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2222

@@ -64,7 +64,7 @@ android {
6464
}
6565

6666
// 切换发 normal 或者 slim 包,需要同步修改 pom.artifactId 信息
67-
defaultPublishConfig "normalRelease"
67+
defaultPublishConfig "slimRelease"
6868
// "slimRelease"
6969

7070
compileOptions {
@@ -84,7 +84,6 @@ dependencies {
8484
androidTestImplementation 'com.android.support.test:rules:1.0.2'
8585

8686
api project(path: ':foundation')
87-
api project(path: ':mtaUtils')
8887
api project(path: ':logUtils')
8988

9089
if (compileQuic()) {
@@ -94,7 +93,8 @@ dependencies {
9493
compileOnly project(':xmlAnnoation')
9594
annotationProcessor project(':xmlCompiler')
9695

97-
implementation 'com.tencent.qcloud:beacon-android-release:4.1.9'
96+
normalApi 'com.tencent.qcloud:beacon-android-release:4.1.13'
97+
slimCompileOnly 'com.tencent.qcloud:beacon-android-release:4.1.13'
9898
}
9999

100100

QCloudCosXml/cosxml/src/androidTest/java/com/tencent/cos/xml/image/ImageTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ public void onFail(CosXmlRequest request, CosXmlClientException exception, CosXm
128128

129129
@Test public void testThumbnail() {
130130

131+
final TestLocker testLocker = new TestLocker(1);
131132
GetObjectRequest getObjectRequest = new GetObjectRequest(TestConst.PERSIST_BUCKET, TestConst.PERSIST_BUCKET_PIC_PATH,
132-
TestUtils.localParentPath());
133+
Environment.getExternalStorageDirectory().getAbsolutePath(), TestUtils.localPath(localImageName));
133134

134135
Map<String, String> paras = new HashMap<>();
135136
paras.put("imageMogr2/thumbnail/!50p", null);

QCloudCosXml/cosxml/src/main/java/com/tencent/cos/xml/BeaconService.java

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,19 @@ public static void init(Context applicationContext, CosXmlServiceConfig serviceC
9898
if (instance == null) {
9999
instance = new BeaconService(applicationContext, serviceConfig);
100100

101-
BeaconConfig config = BeaconConfig.builder()
102-
.auditEnable(false)
103-
.bidEnable(false)
104-
.collectMACEnable(false)
105-
.collectIMEIEnable(false)
106-
.pagePathEnable(false)
107-
.build();
108-
BeaconReport beaconReport = BeaconReport.getInstance();
109-
beaconReport.setLogAble(IS_DEBUG);//是否打开日志
110-
beaconReport.start(applicationContext, APP_KEY, config);
101+
if(isIncludeBeacon()) {
102+
BeaconConfig config = BeaconConfig.builder()
103+
.auditEnable(false)
104+
.bidEnable(false)
105+
.collectMACEnable(false)
106+
.collectIMEIEnable(false)
107+
.pagePathEnable(false)
108+
.setNormalPollingTime(5000)
109+
.build();
110+
BeaconReport beaconReport = BeaconReport.getInstance();
111+
beaconReport.setLogAble(IS_DEBUG);//是否打开日志
112+
beaconReport.start(applicationContext, APP_KEY, config);
113+
}
111114
}
112115
}
113116
}
@@ -117,14 +120,16 @@ public static BeaconService getInstance() {
117120
}
118121

119122
private void report(String eventcode, Map<String, String> params) {
123+
if(!isIncludeBeacon()) return;
124+
120125
BeaconEvent.Builder builder = BeaconEvent.builder()
121126
.withAppKey(APP_KEY)
122127
.withCode(eventcode)
123128
.withType(EventType.NORMAL)
124129
.withParams(params);
125130
try {
126131
builder.withIsSimpleParams(true);
127-
} catch (NoSuchMethodError error){
132+
} catch (NoSuchMethodError error) {
128133
//APP使用了标准版的灯塔SDK 不支持withIsSimpleParams
129134
}
130135
EventResult result = BeaconReport.getInstance().report(builder.build());
@@ -281,6 +286,15 @@ public void reportError(String source, Exception e) {
281286
report(EVENT_CODE_ERROR, params);
282287
}
283288

289+
private static boolean isIncludeBeacon(){
290+
try {
291+
Class.forName("com.tencent.beacon.event.open.BeaconReport");
292+
return true;
293+
} catch (ClassNotFoundException e){
294+
return false;
295+
}
296+
}
297+
284298
private Map<String, String> getBaseServiceParams(CosXmlRequest cosXmlRequest, long tookTime, boolean isSuccess) {
285299
Map<String, String> params = getCommonParams();
286300

@@ -345,6 +359,8 @@ private Map<String, String> getUploadParams(String region, boolean isSuccess) {
345359
* @return 公共参数
346360
*/
347361
private Map<String, String> getCommonParams() {
362+
if(!isIncludeBeacon()) return new HashMap<>();
363+
348364
Map<String, String> params = new HashMap<>();
349365
BeaconPubParams pubParams = BeaconReport.getInstance().getCommonParams(applicationContext);
350366
params.put("boundle_id", pubParams.getBoundleId());
@@ -468,7 +484,10 @@ private int subdivisionIOException(Throwable causeException) {
468484
*/
469485
private boolean isReport(CosXmlRequest cosXmlRequest) {
470486
String requestName = cosXmlRequest.getClass().getSimpleName();
471-
return !"InitMultipartUploadRequest".equals(requestName) &&
487+
return !"PutObjectRequest".equals(requestName) &&
488+
!"GetObjectRequest".equals(requestName) &&
489+
!"SelectObjectContentRequest".equals(requestName) &&
490+
!"InitMultipartUploadRequest".equals(requestName) &&
472491
!"ListPartsRequest".equals(requestName) &&
473492
!"UploadPartRequest".equals(requestName) &&
474493
!"CompleteMultiUploadRequest".equals(requestName) &&

QCloudCosXml/cosxml/src/normal/java/com/tencent/cos/xml/model/tag/eventstreaming/SelectObjectContentEvent.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ public RecordsEvent withPayload(ByteBuffer payload) {
5454
return this;
5555
}
5656

57+
58+
5759
}
5860

5961
/**

QCloudCosXml/cosxml/src/normal/java/com/tencent/cos/xml/transfer/XmlBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ public static String buildSelectRequest(SelectRequest selectRequest) throws IOEx
680680
addElement(xmlSerializer, "QuoteCharacter", csvInput.getQuoteCharacterAsString());
681681
addElement(xmlSerializer, "QuoteEscapeCharacter", csvInput.getQuoteEscapeCharacterAsString());
682682
addElement(xmlSerializer, "Comments", csvInput.getCommentsAsString());
683-
addElement(xmlSerializer, "AllowQuotedRecordDelimiter", String.valueOf(csvInput.getAllowQuotedRecordDelimiter()));
683+
addElement(xmlSerializer, "AllowQuotedRecordDelimiter", csvInput.getAllowQuotedRecordDelimiter() ? "TRUE" : "FALSE");
684684
xmlSerializer.endTag("", "CSV");
685685

686686
} else if (selectRequest.getInputSerialization().getJson() != null) {

QCloudCosXml/logUtils/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
minSdkVersion 15
99
targetSdkVersion 27
1010
versionCode sdkVersionCode
11-
versionName "5.5.7"
11+
versionName "5.5.8"
1212

1313
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1414

QCloudCosXml/mtaUtils/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

QCloudCosXml/mtaUtils/build.gradle

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)