Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
mmm-rain
AndroidUtilCode
提交
788b57ac
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,发现更多精彩内容 >>
提交
788b57ac
编写于
1月 30, 2019
作者:
B
Blankj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
see 01/30 log
上级
90d5036c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
95 addition
and
41 deletion
+95
-41
utilcode/lib/src/main/java/com/blankj/utilcode/util/RomUtils.java
.../lib/src/main/java/com/blankj/utilcode/util/RomUtils.java
+95
-41
未找到文件。
utilcode/lib/src/main/java/com/blankj/utilcode/util/RomUtils.java
浏览文件 @
788b57ac
...
...
@@ -23,26 +23,26 @@ import java.util.Properties;
*/
public
final
class
RomUtils
{
public
static
final
String
ROM_HUAWEI
=
"huawei"
;
public
static
final
String
ROM_VIVO
=
"vivo"
;
public
static
final
String
ROM_XIAOMI
=
"xiaomi"
;
public
static
final
String
ROM_OPPO
=
"oppo"
;
public
static
final
String
[]
ROM_HUAWEI
=
{
"huawei"
}
;
public
static
final
String
[]
ROM_VIVO
=
{
"vivo"
}
;
public
static
final
String
[]
ROM_XIAOMI
=
{
"xiaomi"
}
;
public
static
final
String
[]
ROM_OPPO
=
{
"oppo"
}
;
public
static
final
String
[]
ROM_LEECO
=
{
"leeco"
,
"letv"
};
public
static
final
String
[]
ROM_360
=
{
"360"
,
"qiku"
};
public
static
final
String
ROM_ZTE
=
"zte"
;
public
static
final
String
ROM_ONEPLUS
=
"oneplus"
;
public
static
final
String
ROM_NUBIA
=
"nubia"
;
public
static
final
String
[]
ROM_ZTE
=
{
"zte"
}
;
public
static
final
String
[]
ROM_ONEPLUS
=
{
"oneplus"
}
;
public
static
final
String
[]
ROM_NUBIA
=
{
"nubia"
}
;
public
static
final
String
[]
ROM_COOLPAD
=
{
"coolpad"
,
"yulong"
};
public
static
final
String
[]
ROM_LG
=
{
"lg"
,
"lge"
};
public
static
final
String
ROM_GOOGLE
=
"google"
;
public
static
final
String
ROM_SAMSUNG
=
"samsung"
;
public
static
final
String
ROM_MEIZU
=
"meizu"
;
public
static
final
String
ROM_LENOVO
=
"lenovo"
;
public
static
final
String
ROM_SMARTISAN
=
"smartisan"
;
public
static
final
String
ROM_HTC
=
"htc"
;
public
static
final
String
ROM_SONY
=
"sony"
;
public
static
final
String
ROM_AMIGO
=
"amigo"
;
public
static
final
String
[]
ROM_GOOGLE
=
{
"google"
}
;
public
static
final
String
[]
ROM_SAMSUNG
=
{
"samsung"
}
;
public
static
final
String
[]
ROM_MEIZU
=
{
"meizu"
}
;
public
static
final
String
[]
ROM_LENOVO
=
{
"lenovo"
}
;
public
static
final
String
[]
ROM_SMARTISAN
=
{
"smartisan"
}
;
public
static
final
String
[]
ROM_HTC
=
{
"htc"
}
;
public
static
final
String
[]
ROM_SONY
=
{
"sony"
}
;
public
static
final
String
[]
ROM_AMIGO
=
{
"amigo"
}
;
public
static
final
String
VERSION_PROPERTY_HUAWEI
=
"ro.build.version.emui"
;
public
static
final
String
VERSION_PROPERTY_VIVO
=
"ro.vivo.os.build.display.id"
;
...
...
@@ -142,6 +142,33 @@ public final class RomUtils {
return
ROM_NUBIA
.
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by coolpad.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
isCoolpad
()
{
return
ROM_COOLPAD
[
0
].
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by lg.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
isLg
()
{
return
ROM_LG
[
0
].
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by google.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
isGoogle
()
{
return
ROM_GOOGLE
.
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by samsung.
*
...
...
@@ -161,21 +188,48 @@ public final class RomUtils {
}
/**
* Return whether the rom is made by
coolpad
.
* Return whether the rom is made by
lenovo
.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
is
Coolpad
()
{
return
ROM_
COOLPAD
[
0
]
.
equals
(
getRomInfo
().
name
);
public
static
boolean
is
Lenovo
()
{
return
ROM_
LENOVO
.
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by
lenovo
.
* Return whether the rom is made by
smartisan
.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
isLenovo
()
{
return
ROM_LENOVO
.
equals
(
getRomInfo
().
name
);
public
static
boolean
isSmartisan
()
{
return
ROM_SMARTISAN
.
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by htc.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
isHtc
()
{
return
ROM_HTC
.
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by sony.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
isSony
()
{
return
ROM_SONY
.
equals
(
getRomInfo
().
name
);
}
/**
* Return whether the rom is made by amigo.
*
* @return {@code true}: yes<br>{@code false}: no
*/
public
static
boolean
isAmigo
()
{
return
ROM_AMIGO
.
equals
(
getRomInfo
().
name
);
}
/**
...
...
@@ -186,9 +240,9 @@ public final class RomUtils {
public
static
RomInfo
getRomInfo
()
{
if
(
bean
!=
null
)
return
bean
;
bean
=
new
RomInfo
();
final
String
brand
Name
=
getBrand
();
final
String
brand
=
getBrand
();
final
String
manufacturer
=
getManufacturer
();
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_HUAWEI
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_HUAWEI
))
{
bean
.
name
=
ROM_HUAWEI
;
String
version
=
getRomVersion
(
VERSION_PROPERTY_HUAWEI
);
String
[]
temp
=
version
.
split
(
"_"
);
...
...
@@ -199,67 +253,67 @@ public final class RomUtils {
}
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_VIVO
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_VIVO
))
{
bean
.
name
=
ROM_VIVO
;
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_VIVO
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_XIAOMI
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_XIAOMI
))
{
bean
.
name
=
ROM_XIAOMI
;
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_XIAOMI
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_OPPO
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_OPPO
))
{
bean
.
name
=
ROM_OPPO
;
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_OPPO
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_LEECO
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_LEECO
))
{
bean
.
name
=
ROM_LEECO
[
0
];
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_LEECO
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_360
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_360
))
{
bean
.
name
=
ROM_360
[
0
];
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_360
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_ZTE
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_ZTE
))
{
bean
.
name
=
ROM_ZTE
;
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_ZTE
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_ONEPLUS
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_ONEPLUS
))
{
bean
.
name
=
ROM_ONEPLUS
;
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_ONEPLUS
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_NUBIA
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_NUBIA
))
{
bean
.
name
=
ROM_NUBIA
;
bean
.
version
=
getRomVersion
(
VERSION_PROPERTY_NUBIA
);
return
bean
;
}
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_COOLPAD
))
{
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_COOLPAD
))
{
bean
.
name
=
ROM_COOLPAD
[
0
];
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_LG
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_LG
))
{
bean
.
name
=
ROM_LG
[
0
];
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_GOOGLE
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_GOOGLE
))
{
bean
.
name
=
ROM_GOOGLE
;
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_SAMSUNG
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_SAMSUNG
))
{
bean
.
name
=
ROM_SAMSUNG
;
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_MEIZU
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_MEIZU
))
{
bean
.
name
=
ROM_MEIZU
;
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_LENOVO
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_LENOVO
))
{
bean
.
name
=
ROM_LENOVO
;
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_SMARTISAN
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_SMARTISAN
))
{
bean
.
name
=
ROM_SMARTISAN
;
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_HTC
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_HTC
))
{
bean
.
name
=
ROM_HTC
;
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_SONY
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_SONY
))
{
bean
.
name
=
ROM_SONY
;
}
else
if
(
isRightRom
(
brand
Name
,
manufacturer
,
ROM_AMIGO
))
{
}
else
if
(
isRightRom
(
brand
,
manufacturer
,
ROM_AMIGO
))
{
bean
.
name
=
ROM_AMIGO
;
}
else
{
bean
.
name
=
manufacturer
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录