Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
2e8fd522
A
AndroidUtilCode
项目概览
mmm-rain
/
AndroidUtilCode
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AndroidUtilCode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2e8fd522
编写于
6月 01, 2018
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 06/01 log
上级
3a2726df
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
38 addition
and
12 deletion
+38
-12
README-CN.md
README-CN.md
+1
-1
README.md
README.md
+1
-1
app/build.gradle
app/build.gradle
+1
-1
build.gradle
build.gradle
+2
-2
update_log.md
update_log.md
+1
-0
utilcode/README-CN.md
utilcode/README-CN.md
+1
-1
utilcode/README.md
utilcode/README.md
+1
-1
utilcode/src/main/java/com/blankj/utilcode/util/DeviceUtils.java
...e/src/main/java/com/blankj/utilcode/util/DeviceUtils.java
+30
-5
未找到文件。
README-CN.md
浏览文件 @
2e8fd522
...
...
@@ -41,7 +41,7 @@
[
logo
]:
https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/logo.png
[
aucsvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.16.
3
-brightgreen.svg
[
aucsvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.16.
4
-brightgreen.svg
[
auc
]:
https://github.com/Blankj/AndroidUtilCode
[
apisvg
]:
https://img.shields.io/badge/API-14+-brightgreen.svg
...
...
README.md
浏览文件 @
2e8fd522
...
...
@@ -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.16.
3
-brightgreen.svg
[
aucsvg
]:
https://img.shields.io/badge/AndroidUtilCode-v1.16.
4
-brightgreen.svg
[
auc
]:
https://github.com/Blankj/AndroidUtilCode
[
apisvg
]:
https://img.shields.io/badge/API-14+-brightgreen.svg
...
...
app/build.gradle
浏览文件 @
2e8fd522
...
...
@@ -57,5 +57,5 @@ dependencies {
implementation
'com.android.support.constraint:constraint-layout:1.1.0'
debugImplementation
"com.squareup.leakcanary:leakcanary-android:$leakcanary_version"
releaseImplementation
"com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"
// implementation 'com.blankj:utilcode:1.16.
3
'
// implementation 'com.blankj:utilcode:1.16.
4
'
}
build.gradle
浏览文件 @
2e8fd522
...
...
@@ -44,8 +44,8 @@ ext {
min_sdk_version
=
14
target_sdk_version
=
27
version_code
=
1
_016_00
3
version_name
=
'1.16.
3
'
// E.g 1.9.72 => 1,009,072
version_code
=
1
_016_00
4
version_name
=
'1.16.
4
'
// E.g 1.9.72 => 1,009,072
// App dependencies
support_version
=
'27.1.0'
...
...
update_log.md
浏览文件 @
2e8fd522
*
18/05/30 完善 DeviceUtils#getMacAddress,发布 1.16.4 版本
*
18/05/30 修复 ToastUtils 在 targetSdkVersion 为 27 在 api 25 机器快速 show 两次崩溃的异常,发布 1.16.3 版本
*
18/05/29 完善 TimeUtils 的 timeSpan 带符号位,ToastUtils 去除弱引用,发布 1.16.2 版本
*
18/05/25 新增 AppUtils#registerAppStatusChangedListener 和 AppUtils#unregisterAppStatusChangedListener,发布 1.16.1 版本
...
...
utilcode/README-CN.md
浏览文件 @
2e8fd522
...
...
@@ -2,7 +2,7 @@
Gradle:
```
groovy
implementation
'com.blankj:utilcode:1.16.
3
'
implementation
'com.blankj:utilcode:1.16.
4
'
```
...
...
utilcode/README.md
浏览文件 @
2e8fd522
...
...
@@ -2,7 +2,7 @@
Gradle:
```
groovy
implementation
'com.blankj:utilcode:1.16.
3
'
implementation
'com.blankj:utilcode:1.16.
4
'
```
...
...
utilcode/src/main/java/com/blankj/utilcode/util/DeviceUtils.java
浏览文件 @
2e8fd522
...
...
@@ -93,23 +93,48 @@ public final class DeviceUtils {
*/
@RequiresPermission
(
allOf
=
{
ACCESS_WIFI_STATE
,
INTERNET
})
public
static
String
getMacAddress
()
{
return
getMacAddress
((
String
[])
null
);
}
/**
* Return the MAC address.
* <p>Must hold
* {@code <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />},
* {@code <uses-permission android:name="android.permission.INTERNET" />}</p>
*
* @return the MAC address
*/
@RequiresPermission
(
allOf
=
{
ACCESS_WIFI_STATE
,
INTERNET
})
public
static
String
getMacAddress
(
final
String
...
excepts
)
{
String
macAddress
=
getMacAddressByWifiInfo
();
if
(
!
"02:00:00:00:00:00"
.
equals
(
macAddres
s
))
{
if
(
isAddressNotInExcepts
(
macAddress
,
except
s
))
{
return
macAddress
;
}
macAddress
=
getMacAddressByNetworkInterface
();
if
(
!
"02:00:00:00:00:00"
.
equals
(
macAddres
s
))
{
if
(
isAddressNotInExcepts
(
macAddress
,
except
s
))
{
return
macAddress
;
}
macAddress
=
getMacAddressByInetAddress
();
if
(
!
"02:00:00:00:00:00"
.
equals
(
macAddres
s
))
{
if
(
isAddressNotInExcepts
(
macAddress
,
except
s
))
{
return
macAddress
;
}
macAddress
=
getMacAddressByFile
();
if
(
!
"02:00:00:00:00:00"
.
equals
(
macAddres
s
))
{
if
(
isAddressNotInExcepts
(
macAddress
,
except
s
))
{
return
macAddress
;
}
return
"please open wifi"
;
return
""
;
}
private
static
boolean
isAddressNotInExcepts
(
final
String
address
,
final
String
...
excepts
)
{
if
(
excepts
==
null
||
excepts
.
length
==
0
)
{
return
!
"02:00:00:00:00:00"
.
equals
(
address
);
}
for
(
String
filter
:
excepts
)
{
if
(
address
.
equals
(
filter
))
{
return
false
;
}
}
return
true
;
}
@SuppressLint
({
"HardwareIds"
,
"MissingPermission"
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录