package com.alfeye.a1io;
|
|
import android.text.TextUtils;
|
|
/**
|
* @Date:2019/2/11 14:38
|
* @Author: yellow
|
* @类描述:
|
*/
|
public class A1IoDevManager {
|
|
/**
|
* 白色设备
|
*/
|
private static String DEVICE_FLAG = "1000";
|
|
|
private A1IoDevManager() {
|
|
}
|
|
public static A1IoDevBaseUtil initIOManager() {
|
if (determineTheFirmwareVersion()) {
|
return A1IoDevBlackUtil.initIoDevBlackUtil();
|
} else {
|
return A1IoDevWhiteUtil.initIoDevWhiteUtil();
|
}
|
}
|
|
|
/**
|
* 判断版本 1000 白色设备 1001 黑色设备
|
*
|
* @return
|
*/
|
public static boolean determineTheFirmwareVersion() {
|
//A1_1001_V1.0.1_20190121
|
String model = android.os.Build.DISPLAY;
|
try {
|
if (!TextUtils.isEmpty(model)) {
|
String[] split = model.split("_");
|
if (split.length > 0) {
|
String number = split[1];
|
if (!DEVICE_FLAG.equals(number)) {
|
return true;
|
}
|
}
|
}
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
return false;
|
}
|
|
}
|