diff --git a/app/build.gradle b/app/build.gradle index 2663b64..da13d63 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 = [ diff --git a/app/keystore/G10PMTK11.jks b/app/keystore/G10PMTK11.jks new file mode 100644 index 0000000..324fa31 Binary files /dev/null and b/app/keystore/G10PMTK11.jks differ diff --git a/app/keystore/Teclast8515.keystore b/app/keystore/Teclast8515.keystore new file mode 100644 index 0000000..922a161 Binary files /dev/null and b/app/keystore/Teclast8515.keystore differ diff --git a/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java b/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java index ec23bd0..6ac9936 100644 --- a/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java +++ b/app/src/main/java/com/fuying/sn/activity/main/MainActivity.java @@ -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(); diff --git a/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java b/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java index 7c57b2a..982aa62 100644 --- a/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java +++ b/app/src/main/java/com/fuying/sn/network/NetInterfaceManager.java @@ -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); diff --git a/app/src/main/java/com/fuying/sn/utils/JGYUtils.java b/app/src/main/java/com/fuying/sn/utils/JGYUtils.java index 761de17..469150a 100644 --- a/app/src/main/java/com/fuying/sn/utils/JGYUtils.java +++ b/app/src/main/java/com/fuying/sn/utils/JGYUtils.java @@ -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 ownApp = new HashSet() {{ 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", "获取失败"); diff --git a/app/src/main/java/com/fuying/sn/utils/Utils.java b/app/src/main/java/com/fuying/sn/utils/Utils.java index 9520f20..8695ca0 100644 --- a/app/src/main/java/com/fuying/sn/utils/Utils.java +++ b/app/src/main/java/com/fuying/sn/utils/Utils.java @@ -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; } /** diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml index 5d1094d..7fbf6af 100644 --- a/app/src/main/res/layout-land/activity_main.xml +++ b/app/src/main/res/layout-land/activity_main.xml @@ -101,19 +101,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/qr_code" /> - - diff --git a/app/src/main/res/layout-port/activity_main.xml b/app/src/main/res/layout-port/activity_main.xml index f519f9b..bf03a14 100644 --- a/app/src/main/res/layout-port/activity_main.xml +++ b/app/src/main/res/layout-port/activity_main.xml @@ -101,19 +101,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/qr_code" /> - -