Skip to content

Commit 1e5a712

Browse files
committed
add client id
1 parent cc08f46 commit 1e5a712

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/com/qiniu/conf/Conf.java

Lines changed: 12 additions & 1 deletion
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 {
46
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
}

0 commit comments

Comments
 (0)