version:m40se 2.9.8
fix: update:增加G13和P30Pro平台
This commit is contained in:
@@ -73,8 +73,8 @@ android {
|
||||
|
||||
official {
|
||||
flavorDimensions "default"
|
||||
versionCode 37
|
||||
versionName "2.9.7"
|
||||
versionCode 38
|
||||
versionName "2.9.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,11 +142,32 @@ android {
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
G10P{
|
||||
storeFile file("keystore/G10PMTK11.jks")
|
||||
storePassword "123456"
|
||||
keyAlias "G10PMTK11"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
|
||||
Teclast8515{
|
||||
storeFile file("keystore/Teclast8515.keystore")
|
||||
storePassword "123456"
|
||||
keyAlias "Teclast8515"
|
||||
keyPassword "123456"
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
unisocDebug.initWith(debug)
|
||||
unisocDebug {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"ZhanRui"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
@@ -155,6 +176,9 @@ android {
|
||||
|
||||
unisocRelease.initWith(debug)
|
||||
unisocRelease {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"ZhanRui"'
|
||||
debuggable true
|
||||
signingConfig signingConfigs.unisoc
|
||||
@@ -200,6 +224,46 @@ android {
|
||||
signingConfig signingConfigs.teclastMTK
|
||||
}
|
||||
|
||||
G13Debug.initWith(debug)
|
||||
G13Debug {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"G13"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.G10P
|
||||
}
|
||||
|
||||
G13Release.initWith(release)
|
||||
G13Release {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"G13"'
|
||||
signingConfig signingConfigs.G10P
|
||||
}
|
||||
|
||||
Teclast8515Debug.initWith(debug)
|
||||
Teclast8515Debug {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"8515"'
|
||||
versionNameSuffix "-debug"
|
||||
debuggable true
|
||||
signingConfig signingConfigs.Teclast8515
|
||||
}
|
||||
|
||||
Teclast8515Release.initWith(release)
|
||||
Teclast8515Release {
|
||||
manifestPlaceholders = [
|
||||
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
|
||||
]
|
||||
buildConfigField "String", "platform", '"8515"'
|
||||
signingConfig signingConfigs.Teclast8515
|
||||
}
|
||||
|
||||
teclastUnisocdebug.initWith(zhanRuiDebug)
|
||||
teclastUnisocdebug {
|
||||
manifestPlaceholders = [
|
||||
|
||||
BIN
app/keystore/G10PMTK11.jks
Normal file
BIN
app/keystore/G10PMTK11.jks
Normal file
Binary file not shown.
BIN
app/keystore/Teclast8515.keystore
Normal file
BIN
app/keystore/Teclast8515.keystore
Normal file
Binary file not shown.
@@ -70,8 +70,6 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
TextView tv_customversion;
|
||||
@BindView(R.id.tv_sn)
|
||||
TextView tv_sn;
|
||||
@BindView(R.id.tv_bind)
|
||||
TextView tv_bind;
|
||||
@BindView(R.id.tv_version)
|
||||
TextView tv_version;
|
||||
@BindView(R.id.qr_code)
|
||||
@@ -126,7 +124,12 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
|
||||
setOnClickListener();
|
||||
tv_customversion.setText(JGYUtils.getCustomVersion());
|
||||
tv_sn.setText("IMEI:" + Utils.getIMEI(MainActivity.this));
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) {
|
||||
tv_sn.setText("SN:" + Utils.getSerial());
|
||||
}else {
|
||||
tv_sn.setText("IMEI:" + Utils.getIMEI(MainActivity.this));
|
||||
}
|
||||
|
||||
tv_version.setText(BuildConfig.VERSION_NAME);
|
||||
|
||||
task = new TimeTask();
|
||||
@@ -382,18 +385,15 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
|
||||
if (response != null) {
|
||||
//设备已经绑定
|
||||
if (response.code == 200) {
|
||||
tv_bind.setText(getString(R.string.bind_succeed));
|
||||
SnInfo snInfo = response.data;
|
||||
NetInterfaceManager.getInstance().checkDeviceType(snInfo.getType_id());
|
||||
}
|
||||
//设备没有绑定
|
||||
else if (response.code == 300) {
|
||||
tv_bind.setText(getString(R.string.scan_tips));
|
||||
ControlManager.getInstance().setDisableSetting();
|
||||
}
|
||||
//没有授权的设备
|
||||
else if (response.code == 400) {
|
||||
tv_bind.setText(getString(R.string.device_unauthorized));
|
||||
ToastUtil.show(getString(R.string.device_unauthorized));
|
||||
Log.e(TAG, "setSnInfo: " + getString(R.string.device_unauthorized));
|
||||
ControlManager.getInstance().setDisableSetting();
|
||||
|
||||
@@ -669,6 +669,10 @@ public class NetInterfaceManager {
|
||||
set.add(JGYUtils.M40SETag);
|
||||
} else if (platform == JGYUtils.T30ProPlatform) {
|
||||
set.add(JGYUtils.T30PROTag);
|
||||
} else if (platform == JGYUtils.MTK8515Platform) {
|
||||
set.add(JGYUtils.MTK8515Tag);
|
||||
} else if (platform == JGYUtils.G13Platform) {
|
||||
set.add(JGYUtils.G13Tag);
|
||||
}
|
||||
});
|
||||
clearAndAppendTags(set);
|
||||
|
||||
@@ -94,12 +94,17 @@ public class JGYUtils {
|
||||
public static final int ZhanruiPlatform = 2;
|
||||
public static final int M40sePlatform = 4;
|
||||
public static final int T30ProPlatform = 5;
|
||||
public static final int MTK8515Platform = 6;
|
||||
public static final int G13Platform = 7;
|
||||
public static final int UnknowPlatform = 0;
|
||||
|
||||
public static String MTKTag = "MTK";
|
||||
public static String ZhanruiTag = "展锐";
|
||||
public static String M40SETag = "M40SE";
|
||||
public static String T30PROTag = "T30PRO";
|
||||
public static final String MTKTag = "MTK";
|
||||
public static final String ZhanruiTag = "展锐";
|
||||
public static final String M40SETag = "M40SE";
|
||||
public static final String T30PROTag = "T30PRO";
|
||||
public static final String MTK8515Tag = "8515";
|
||||
public static final String G13Tag = "G13";
|
||||
|
||||
|
||||
private HashSet<String> ownApp = new HashSet<String>() {{
|
||||
this.add("com.android.settings");
|
||||
@@ -488,6 +493,12 @@ public class JGYUtils {
|
||||
} else if ("T30PRO".equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "T30PRO");
|
||||
return T30ProPlatform;
|
||||
} else if (MTK8515Tag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "8515");
|
||||
return MTK8515Platform;
|
||||
} else if (G13Tag.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "G13");
|
||||
return G13Platform;
|
||||
} else {
|
||||
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||
return UnknowPlatform;
|
||||
@@ -509,23 +520,29 @@ public class JGYUtils {
|
||||
|
||||
public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) {
|
||||
String platform = BuildConfig.platform;
|
||||
if ("MTK".equalsIgnoreCase(platform)) {
|
||||
if (MTKTag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(MTKPlatform);
|
||||
} else if ("ZhanRui".equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
|
||||
}else if ("M40SE".equalsIgnoreCase(platform)) {
|
||||
} else if (M40SETag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(M40sePlatform);
|
||||
} else if ("T30PRO".equalsIgnoreCase(platform)) {
|
||||
} else if (T30PROTag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(T30ProPlatform);
|
||||
} else {
|
||||
} else if (MTK8515Tag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(MTK8515Platform);
|
||||
} else if (G13Tag.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(G13Platform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
}
|
||||
|
||||
public static String getCustomVersion() {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
|
||||
||JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform
|
||||
||JGYUtils.getInstance().checkAppPlatform() == JGYUtils.T30ProPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.T30ProPlatform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK8515Platform
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform
|
||||
) {
|
||||
return getProperty("ro.build.display.id", "获取失败");
|
||||
} else {
|
||||
@@ -535,7 +552,7 @@ public class JGYUtils {
|
||||
|
||||
public static String getRomVersion() {
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
|
||||
||JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform) {
|
||||
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform) {
|
||||
return getProperty("ro.build.id", "获取失败");
|
||||
} else {
|
||||
return getProperty("ro.build.display.id", "获取失败");
|
||||
|
||||
@@ -616,23 +616,30 @@ public class Utils {
|
||||
*/
|
||||
@SuppressLint({"MissingPermission", "NewApi"})
|
||||
public static String getSerial() {
|
||||
return JGYUtils.getInstance().getIMEI();
|
||||
// String serial = "unknow";
|
||||
// try {
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+
|
||||
// serial = Build.getSerial();
|
||||
// } else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+
|
||||
// serial = Build.SERIAL;
|
||||
// } else {//8.0-
|
||||
// Class<?> c = Class.forName("android.os.SystemProperties");
|
||||
// Method get = c.getMethod("get", String.class);
|
||||
// serial = (String) get.invoke(c, "ro.serialno");
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// Log.e("e", "读取设备序列号异常:" + e.toString());
|
||||
// }
|
||||
// return serial;
|
||||
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) {
|
||||
return getSn();
|
||||
} else {
|
||||
return JGYUtils.getInstance().getIMEI();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSn() {
|
||||
String serial = "unknow";
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+
|
||||
serial = Build.getSerial();
|
||||
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+
|
||||
serial = Build.SERIAL;
|
||||
} else {//8.0-
|
||||
Class<?> c = Class.forName("android.os.SystemProperties");
|
||||
Method get = c.getMethod("get", String.class);
|
||||
serial = (String) get.invoke(c, "ro.serialno");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.e("e", "读取设备序列号异常:" + e.toString());
|
||||
}
|
||||
return serial;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -101,19 +101,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qr_code" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bind"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="@string/scan_tips"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sn" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
@@ -121,21 +108,21 @@
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_32"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:visibility="gone"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/bind_applet"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_bind"
|
||||
tools:layout_editor_absoluteX="0dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginBottom="@dimen/dp_32"
|
||||
android:background="@drawable/bt_selector"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:text="检查更新"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginBottom="@dimen/dp_32"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
@@ -101,19 +101,6 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/qr_code" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_bind"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="@string/scan_tips"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sn" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
@@ -130,13 +117,13 @@
|
||||
<TextView
|
||||
android:id="@+id/tv_update"
|
||||
android:layout_width="@dimen/dp_150"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginBottom="@dimen/dp_32"
|
||||
android:background="@drawable/bt_selector"
|
||||
android:gravity="center"
|
||||
android:text="检查更新"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
Reference in New Issue
Block a user