//BOARD 主板
String phoneInfo = "BOARD: " + android.os.Build.BOARD;
phoneInfo += ", BOOTLOADER: " + android.os.Build.BOOTLOADER;
//BRAND 运营商
phoneInfo += ", BRAND: " + android.os.Build.BRAND;
phoneInfo += ", CPU_ABI: " + android.os.Build.CPU_ABI;
phoneInfo += ", CPU_ABI2: " + android.os.Build.CPU_ABI2;
//DEVICE 驱动
phoneInfo += ", DEVICE: " + android.os.Build.DEVICE;
//DISPLAY Rom的名字 例如 Flyme 1.1.2(魅族rom) JWR66V(Android nexus系列原生4.3rom)
phoneInfo += ", DISPLAY: " + android.os.Build.DISPLAY;
//指纹
phoneInfo += ", FINGERPRINT: " + android.os.Build.FINGERPRINT;
//HARDWARE 硬件
phoneInfo += ", HARDWARE: " + android.os.Build.HARDWARE;
phoneInfo += ", HOST: " + android.os.Build.HOST;
phoneInfo += ", ID: " + android.os.Build.ID;
//MANUFACTURER 生产厂家
phoneInfo += ", MANUFACTURER: " + android.os.Build.MANUFACTURER;
//MODEL 机型
phoneInfo += ", MODEL: " + android.os.Build.MODEL;
phoneInfo += ", PRODUCT: " + android.os.Build.PRODUCT;
phoneInfo += ", RADIO: " + android.os.Build.RADIO;
phoneInfo += ", RADITAGSO: " + android.os.Build.TAGS;
phoneInfo += ", TIME: " + android.os.Build.TIME;
phoneInfo += ", TYPE: " + android.os.Build.TYPE;
phoneInfo += ", USER: " + android.os.Build.USER;
//VERSION.RELEASE 固件版本
phoneInfo += ", VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE;
phoneInfo += ", VERSION.CODENAME: " + android.os.Build.VERSION.CODENAME;
//VERSION.INCREMENTAL 基带版本
phoneInfo += ", VERSION.INCREMENTAL: " + android.os.Build.VERSION.INCREMENTAL;
//VERSION.SDK SDK版本
phoneInfo += ", VERSION.SDK: " + android.os.Build.VERSION.SDK;
String phoneInfo = "BOARD: " + android.os.Build.BOARD;
phoneInfo += ", BOOTLOADER: " + android.os.Build.BOOTLOADER;
//BRAND 运营商
phoneInfo += ", BRAND: " + android.os.Build.BRAND;
phoneInfo += ", CPU_ABI: " + android.os.Build.CPU_ABI;
phoneInfo += ", CPU_ABI2: " + android.os.Build.CPU_ABI2;
//DEVICE 驱动
phoneInfo += ", DEVICE: " + android.os.Build.DEVICE;
//DISPLAY Rom的名字 例如 Flyme 1.1.2(魅族rom) JWR66V(Android nexus系列原生4.3rom)
phoneInfo += ", DISPLAY: " + android.os.Build.DISPLAY;
//指纹
phoneInfo += ", FINGERPRINT: " + android.os.Build.FINGERPRINT;
//HARDWARE 硬件
phoneInfo += ", HARDWARE: " + android.os.Build.HARDWARE;
phoneInfo += ", HOST: " + android.os.Build.HOST;
phoneInfo += ", ID: " + android.os.Build.ID;
//MANUFACTURER 生产厂家
phoneInfo += ", MANUFACTURER: " + android.os.Build.MANUFACTURER;
//MODEL 机型
phoneInfo += ", MODEL: " + android.os.Build.MODEL;
phoneInfo += ", PRODUCT: " + android.os.Build.PRODUCT;
phoneInfo += ", RADIO: " + android.os.Build.RADIO;
phoneInfo += ", RADITAGSO: " + android.os.Build.TAGS;
phoneInfo += ", TIME: " + android.os.Build.TIME;
phoneInfo += ", TYPE: " + android.os.Build.TYPE;
phoneInfo += ", USER: " + android.os.Build.USER;
//VERSION.RELEASE 固件版本
phoneInfo += ", VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE;
phoneInfo += ", VERSION.CODENAME: " + android.os.Build.VERSION.CODENAME;
//VERSION.INCREMENTAL 基带版本
phoneInfo += ", VERSION.INCREMENTAL: " + android.os.Build.VERSION.INCREMENTAL;
//VERSION.SDK SDK版本
phoneInfo += ", VERSION.SDK: " + android.os.Build.VERSION.SDK;
phoneInfo += ", VERSION.SDK_INT: " + android.os.Build.VERSION.SDK_INT;
参考Android源码:
https://code.google.com/p/cyanogen-updater/source/browse/trunk/src/cmupdaterapp/utils/SysUtils.java#19
在Android shell模式下输入 getprop 就能获取系统属性值
如果Rom是miUI那么就会有以下字段.
[ro.miui.ui.version.code]: [3]
[ro.miui.ui.version.name]: [V5]
[ro.miui.ui.version.name]: [V5]
那么只要用一下代码获取就能知道是不是UI了.
getSystemProperty("ro.miui.ui.version.name")
public static String getSystemProperty(String propName){
String line;
BufferedReader input = null;
try
{
Process p = Runtime.getRuntime().exec("getprop " + propName);
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
line = input.readLine();
input.close();
}
catch (IOException ex)
{
Log.e(TAG, "Unable to read sysprop " + propName, ex);
return null;
}
finally
{
if(input != null)
{
try
{
input.close();
}
catch (IOException e)
{
Log.e(TAG, "Exception while closing InputStream", e);
}
}
}
return line;
}