version:m40se 2.9.8

fix:
update:增加G13和P30Pro平台
This commit is contained in:
2023-05-14 11:27:45 +08:00
parent 1765efb459
commit 6b9a1d99b5
9 changed files with 134 additions and 68 deletions

View File

@@ -73,8 +73,8 @@ android {
official { official {
flavorDimensions "default" flavorDimensions "default"
versionCode 37 versionCode 38
versionName "2.9.7" versionName "2.9.8"
} }
} }
@@ -142,11 +142,32 @@ android {
v1SigningEnabled true v1SigningEnabled true
v2SigningEnabled 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 { buildTypes {
unisocDebug.initWith(debug) unisocDebug.initWith(debug)
unisocDebug { unisocDebug {
manifestPlaceholders = [
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
]
buildConfigField "String", "platform", '"ZhanRui"' buildConfigField "String", "platform", '"ZhanRui"'
versionNameSuffix "-debug" versionNameSuffix "-debug"
debuggable true debuggable true
@@ -155,6 +176,9 @@ android {
unisocRelease.initWith(debug) unisocRelease.initWith(debug)
unisocRelease { unisocRelease {
manifestPlaceholders = [
AK: "7IubK1Ugeuxga4KKC5VQyjTeQlExsYZq"
]
buildConfigField "String", "platform", '"ZhanRui"' buildConfigField "String", "platform", '"ZhanRui"'
debuggable true debuggable true
signingConfig signingConfigs.unisoc signingConfig signingConfigs.unisoc
@@ -200,6 +224,46 @@ android {
signingConfig signingConfigs.teclastMTK 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.initWith(zhanRuiDebug)
teclastUnisocdebug { teclastUnisocdebug {
manifestPlaceholders = [ manifestPlaceholders = [

BIN
app/keystore/G10PMTK11.jks Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -70,8 +70,6 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
TextView tv_customversion; TextView tv_customversion;
@BindView(R.id.tv_sn) @BindView(R.id.tv_sn)
TextView tv_sn; TextView tv_sn;
@BindView(R.id.tv_bind)
TextView tv_bind;
@BindView(R.id.tv_version) @BindView(R.id.tv_version)
TextView tv_version; TextView tv_version;
@BindView(R.id.qr_code) @BindView(R.id.qr_code)
@@ -126,7 +124,12 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
setOnClickListener(); setOnClickListener();
tv_customversion.setText(JGYUtils.getCustomVersion()); 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); tv_version.setText(BuildConfig.VERSION_NAME);
task = new TimeTask(); task = new TimeTask();
@@ -382,18 +385,15 @@ public class MainActivity extends BaseActivity implements MainAContact.MainView,
if (response != null) { if (response != null) {
//设备已经绑定 //设备已经绑定
if (response.code == 200) { if (response.code == 200) {
tv_bind.setText(getString(R.string.bind_succeed));
SnInfo snInfo = response.data; SnInfo snInfo = response.data;
NetInterfaceManager.getInstance().checkDeviceType(snInfo.getType_id()); NetInterfaceManager.getInstance().checkDeviceType(snInfo.getType_id());
} }
//设备没有绑定 //设备没有绑定
else if (response.code == 300) { else if (response.code == 300) {
tv_bind.setText(getString(R.string.scan_tips));
ControlManager.getInstance().setDisableSetting(); ControlManager.getInstance().setDisableSetting();
} }
//没有授权的设备 //没有授权的设备
else if (response.code == 400) { else if (response.code == 400) {
tv_bind.setText(getString(R.string.device_unauthorized));
ToastUtil.show(getString(R.string.device_unauthorized)); ToastUtil.show(getString(R.string.device_unauthorized));
Log.e(TAG, "setSnInfo: " + getString(R.string.device_unauthorized)); Log.e(TAG, "setSnInfo: " + getString(R.string.device_unauthorized));
ControlManager.getInstance().setDisableSetting(); ControlManager.getInstance().setDisableSetting();

View File

@@ -669,6 +669,10 @@ public class NetInterfaceManager {
set.add(JGYUtils.M40SETag); set.add(JGYUtils.M40SETag);
} else if (platform == JGYUtils.T30ProPlatform) { } else if (platform == JGYUtils.T30ProPlatform) {
set.add(JGYUtils.T30PROTag); set.add(JGYUtils.T30PROTag);
} else if (platform == JGYUtils.MTK8515Platform) {
set.add(JGYUtils.MTK8515Tag);
} else if (platform == JGYUtils.G13Platform) {
set.add(JGYUtils.G13Tag);
} }
}); });
clearAndAppendTags(set); clearAndAppendTags(set);

View File

@@ -94,12 +94,17 @@ public class JGYUtils {
public static final int ZhanruiPlatform = 2; public static final int ZhanruiPlatform = 2;
public static final int M40sePlatform = 4; public static final int M40sePlatform = 4;
public static final int T30ProPlatform = 5; 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 final int UnknowPlatform = 0;
public static String MTKTag = "MTK"; public static final String MTKTag = "MTK";
public static String ZhanruiTag = "展锐"; public static final String ZhanruiTag = "展锐";
public static String M40SETag = "M40SE"; public static final String M40SETag = "M40SE";
public static String T30PROTag = "T30PRO"; 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>() {{ private HashSet<String> ownApp = new HashSet<String>() {{
this.add("com.android.settings"); this.add("com.android.settings");
@@ -488,6 +493,12 @@ public class JGYUtils {
} else if ("T30PRO".equalsIgnoreCase(platform)) { } else if ("T30PRO".equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "T30PRO"); Log.i(TAG, "checkAppPlatform: " + "T30PRO");
return T30ProPlatform; 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 { } else {
Log.i(TAG, "checkAppPlatform: " + "没有数据"); Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform; return UnknowPlatform;
@@ -509,23 +520,29 @@ public class JGYUtils {
public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) { public void getAppPlatform(GetAppPlatformCallback getAppPlatformCallback) {
String platform = BuildConfig.platform; String platform = BuildConfig.platform;
if ("MTK".equalsIgnoreCase(platform)) { if (MTKTag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(MTKPlatform); getAppPlatformCallback.AppPlatform(MTKPlatform);
} else if ("ZhanRui".equalsIgnoreCase(platform)) { } else if ("ZhanRui".equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(ZhanruiPlatform); getAppPlatformCallback.AppPlatform(ZhanruiPlatform);
}else if ("M40SE".equalsIgnoreCase(platform)) { } else if (M40SETag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(M40sePlatform); getAppPlatformCallback.AppPlatform(M40sePlatform);
} else if ("T30PRO".equalsIgnoreCase(platform)) { } else if (T30PROTag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(T30ProPlatform); getAppPlatformCallback.AppPlatform(T30ProPlatform);
} else { } else if (MTK8515Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(MTK8515Platform);
} else if (G13Tag.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(G13Platform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform); getAppPlatformCallback.AppPlatform(UnknowPlatform);
} }
} }
public static String getCustomVersion() { public static String getCustomVersion() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
||JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform
||JGYUtils.getInstance().checkAppPlatform() == JGYUtils.T30ProPlatform || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.T30ProPlatform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.MTK8515Platform
|| JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform
) { ) {
return getProperty("ro.build.display.id", "获取失败"); return getProperty("ro.build.display.id", "获取失败");
} else { } else {
@@ -535,7 +552,7 @@ public class JGYUtils {
public static String getRomVersion() { public static String getRomVersion() {
if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.ZhanruiPlatform
||JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform) { || JGYUtils.getInstance().checkAppPlatform() == JGYUtils.M40sePlatform) {
return getProperty("ro.build.id", "获取失败"); return getProperty("ro.build.id", "获取失败");
} else { } else {
return getProperty("ro.build.display.id", "获取失败"); return getProperty("ro.build.display.id", "获取失败");

View File

@@ -616,23 +616,30 @@ public class Utils {
*/ */
@SuppressLint({"MissingPermission", "NewApi"}) @SuppressLint({"MissingPermission", "NewApi"})
public static String getSerial() { public static String getSerial() {
return JGYUtils.getInstance().getIMEI(); if (JGYUtils.getInstance().checkAppPlatform() == JGYUtils.G13Platform) {
// String serial = "unknow"; return getSn();
// try { } else {
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+ return JGYUtils.getInstance().getIMEI();
// serial = Build.getSerial(); }
// } else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+ }
// serial = Build.SERIAL;
// } else {//8.0- public static String getSn() {
// Class<?> c = Class.forName("android.os.SystemProperties"); String serial = "unknow";
// Method get = c.getMethod("get", String.class); try {
// serial = (String) get.invoke(c, "ro.serialno"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {//9.0+
// } serial = Build.getSerial();
// } catch (Exception e) { } else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) {//8.0+
// e.printStackTrace(); serial = Build.SERIAL;
// Log.e("e", "读取设备序列号异常:" + e.toString()); } else {//8.0-
// } Class<?> c = Class.forName("android.os.SystemProperties");
// return serial; 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;
} }
/** /**

View File

@@ -101,19 +101,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/qr_code" /> 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 <ImageView
android:id="@+id/imageView" android:id="@+id/imageView"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -121,21 +108,21 @@
android:layout_marginStart="@dimen/dp_16" android:layout_marginStart="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_32" android:layout_marginTop="@dimen/dp_32"
android:layout_marginEnd="@dimen/dp_16" android:layout_marginEnd="@dimen/dp_16"
android:visibility="gone"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:src="@drawable/bind_applet" android:src="@drawable/bind_applet"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/tv_bind" app:layout_constraintTop_toBottomOf="@+id/tv_bind"
tools:layout_editor_absoluteX="0dp" /> tools:layout_editor_absoluteX="0dp" />
<TextView <TextView
android:layout_width="@dimen/dp_150" 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:background="@drawable/bt_selector"
android:gravity="center" android:gravity="center"
android:textSize="@dimen/sp_12"
android:text="检查更新" android:text="检查更新"
android:textColor="@color/white" android:textColor="@color/white"
android:layout_marginBottom="@dimen/dp_32" android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />

View File

@@ -101,19 +101,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/qr_code" /> 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 <ImageView
android:id="@+id/imageView" android:id="@+id/imageView"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -130,13 +117,13 @@
<TextView <TextView
android:id="@+id/tv_update" android:id="@+id/tv_update"
android:layout_width="@dimen/dp_150" android:layout_width="@dimen/dp_150"
android:layout_height="wrap_content" android:layout_height="@dimen/dp_24"
android:layout_marginBottom="@dimen/dp_32" android:layout_marginBottom="@dimen/dp_32"
android:background="@drawable/bt_selector" android:background="@drawable/bt_selector"
android:gravity="center" android:gravity="center"
android:text="检查更新" android:text="检查更新"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/sp_12" android:textSize="@dimen/sp_10"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />