Skip to content
This repository has been archived by the owner on Dec 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #31 from JoshuaYin/master
Browse files Browse the repository at this point in the history
update
  • Loading branch information
joshua.yin authored Oct 12, 2020
2 parents 40475e3 + 7a71166 commit 71a37ed
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
10 changes: 5 additions & 5 deletions UNetAnalysisLib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import proguard.gradle.ProGuardTask
apply plugin: 'com.android.library'

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 10
versionName "2.0.1"
targetSdkVersion 29
versionCode 11
versionName "2.1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -39,7 +39,7 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void prepareUuid(Context context) {

Response<UCApiResponseBean<SdkStatus>> apiGetSdkStatus() throws UCHttpException {
UCApiBaseRequestBean requestBean = new UCApiBaseRequestBean(appKey);

UCHttpClient client = BuildConfig.UCLOUD_API.startsWith("https") ? httpsClient : httpClient;
return client.execute(new Request.RequestBuilder<JsonSerializable>(BuildConfig.UCLOUD_API, HttpMethod.POST)
.path("/api/iplist/getsdkstatus/")
Expand Down Expand Up @@ -327,7 +327,7 @@ Response<UCApiResponseBean<MessageBean>> apiReportTraceroute(String reportAddres
UCReportEncryptBean reportEncryptBean = encryptReportData(report);
if (reportEncryptBean == null)
return null;

UCHttpClient client = reportAddress.startsWith("https") ? httpsClient : httpClient;
return client.execute(new Request.RequestBuilder<JsonSerializable>(reportAddress, HttpMethod.POST)
.body(reportEncryptBean)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public JSONObject toJson() {
json.put("timestamp", timestamp);
json.put("tag", tag);
json.put("ip_info", ipInfo);
json.put("user_defined", userDefinedStr);
json.put("uuid", uuid);
json.put("trigger_type", trigger);
json.put("user_defined", userDefinedStr == null ? "" : userDefinedStr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,33 @@
* HSPAP 3G HSPAP 比 HSDPA 快些
*/
public enum UCNetStatus {
/** 无网络连接 */
/**
* 无网络连接
*/
NET_STATUS_NOT_REACHABLE("NOT_REACHABLE"),
/** WIFI网络 */
/**
* WIFI网络
*/
NET_STATUS_WIFI("WIFI"),
/** 4G网络 */
/**
* 5G网络
*/
NET_STATUS_5G("5G"),
/**
* 4G网络
*/
NET_STATUS_4G("4G"),
/** 3G网络 */
/**
* 3G网络
*/
NET_STATUS_3G("3G"),
/** 2G网络 */
/**
* 2G网络
*/
NET_STATUS_2G("2G"),
/** 未知类型 */
/**
* 未知类型
*/
NET_STATUS_UNKNOW("UNKNOW");

private String value;
Expand Down Expand Up @@ -80,6 +96,8 @@ public static UCNetStatus parseStatusByNetworkInfo(NetworkInfo networkInfo) {
case TelephonyManager.NETWORK_TYPE_IWLAN:
case TelephonyManager.NETWORK_TYPE_LTE:
return NET_STATUS_4G;
case TelephonyManager.NETWORK_TYPE_NR:
return NET_STATUS_5G;
default:
String subtypeName = networkInfo.getSubtypeName();
if (subtypeName.equalsIgnoreCase("TD-SCDMA")
Expand Down

0 comments on commit 71a37ed

Please sign in to comment.