Skip to content

Commit

Permalink
See 10/16 log
Browse files Browse the repository at this point in the history
  • Loading branch information
Blankj committed Oct 16, 2018
1 parent 06479b1 commit 6cd9188
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 114 deletions.
2 changes: 1 addition & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png

[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.4-brightgreen.svg
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.21.0-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode

[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If this project helps you a lot and you want to support the project's developmen

[logo]: https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png

[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.20.4-brightgreen.svg
[aucsvg]: https://img.shields.io/badge/AndroidUtilCode-v1.21.0-brightgreen.svg
[auc]: https://github.com/Blankj/AndroidUtilCode

[apisvg]: https://img.shields.io/badge/API-14+-brightgreen.svg
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/com/blankj/androidutilcode/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ public class Config {
CACHE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath();
}
TEST_APK_PATH = CACHE_PATH + FILE_SEP + "test_install.apk";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
Expand Down Expand Up @@ -48,17 +49,32 @@ public void initView(Bundle savedInstanceState, View contentView) {
findViewById(R.id.btn_reboot_to_recovery).setOnClickListener(this);
findViewById(R.id.btn_reboot_to_bootloader).setOnClickListener(this);
TextView tvAboutDevice = findViewById(R.id.tv_about_device);
tvAboutDevice.setText(new SpanUtils()
.appendLine("isRoot: " + DeviceUtils.isDeviceRooted())
.appendLine("getSDKVersionName: " + DeviceUtils.getSDKVersionName())
.appendLine("getSDKVersionCode: " + DeviceUtils.getSDKVersionCode())
.appendLine("getAndroidID: " + DeviceUtils.getAndroidID())
.appendLine("getMacAddress: " + DeviceUtils.getMacAddress())
.appendLine("getManufacturer: " + DeviceUtils.getManufacturer())
.appendLine("getModel: " + DeviceUtils.getModel())
.append("getABIs: " + Arrays.asList(DeviceUtils.getABIs()))
.create()
);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
tvAboutDevice.setText(new SpanUtils()
.appendLine("isRoot: " + DeviceUtils.isDeviceRooted())
.appendLine("isAdbEnabled: " + DeviceUtils.isAdbEnabled())
.appendLine("getSDKVersionName: " + DeviceUtils.getSDKVersionName())
.appendLine("getSDKVersionCode: " + DeviceUtils.getSDKVersionCode())
.appendLine("getAndroidID: " + DeviceUtils.getAndroidID())
.appendLine("getMacAddress: " + DeviceUtils.getMacAddress())
.appendLine("getManufacturer: " + DeviceUtils.getManufacturer())
.appendLine("getModel: " + DeviceUtils.getModel())
.append("getABIs: " + Arrays.asList(DeviceUtils.getABIs()))
.create()
);
} else {
tvAboutDevice.setText(new SpanUtils()
.appendLine("isRoot: " + DeviceUtils.isDeviceRooted())
.appendLine("getSDKVersionName: " + DeviceUtils.getSDKVersionName())
.appendLine("getSDKVersionCode: " + DeviceUtils.getSDKVersionCode())
.appendLine("getAndroidID: " + DeviceUtils.getAndroidID())
.appendLine("getMacAddress: " + DeviceUtils.getMacAddress())
.appendLine("getManufacturer: " + DeviceUtils.getManufacturer())
.appendLine("getModel: " + DeviceUtils.getModel())
.append("getABIs: " + Arrays.asList(DeviceUtils.getABIs()))
.create()
);
}
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ ext {
compileSdkVersion: 27,
minSdkVersion : 14,
targetSdkVersion : 27,
versionCode : 1_020_004,
versionName : '1.20.4.10'// E.g. 1.9.72 => 1,009,072
versionCode : 1_021_000,
versionName : '1.21.0'// E.g. 1.9.72 => 1,009,072
]

versionConfig = [
// plugin
gradle : '3.2.1',
gradle : '3.2.0',
kotlin : '1.2.30',
// lib
support : '27.1.1',
Expand Down Expand Up @@ -177,7 +177,7 @@ def configAppDependencies(Project pro) {
// LeakCanary
debugImplementation depConfig.leakcanary.android
releaseImplementation depConfig.leakcanary.android_no_op
// implementation 'com.blankj:utilcode:1.20.3'
// implementation 'com.blankj:utilcode:1.21.0'
}
}

Expand Down
1 change: 1 addition & 0 deletions update_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* `18/10/16` [add] BusUtils, DeviceUtils#isAdbEnabled. Publish v1.21.0.
* `18/09/29` [fix] ToastUtils which causes crash in the some devices of Xiaomi. Publish v1.20.4.
* `18/09/13` 修复 ToastUtils 在小米手机显示 Toast 带有 App 名,发布 1.20.3
* `18/09/12` 修复 KeyBoardUtils#fixAndroidBug5497,完善 ToastUtils,发布 1.20.2
Expand Down
3 changes: 2 additions & 1 deletion utilcode/README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gradle:
```groovy
implementation 'com.blankj:utilcode:1.20.4'
implementation 'com.blankj:utilcode:1.21.0'
```


Expand Down Expand Up @@ -173,6 +173,7 @@ init: 初始化
* ### 设备相关 -> [DeviceUtils.java][device.java] -> [Demo][device.demo]
```
isDeviceRooted : 判断设备是否 rooted
isAdbEnabled : 判断设备 ADB 是否可用
getSDKVersionName: 获取设备系统版本号
getSDKVersionCode: 获取设备系统版本码
getAndroidID : 获取设备 AndroidID
Expand Down
2 changes: 1 addition & 1 deletion utilcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gradle:
```groovy
implementation 'com.blankj:utilcode:1.20.4'
implementation 'com.blankj:utilcode:1.21.0'
```


Expand Down
21 changes: 0 additions & 21 deletions utilcode/src/main/java/com/blankj/utilcode/BusTest.java

This file was deleted.

14 changes: 14 additions & 0 deletions utilcode/src/main/java/com/blankj/utilcode/util/DeviceUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.os.Build;
import android.os.PowerManager;
import android.provider.Settings;
import android.support.annotation.RequiresApi;
import android.support.annotation.RequiresPermission;
import android.text.TextUtils;

Expand Down Expand Up @@ -51,6 +52,19 @@ public static boolean isDeviceRooted() {
return false;
}

/**
* Return whether ADB is enabled.
*
* @return {@code true}: yes<br>{@code false}: no
*/
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
public static boolean isAdbEnabled() {
return Settings.Secure.getInt(
Utils.getApp().getContentResolver(),
Settings.Global.ADB_ENABLED, 0
) > 0;
}

/**
* Return the version name of device's system.
*
Expand Down
Loading

0 comments on commit 6cd9188

Please sign in to comment.