Skip to content

Commit d3ae2d7

Browse files
committed
Merge pull request #61 from qiniu/develop
Release 6.0.5
2 parents 02be4c4 + 4ebbbba commit d3ae2d7

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## CHANGE LOG
22

3+
### v6.0.5
4+
2014-07-20 issue [#61](https://github.com/qiniu/android-sdk/pull/61)
5+
6+
- [#60] bug 成功返回时body 如果是null 会出错
7+
38
### v6.0.4
49
2014-07-20 issue [#58](https://github.com/qiniu/android-sdk/pull/58)
510

src/com/qiniu/auth/JSONObjectRet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public JSONObjectRet(){}
1313
public void onSuccess(byte[] body) {
1414
if (body == null) {
1515
onSuccess(new JSONObject());
16+
return;
1617
}
1718
try {
1819
JSONObject obj = new JSONObject(new String(body));

src/com/qiniu/conf/Conf.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
package com.qiniu.conf;
22

3+
import java.util.Random;
4+
35
public class Conf {
4-
public static final String VERSION = "6.0.4";
6+
public static final String VERSION = "6.0.5";
57
public static String UP_HOST = "http://upload.qiniu.com";
68
public static String UP_HOST2 = "http://up.qiniu.com";
79

10+
private static String id = genId();
11+
812
public static String getUserAgent() {
9-
return "QiniuAndroid/" + VERSION + " (" + android.os.Build.VERSION.RELEASE + "; " + android.os.Build.MODEL+ ")";
13+
return "QiniuAndroid/" + VERSION + " (" + android.os.Build.VERSION.RELEASE + "; "
14+
+ android.os.Build.MODEL+ "; " + id +")";
15+
}
16+
17+
private static String genId(){
18+
Random r = new Random();
19+
int rnum = r.nextInt(999);
20+
return System.currentTimeMillis() + "" + rnum;
1021
}
1122
}

tests/src/com/qiniu/test/UploadTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ private void successCheck() throws JSONException{
166166
Assert.assertTrue(success);
167167
Assert.assertNotNull(resp.optString("hash"));
168168
Assert.assertEquals(file.length(), resp.getLong("fsize"));
169+
Assert.assertEquals(key, resp.getString("key"));
169170
}
170171

171172
private File createFile(double fileSize, String suf) throws IOException {

0 commit comments

Comments
 (0)