From: SnickerSun Date: Fri, 14 May 2021 10:55:37 +0000 (+0800) Subject: release V96 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.js?a=commitdiff_plain;h=2aa8d96af3481d92aec1e4bb38bd5a5a1d4ddd34;p=factoryMode.git release V96 添加 L004测试支持,修复Q3FT Dev版无法正确判断Q3FT硬件。 --- diff --git a/app/release/FactoryMode_V93_202103201204_release.apk b/app/release/FactoryMode_V96_202105141853_release.apk similarity index 94% rename from app/release/FactoryMode_V93_202103201204_release.apk rename to app/release/FactoryMode_V96_202105141853_release.apk index 9cad39c..4687a11 100644 Binary files a/app/release/FactoryMode_V93_202103201204_release.apk and b/app/release/FactoryMode_V96_202105141853_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 19a5567..573deb6 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":93,"versionName":"202103201204","enabled":true,"outputFile":"FactoryMode_V93_202103201204_release.apk","fullName":"release","baseName":"release"},"path":"FactoryMode_V93_202103201204_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":96,"versionName":"202105141853","enabled":true,"outputFile":"FactoryMode_V96_202105141853_release.apk","fullName":"release","baseName":"release"},"path":"FactoryMode_V96_202105141853_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/mobile/miki/util/Config.java b/app/src/main/java/mobile/miki/util/Config.java index e46982e..a3e7d3d 100644 --- a/app/src/main/java/mobile/miki/util/Config.java +++ b/app/src/main/java/mobile/miki/util/Config.java @@ -1,347 +1,359 @@ -package mobile.miki.util; - -import android.app.Application; -import android.content.Context; -import android.content.Intent; - -import java.util.ArrayList; -import java.util.List; - -import mobile.miki.AntiMonitorActivity; -import mobile.miki.BatteryTestActivity; -import mobile.miki.BlooToothActivity; -import mobile.miki.BrightnessTest; -import mobile.miki.CameraPreview; -import mobile.miki.DSPActivity; -import mobile.miki.DialerTestActivity; -import mobile.miki.GpsTest; -import mobile.miki.GravitySensorActivity; -import mobile.miki.HeartRate; -import mobile.miki.KeysTestActivity; -import mobile.miki.MikeTest; -import mobile.miki.MotorTestActivity; -import mobile.miki.MyApplication; -import mobile.miki.PressureActivity; -import mobile.miki.R; -import mobile.miki.RingtoneActivity; -import mobile.miki.SimDetectActivity; -import mobile.miki.SystemMemory; -import mobile.miki.TemperatureActivity; -import mobile.miki.TouchTest; -import mobile.miki.UltravioletMonitorActivity; -import mobile.miki.VersionActivity; -import mobile.miki.WifiTestActiviy; -import mobile.miki.lcd.LcdActivity; -import mobile.miki.mainui.TestMainActivity; - -public class Config { - - private static List TestItems=null; - private static List TestResult=null; - public static void setTestItems(List items){ - - if(items==null){ - Logger.d("setTestItems items is null"); - return ; - } - if (TestItems==null){ - TestItems=new ArrayList(); - TestResult=new ArrayList(); - } - TestItems.clear(); - TestResult.clear(); - - for (int i=0;i< items.size();i++ ) { - TestItems.add(i,items.get(i)); - TestResult.add(i,"false"); - } - - } - - public static int getIndexByTestItemName(String name){ - Logger.d("name "+name+" item "+TestItems); - -// if (TestItems==null) initConfig(MyApplication.getInstance().getApplicationContext()); - if(name!=null && TestItems!=null) { - for (int i = 0; i < TestItems.size(); i++) { - Logger.d("name "+name+" item "+TestItems.get(i)+" "+i); - if (name.equals(TestItems.get(i))) { - return i; - } - } - } - return -1; - } - public static String getNextTestItemName(String testItemmName){ - - int index=-1; - index=getIndexByTestItemName(testItemmName); - Logger.d("find "+testItemmName+", index "+index); - if (TestItems!=null && index >=0&& index+1< TestItems.size()){ - String itemname= TestItems.get(index+1); - return itemname; - }else{ - return null; - } - } - public static String getNextTestItemName(int index){ - if (TestItems!=null && index >=0&& index+1< TestItems.size()){ - return TestItems.get(index+1); - }else{ - return null; - } - } - - public static Intent getNextTestIntent(Context context,Class cls){ - String currentTestItemName=getTestNameByClass(context,cls.getSimpleName()); - Logger.d("currentTestItemName="+currentTestItemName); - String nextTestItemName=getNextTestItemName(currentTestItemName); - Logger.d("nextTestItemName="+nextTestItemName); - return getIntent(context,nextTestItemName); - } - public static String getTestNameByClass(Context context,String ClassName){ - - if (context==null || ClassName==null) return null; - if (ClassName.equals(VersionActivity.class.getSimpleName())) { - return context.getResources().getString(R.string.version_new); - }else if (ClassName.equals(TouchTest.class.getSimpleName())){ - return context.getResources().getString(R.string.touch); - }else if (ClassName.equals(LcdActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.light_new); - }else if (ClassName.equals(CameraPreview.class.getSimpleName())){ - return context.getResources().getString(R.string.camera); - }else if (ClassName.equals(WifiTestActiviy.class.getSimpleName())){ - return context.getResources().getString(R.string.wifi); - }else if (ClassName.equals(GpsTest.class.getSimpleName())){ - return context.getResources().getString(R.string.gps); - }else if (ClassName.equals(RingtoneActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.speak); - }else if (ClassName.equals(MikeTest.class.getSimpleName())){ - return context.getResources().getString(R.string.mic_title); - }else if (ClassName.equals(SimDetectActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.sim_title); - }else if (ClassName.equals(DialerTestActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.dual_new); - }else if (ClassName.equals(SystemMemory.class.getSimpleName())){ - return context.getResources().getString(R.string.ramromTest); - }else if (ClassName.equals(BrightnessTest.class.getSimpleName())){ - return context.getResources().getString(R.string.beiguang_new); - }else if (ClassName.equals(GravitySensorActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.test_sensor); - }else if (ClassName.equals(BatteryTestActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.test_battery); - }else if (ClassName.equals(KeysTestActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.test_keypad); - }else if (ClassName.equals(BlooToothActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.bt); - }else if (ClassName.equals(MotorTestActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.shakeTest); - }else if (ClassName.equals(UltravioletMonitorActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.ultraviolet); - }else if (ClassName.equals(DSPActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.dsp); - }else if (ClassName.equals(HeartRate.class.getSimpleName())) { - return context.getResources().getString(R.string.heartrate); - }else if (ClassName.equals(AntiMonitorActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.anti_check); - }else if (ClassName.equals(TemperatureActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.temperature); - }else if (ClassName.equals(PressureActivity.class.getSimpleName())){ - return context.getResources().getString(R.string.test_pressure); - }else { - - return null; - } - - } - public static Intent getIntent(Context context, String testItemName) { - - if (context==null || testItemName==null) - return (new Intent(context, TestMainActivity.class));; - Intent intent = null; - if (testItemName.equals(context.getResources().getString(R.string.version_new))) { - intent = new Intent(context, VersionActivity.class); - } else if (testItemName.equals(context.getResources().getString(R.string.touch))) { - intent = new Intent(context, TouchTest.class); - } else if (testItemName.equals(context.getResources().getString(R.string.light_new))) { - intent = new Intent(context, LcdActivity.class); - } else if (testItemName.equals(context.getResources().getString(R.string.camera))) { - intent = new Intent(context, CameraPreview.class); - } else if (testItemName.equals(context.getResources().getString(R.string.wifi))) { - intent = new Intent(context, WifiTestActiviy.class); - }else if (testItemName.equals(context.getResources().getString(R.string.gps))) { - intent = new Intent(context, GpsTest.class); - }else if (testItemName.equals(context.getResources().getString(R.string.speak))) { - intent = new Intent(context, RingtoneActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.mic_title))) { - intent = new Intent(context, MikeTest.class); - }else if (testItemName.equals(context.getResources().getString(R.string.sim_title))) { - intent = new Intent(context, SimDetectActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.dual_new))) { - intent = new Intent(context, DialerTestActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.ramromTest))) { - intent = new Intent(context, SystemMemory.class); - }else if (testItemName.equals(context.getResources().getString(R.string.beiguang_new))) { - intent = new Intent(context, BrightnessTest.class); - }else if (testItemName.equals(context.getResources().getString(R.string.test_sensor))) { - intent = new Intent(context, GravitySensorActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.test_battery))) { - intent = new Intent(context, BatteryTestActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.test_keypad))) { - intent = new Intent(context, KeysTestActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.bt))) { - intent = new Intent(context, BlooToothActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.shakeTest))) { - intent = new Intent(context, MotorTestActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.ultraviolet))) { - intent = new Intent(context, UltravioletMonitorActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.dsp))) { - intent = new Intent(context, DSPActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.heartrate))) { - intent = new Intent(context, HeartRate.class); - }else if (testItemName.equals(context.getResources().getString(R.string.anti_check))) { - intent = new Intent(context, AntiMonitorActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.temperature))) { - intent = new Intent(context, TemperatureActivity.class); - }else if (testItemName.equals(context.getResources().getString(R.string.test_pressure))) { - intent = new Intent(context, PressureActivity.class); - } - - if (intent != null) { - intent.putExtra("running", false); - }else{ - intent = new Intent(context, TestMainActivity.class); - } - return intent; - } - public static String getItemAt(int i){ - if (TestItems!=null && i >=0&& i< TestItems.size()){ - return TestItems.get(i); - }else{ - return null; - } - } - public static String getItemResultAt(int i){ - if (TestResult!=null && i >=0&& i< TestResult.size()){ - return TestResult.get(i); - }else{ - return null; - } - } - - public static boolean setTestResult(int i, boolean pass){ - if (TestResult!=null && i >=0&& i< TestResult.size()){ - TestResult.set(i,String.valueOf(pass)); - return true; - } - return false; - } - - public static void initConfig(Context context){ - setTestItems(getArray(context)); - - } - - public static String[] getList(Context context) { - String[] listTem = {context.getString(R.string.version_new), context.getString(R.string.touch), context.getString(R.string.light_new), context.getString(R.string.camera), - context.getString(R.string.wifi), context.getString(R.string.gps), context.getString(R.string.speak), context.getString(R.string.mic_title), - context.getString(R.string.sim_title), context.getString(R.string.dual_new), context.getString(R.string.ramromTest), context.getString(R.string.beiguang_new), - context.getString(R.string.test_sensor), context.getString(R.string.test_battery)}; - return listTem; - } - public static String[] stateArr; - public static List testResultList; - public static List getArray(Context context) { - List list = new ArrayList(); - testResultList = new ArrayList(); - for (int i = 0; i < getList(context).length; i++) { - list.add(getList(context)[i]); - testResultList.add(sharedPreferencesArr[i]); - } - if (FTUtils.isLieBao()) { - list.add(context.getString(R.string.test_keypad)); - testResultList.add("keys"); - } else if (FTUtils.isSugar()) { - list.add(context.getString(R.string.test_keypad)); - list.add(context.getString(R.string.bt)); - list.add(context.getString(R.string.shakeTest)); - list.add(context.getString(R.string.ultraviolet)); - - testResultList.add("keys"); - testResultList.add("bt"); - testResultList.add("vibrator"); - testResultList.add("Ultraviolet"); - } else if (FTUtils.isV20()) { - // s06 添加dsp测试 - list.add(context.getString(R.string.test_keypad)); -// list.add(context.getString(R.string.hall)); -// list.add(context.getString(R.string.bt)); -// list.add(context.getString(R.string.dsp)); - list.add(context.getString(R.string.shakeTest)); - list.add(context.getString(R.string.heartrate)); - list.add(context.getString(R.string.test_pressure)); - - testResultList.add("keys"); -// testResultList.add("bt"); -// testResultList.add("dsp"); - testResultList.add("vibrator"); - testResultList.add("heartrate"); - testResultList.add("pressure"); - - } else if (FTUtils.isQ3FT()){ - list.add(context.getString(R.string.test_keypad)); - list.add(context.getString(R.string.heartrate)); - list.add(context.getString(R.string.temperature)); - list.add(context.getString(R.string.shakeTest)); - list.add(context.getString(R.string.anti_check)); - testResultList.add("keys"); - testResultList.add("heartrate"); - testResultList.add("temperature"); - testResultList.add("vibrator"); - testResultList.add("anti"); - } else if (FTUtils.isQ3F()){ - - list.add(context.getString(R.string.test_keypad)); - list.add(context.getString(R.string.shakeTest)); - list.add(context.getString(R.string.heartrate)); - testResultList.add("keys"); - testResultList.add("vibrator"); - testResultList.add("heartrate"); - }else if (FTUtils.isGT09()) { - list.add(context.getString(R.string.shakeTest)); - testResultList.add("vibrator"); - - list.remove(context.getString(R.string.sim_title)); - list.remove(context.getString(R.string.dual_new)); - testResultList.remove("sim"); - testResultList.remove("dialer"); - } else if (FTUtils.hasHRS_TEMP()){ - - //list.add(context.getString(R.string.test_keypad)); - list.remove(context.getString(R.string.camera)); - list.add(context.getString(R.string.heartrate)); - list.add(context.getString(R.string.temperature)); - list.add(context.getString(R.string.anti_check)); - //testResultList.add("keys"); - testResultList.remove("camera"); - testResultList.add("heartrate"); - testResultList.add("temperature"); - testResultList.add("anti"); - } else if (FTUtils.isC49()){ - list.add(context.getString(R.string.test_keypad)); - list.remove(context.getString(R.string.camera)); - list.add(context.getString(R.string.heartrate)); - list.add(context.getString(R.string.temperature)); - testResultList.add("keys"); - testResultList.remove("camera"); - testResultList.add("heartrate"); - testResultList.add("temperature"); - } - stateArr = new String[testResultList.size()]; - return list; - } - - - static String[] sharedPreferencesArr = {"version", "touch", "lcd", "camera", "wifi", "gps", "speak", "mic", "sim", "dialer", - "watchmemory", "light", "Gsensor", "watchbattery"/*, "keys", "bt", "vibrator", "Ultraviolet", "dsp"*/}; -} +package mobile.miki.util; + +import android.app.Application; +import android.content.Context; +import android.content.Intent; + +import java.util.ArrayList; +import java.util.List; + +import mobile.miki.AntiMonitorActivity; +import mobile.miki.BatteryTestActivity; +import mobile.miki.BlooToothActivity; +import mobile.miki.BrightnessTest; +import mobile.miki.CameraPreview; +import mobile.miki.DSPActivity; +import mobile.miki.DialerTestActivity; +import mobile.miki.GpsTest; +import mobile.miki.GravitySensorActivity; +import mobile.miki.HeartRate; +import mobile.miki.KeysTestActivity; +import mobile.miki.MikeTest; +import mobile.miki.MotorTestActivity; +import mobile.miki.MyApplication; +import mobile.miki.PressureActivity; +import mobile.miki.R; +import mobile.miki.RingtoneActivity; +import mobile.miki.SimDetectActivity; +import mobile.miki.SystemMemory; +import mobile.miki.TemperatureActivity; +import mobile.miki.TouchTest; +import mobile.miki.UltravioletMonitorActivity; +import mobile.miki.VersionActivity; +import mobile.miki.WifiTestActiviy; +import mobile.miki.lcd.LcdActivity; +import mobile.miki.mainui.TestMainActivity; + +public class Config { + + private static List TestItems=null; + private static List TestResult=null; + public static void setTestItems(List items){ + + if(items==null){ + Logger.d("setTestItems items is null"); + return ; + } + if (TestItems==null){ + TestItems=new ArrayList(); + TestResult=new ArrayList(); + } + TestItems.clear(); + TestResult.clear(); + + for (int i=0;i< items.size();i++ ) { + TestItems.add(i,items.get(i)); + TestResult.add(i,"false"); + } + + } + + public static int getIndexByTestItemName(String name){ + Logger.d("name "+name+" item "+TestItems); + +// if (TestItems==null) initConfig(MyApplication.getInstance().getApplicationContext()); + if(name!=null && TestItems!=null) { + for (int i = 0; i < TestItems.size(); i++) { + Logger.d("name "+name+" item "+TestItems.get(i)+" "+i); + if (name.equals(TestItems.get(i))) { + return i; + } + } + } + return -1; + } + public static String getNextTestItemName(String testItemmName){ + + int index=-1; + index=getIndexByTestItemName(testItemmName); + Logger.d("find "+testItemmName+", index "+index); + if (TestItems!=null && index >=0&& index+1< TestItems.size()){ + String itemname= TestItems.get(index+1); + return itemname; + }else{ + return null; + } + } + public static String getNextTestItemName(int index){ + if (TestItems!=null && index >=0&& index+1< TestItems.size()){ + return TestItems.get(index+1); + }else{ + return null; + } + } + + public static Intent getNextTestIntent(Context context,Class cls){ + String currentTestItemName=getTestNameByClass(context,cls.getSimpleName()); + Logger.d("currentTestItemName="+currentTestItemName); + String nextTestItemName=getNextTestItemName(currentTestItemName); + Logger.d("nextTestItemName="+nextTestItemName); + return getIntent(context,nextTestItemName); + } + public static String getTestNameByClass(Context context,String ClassName){ + + if (context==null || ClassName==null) return null; + if (ClassName.equals(VersionActivity.class.getSimpleName())) { + return context.getResources().getString(R.string.version_new); + }else if (ClassName.equals(TouchTest.class.getSimpleName())){ + return context.getResources().getString(R.string.touch); + }else if (ClassName.equals(LcdActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.light_new); + }else if (ClassName.equals(CameraPreview.class.getSimpleName())){ + return context.getResources().getString(R.string.camera); + }else if (ClassName.equals(WifiTestActiviy.class.getSimpleName())){ + return context.getResources().getString(R.string.wifi); + }else if (ClassName.equals(GpsTest.class.getSimpleName())){ + return context.getResources().getString(R.string.gps); + }else if (ClassName.equals(RingtoneActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.speak); + }else if (ClassName.equals(MikeTest.class.getSimpleName())){ + return context.getResources().getString(R.string.mic_title); + }else if (ClassName.equals(SimDetectActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.sim_title); + }else if (ClassName.equals(DialerTestActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.dual_new); + }else if (ClassName.equals(SystemMemory.class.getSimpleName())){ + return context.getResources().getString(R.string.ramromTest); + }else if (ClassName.equals(BrightnessTest.class.getSimpleName())){ + return context.getResources().getString(R.string.beiguang_new); + }else if (ClassName.equals(GravitySensorActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.test_sensor); + }else if (ClassName.equals(BatteryTestActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.test_battery); + }else if (ClassName.equals(KeysTestActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.test_keypad); + }else if (ClassName.equals(BlooToothActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.bt); + }else if (ClassName.equals(MotorTestActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.shakeTest); + }else if (ClassName.equals(UltravioletMonitorActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.ultraviolet); + }else if (ClassName.equals(DSPActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.dsp); + }else if (ClassName.equals(HeartRate.class.getSimpleName())) { + return context.getResources().getString(R.string.heartrate); + }else if (ClassName.equals(AntiMonitorActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.anti_check); + }else if (ClassName.equals(TemperatureActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.temperature); + }else if (ClassName.equals(PressureActivity.class.getSimpleName())){ + return context.getResources().getString(R.string.test_pressure); + }else { + + return null; + } + + } + public static Intent getIntent(Context context, String testItemName) { + + if (context==null || testItemName==null) + return (new Intent(context, TestMainActivity.class));; + Intent intent = null; + if (testItemName.equals(context.getResources().getString(R.string.version_new))) { + intent = new Intent(context, VersionActivity.class); + } else if (testItemName.equals(context.getResources().getString(R.string.touch))) { + intent = new Intent(context, TouchTest.class); + } else if (testItemName.equals(context.getResources().getString(R.string.light_new))) { + intent = new Intent(context, LcdActivity.class); + } else if (testItemName.equals(context.getResources().getString(R.string.camera))) { + intent = new Intent(context, CameraPreview.class); + } else if (testItemName.equals(context.getResources().getString(R.string.wifi))) { + intent = new Intent(context, WifiTestActiviy.class); + }else if (testItemName.equals(context.getResources().getString(R.string.gps))) { + intent = new Intent(context, GpsTest.class); + }else if (testItemName.equals(context.getResources().getString(R.string.speak))) { + intent = new Intent(context, RingtoneActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.mic_title))) { + intent = new Intent(context, MikeTest.class); + }else if (testItemName.equals(context.getResources().getString(R.string.sim_title))) { + intent = new Intent(context, SimDetectActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.dual_new))) { + intent = new Intent(context, DialerTestActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.ramromTest))) { + intent = new Intent(context, SystemMemory.class); + }else if (testItemName.equals(context.getResources().getString(R.string.beiguang_new))) { + intent = new Intent(context, BrightnessTest.class); + }else if (testItemName.equals(context.getResources().getString(R.string.test_sensor))) { + intent = new Intent(context, GravitySensorActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.test_battery))) { + intent = new Intent(context, BatteryTestActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.test_keypad))) { + intent = new Intent(context, KeysTestActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.bt))) { + intent = new Intent(context, BlooToothActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.shakeTest))) { + intent = new Intent(context, MotorTestActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.ultraviolet))) { + intent = new Intent(context, UltravioletMonitorActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.dsp))) { + intent = new Intent(context, DSPActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.heartrate))) { + intent = new Intent(context, HeartRate.class); + }else if (testItemName.equals(context.getResources().getString(R.string.anti_check))) { + intent = new Intent(context, AntiMonitorActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.temperature))) { + intent = new Intent(context, TemperatureActivity.class); + }else if (testItemName.equals(context.getResources().getString(R.string.test_pressure))) { + intent = new Intent(context, PressureActivity.class); + } + + if (intent != null) { + intent.putExtra("running", false); + }else{ + intent = new Intent(context, TestMainActivity.class); + } + return intent; + } + public static String getItemAt(int i){ + if (TestItems!=null && i >=0&& i< TestItems.size()){ + return TestItems.get(i); + }else{ + return null; + } + } + public static String getItemResultAt(int i){ + if (TestResult!=null && i >=0&& i< TestResult.size()){ + return TestResult.get(i); + }else{ + return null; + } + } + + public static boolean setTestResult(int i, boolean pass){ + if (TestResult!=null && i >=0&& i< TestResult.size()){ + TestResult.set(i,String.valueOf(pass)); + return true; + } + return false; + } + + public static void initConfig(Context context){ + setTestItems(getArray(context)); + + } + + public static String[] getList(Context context) { + String[] listTem = {context.getString(R.string.version_new), context.getString(R.string.touch), context.getString(R.string.light_new), context.getString(R.string.camera), + context.getString(R.string.wifi), context.getString(R.string.gps), context.getString(R.string.speak), context.getString(R.string.mic_title), + context.getString(R.string.sim_title), context.getString(R.string.dual_new), context.getString(R.string.ramromTest), context.getString(R.string.beiguang_new), + context.getString(R.string.test_sensor), context.getString(R.string.test_battery)}; + return listTem; + } + public static String[] stateArr; + public static List testResultList; + public static List getArray(Context context) { + List list = new ArrayList(); + testResultList = new ArrayList(); + for (int i = 0; i < getList(context).length; i++) { + list.add(getList(context)[i]); + testResultList.add(sharedPreferencesArr[i]); + } + if (FTUtils.isLieBao()) { + list.add(context.getString(R.string.test_keypad)); + testResultList.add("keys"); + } else if (FTUtils.isSugar()) { + list.add(context.getString(R.string.test_keypad)); + list.add(context.getString(R.string.bt)); + list.add(context.getString(R.string.shakeTest)); + list.add(context.getString(R.string.ultraviolet)); + + testResultList.add("keys"); + testResultList.add("bt"); + testResultList.add("vibrator"); + testResultList.add("Ultraviolet"); + } else if (FTUtils.isV20()) { + // s06 添加dsp测试 + list.add(context.getString(R.string.test_keypad)); +// list.add(context.getString(R.string.hall)); +// list.add(context.getString(R.string.bt)); +// list.add(context.getString(R.string.dsp)); + list.add(context.getString(R.string.shakeTest)); + list.add(context.getString(R.string.heartrate)); + list.add(context.getString(R.string.test_pressure)); + + testResultList.add("keys"); +// testResultList.add("bt"); +// testResultList.add("dsp"); + testResultList.add("vibrator"); + testResultList.add("heartrate"); + testResultList.add("pressure"); + + } else if (FTUtils.isQ3FT()){ + list.add(context.getString(R.string.test_keypad)); + list.add(context.getString(R.string.heartrate)); + list.add(context.getString(R.string.temperature)); + list.add(context.getString(R.string.shakeTest)); + list.add(context.getString(R.string.anti_check)); + testResultList.add("keys"); + testResultList.add("heartrate"); + testResultList.add("temperature"); + testResultList.add("vibrator"); + testResultList.add("anti"); + } else if (FTUtils.isQ3F()){ + + list.add(context.getString(R.string.test_keypad)); + list.add(context.getString(R.string.shakeTest)); + list.add(context.getString(R.string.heartrate)); + testResultList.add("keys"); + testResultList.add("vibrator"); + testResultList.add("heartrate"); + }else if (FTUtils.isGT09()) { + list.add(context.getString(R.string.shakeTest)); + testResultList.add("vibrator"); + + list.remove(context.getString(R.string.sim_title)); + list.remove(context.getString(R.string.dual_new)); + testResultList.remove("sim"); + testResultList.remove("dialer"); + } else if (FTUtils.hasHRS_TEMP()){ + + //list.add(context.getString(R.string.test_keypad)); + list.remove(context.getString(R.string.camera)); + list.add(context.getString(R.string.heartrate)); + list.add(context.getString(R.string.temperature)); + list.add(context.getString(R.string.anti_check)); + //testResultList.add("keys"); + testResultList.remove("camera"); + testResultList.add("heartrate"); + testResultList.add("temperature"); + testResultList.add("anti"); + } else if (FTUtils.isC49()){ + list.add(context.getString(R.string.test_keypad)); + list.remove(context.getString(R.string.camera)); + list.add(context.getString(R.string.heartrate)); + list.add(context.getString(R.string.temperature)); + testResultList.add("keys"); + testResultList.remove("camera"); + testResultList.add("heartrate"); + testResultList.add("temperature"); + } else if (FTUtils.isl004()){ + list.remove(context.getString(R.string.touch)); + testResultList.remove("touch"); + list.remove(context.getString(R.string.camera)); + testResultList.remove("camera"); + list.add(context.getString(R.string.heartrate)); + testResultList.add("heartrate"); + list.add(context.getString(R.string.temperature)); + testResultList.add("temperature"); + list.add(context.getString(R.string.anti_check)); + testResultList.add("anti"); + } + + stateArr = new String[testResultList.size()]; + return list; + } + + + static String[] sharedPreferencesArr = {"version", "touch", "lcd", "camera", "wifi", "gps", "speak", "mic", "sim", "dialer", + "watchmemory", "light", "Gsensor", "watchbattery"/*, "keys", "bt", "vibrator", "Ultraviolet", "dsp"*/}; +} diff --git a/app/src/main/java/mobile/miki/util/FTUtils.java b/app/src/main/java/mobile/miki/util/FTUtils.java index 86e8d22..ce4ca98 100644 --- a/app/src/main/java/mobile/miki/util/FTUtils.java +++ b/app/src/main/java/mobile/miki/util/FTUtils.java @@ -1,298 +1,317 @@ -package mobile.miki.util; - -import android.bluetooth.BluetoothAdapter; -import android.content.Context; -import android.content.SharedPreferences; -import android.os.Build; -import android.os.SystemProperties; -import android.telephony.TelephonyManager; -import android.util.Log; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.lang.reflect.Method; -import java.net.NetworkInterface; -import java.net.SocketException; -import java.util.Enumeration; - -public class FTUtils { - public static String getDISPLAY() { - return Build.DISPLAY.toUpperCase(); - } - - public static String getMODEL() { - return Build.MODEL.toUpperCase(); - } - - private static final String mConfigFilePath="/system/etc/factorymode.cfg"; - public static String isUsingConfigFile(){ - String retempty=""; - File cfgf=new File(mConfigFilePath); - if( cfgf.exists()){ - try { - FileInputStream cfgIS=new FileInputStream(cfgf); - StringBuilder sb=new StringBuilder(); - byte[] buffer=new byte[1024]; - int readcount=0; - while((readcount=cfgIS.read(buffer,0,buffer.length))>0){ - sb.append(new String(buffer,0,readcount)); - } - if(sb.length()>0){ - return sb.toString(); - } - } catch (FileNotFoundException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - return retempty; - } - /** - * 展讯猎豹项目 - * @return - */ - public static boolean isLieBao() { -// return getMODEL().contains("C02A") || getMODEL().contains("S09") || getMODEL().contains("C02"); - return false; - } - - /** - * sugar - * @return - */ - public static boolean isSugar() { -// return getDISPLAY().contains("W501CS") || getMODEL().contains("SUGAR"); - return false; - } - - public static boolean doPCBATest(){ - return false; - } - public static void SetPreferences(Context paramContext, int paramInt, - Long time) { - SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest", 0); - String str = paramContext.getResources().getString(paramInt); - SharedPreferences.Editor localEditor = sharedPreferences.edit(); - localEditor.putLong(str, time); - localEditor.commit(); - } - - public static long GetPreferences(Context paramContext, int paramInt) { - SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest", 0); - String str = paramContext.getResources().getString(paramInt); - long time = sharedPreferences.getLong(str, 0); - return time; - } - - public static void SetAgeingWorktimePreferences(Context paramContext, int paramInt, - int time) { - SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest_workTime", 0); - String str = paramContext.getResources().getString(paramInt); - SharedPreferences.Editor localEditor = sharedPreferences.edit(); - localEditor.putInt(str, time); - localEditor.commit(); - } - - public static int GetAgeingWorktimePreferences(Context paramContext, int paramInt) { - SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest_workTime", 0); - String str = paramContext.getResources().getString(paramInt); - int time = sharedPreferences.getInt(str, 0); - return time; - } - - - /** - * android 7.0及以上 (2)扫描各个网络接口获取mac地址 - * - */ - /** - * 获取设备HardwareAddress地址 - * - * @return - */ - public static String getWifiMacAddress() { - Enumeration interfaces = null; - try { - interfaces = NetworkInterface.getNetworkInterfaces(); - } catch (SocketException e) { - e.printStackTrace(); - } - String hardWareAddress = null; - NetworkInterface iF = null; - if (interfaces == null) { - return null; - } - while (interfaces.hasMoreElements()) { - iF = interfaces.nextElement(); - try { - hardWareAddress = bytesToString(iF.getHardwareAddress()); - if (hardWareAddress != null) - break; - } catch (SocketException e) { - e.printStackTrace(); - } - } - return hardWareAddress; - } - - /*** - * byte转为String - * - * @param bytes - * @return - */ - private static String bytesToString(byte[] bytes) { - if (bytes == null || bytes.length == 0) { - return null; - } - StringBuilder buf = new StringBuilder(); - for (byte b : bytes) { - buf.append(String.format("%02X:", b)); - } - if (buf.length() > 0) { - buf.deleteCharAt(buf.length() - 1); - } - return buf.toString(); - } - - - - // 展讯获取cid - public static String GetCidFromSystem() { - String cid_file = SystemProperties.get("ro.product.partitionpath", "") + "miscdata"; - byte[] resCid = new byte[16]; - try { - byte[] buf = new byte[50]; - FileInputStream inputStream = new FileInputStream(cid_file); - int len = inputStream.read(buf); - if (len < 50) return null; - for (int i = 0; i < 16; i++) { - resCid[i] = buf[i + 28]; - } -// for (int i = 0; i < 16; i++) { -// if ((resCid[i] >= 0x30 && resCid[i] <= 0x39) || (resCid[i] >= 0x61 && resCid[i] <= 0x7A) || (resCid[i] >= 0x41 && resCid[i] <= 0x5A)) { -// // valid -// } else { -// // invalid -// for (int j = 28; j < 28 + 16; j++) { -// resCid[j] = 0x30; -// } -// break; -// } -// } - } catch (Exception e) { - e.printStackTrace(); - } - String cid = new String(resCid); - Log.d("FTUtils", "get cid=" + cid); - return cid; - } - - public static String getImei(Context context) { - TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); - String imei = ""; - - Class clazz = null; - if (manager != null) { - clazz = manager.getClass(); - } - - try { - Method getImei = null; - if (clazz != null) { - getImei = clazz.getDeclaredMethod("getImei"); - } - if (getImei != null) { - getImei.setAccessible(true); - imei = (String) getImei.invoke(manager); - } - } catch (Exception e) { - e.printStackTrace(); - } - return imei; - } - - public static String getBtAddressViaReflection() { - return BluetoothAdapter.getDefaultAdapter().getAddress(); - } - public static boolean isL05() { - if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("l05")) - { - return true; - } - return false; - } - public static boolean isS06() { -// if (SystemProperties.get("ro.product.brand", "").equalsIgnoreCase("SPRD") && SystemProperties.get("ro.build.version.release", "").equalsIgnoreCase("8.1.0")) { -// return true; -// } - return false; - } - - public static boolean isA9(){ - if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("A9") - || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("YQ")) { - - return true; - } - return false; - } - public static boolean isV20(){ - if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("V20") - || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("C46")) { - - return true; - } - return false; - } - - public static boolean isGT09(){ - if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("GT09") - || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("GT09")) { - - return true; - } - return false; - } - - public static boolean isQ3FT(){ - - if ( SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("VitracK") || - SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("wtsrui") - ) { - return true; - } - return false; - } - public static boolean isQ3F(){ - - if (getMODEL().contains("C41-QL02")||getMODEL().contains("C41S-QL02")|| SystemProperties.get("ro.product.isQ3F","").equalsIgnoreCase("true") || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("q3f")) { - return true; - } - return false; - } - public static boolean hasHRS_TEMP(){ - - if (getMODEL().contains("H88") - ||SystemProperties.get("ro.product.isH88","").equalsIgnoreCase("true") - || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("H88") - || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("A9") - || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("YQ") - ) { - return true; - } - return false; - } - - public static boolean isC49(){ - if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("MW13M") - || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("MW13C") - ){ - return true; - } - return false; - } -} +package mobile.miki.util; + +import android.bluetooth.BluetoothAdapter; +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Build; +import android.os.SystemProperties; +import android.telephony.TelephonyManager; +import android.util.Log; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.lang.reflect.Method; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.util.Enumeration; + +public class FTUtils { + public static String getDISPLAY() { + return Build.DISPLAY.toUpperCase(); + } + + public static String getMODEL() { + return Build.MODEL.toUpperCase(); + } + + private static final String mConfigFilePath="/system/etc/factorymode.cfg"; + public static String isUsingConfigFile(){ + String retempty=""; + File cfgf=new File(mConfigFilePath); + if( cfgf.exists()){ + try { + FileInputStream cfgIS=new FileInputStream(cfgf); + StringBuilder sb=new StringBuilder(); + byte[] buffer=new byte[1024]; + int readcount=0; + while((readcount=cfgIS.read(buffer,0,buffer.length))>0){ + sb.append(new String(buffer,0,readcount)); + } + if(sb.length()>0){ + return sb.toString(); + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return retempty; + } + /** + * 展讯猎豹项目 + * @return + */ + public static boolean isLieBao() { +// return getMODEL().contains("C02A") || getMODEL().contains("S09") || getMODEL().contains("C02"); + return false; + } + + /** + * sugar + * @return + */ + public static boolean isSugar() { +// return getDISPLAY().contains("W501CS") || getMODEL().contains("SUGAR"); + return false; + } + + public static boolean doPCBATest(){ + return false; + } + public static void SetPreferences(Context paramContext, int paramInt, + Long time) { + SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest", 0); + String str = paramContext.getResources().getString(paramInt); + SharedPreferences.Editor localEditor = sharedPreferences.edit(); + localEditor.putLong(str, time); + localEditor.commit(); + } + + public static long GetPreferences(Context paramContext, int paramInt) { + SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest", 0); + String str = paramContext.getResources().getString(paramInt); + long time = sharedPreferences.getLong(str, 0); + return time; + } + + public static void SetAgeingWorktimePreferences(Context paramContext, int paramInt, + int time) { + SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest_workTime", 0); + String str = paramContext.getResources().getString(paramInt); + SharedPreferences.Editor localEditor = sharedPreferences.edit(); + localEditor.putInt(str, time); + localEditor.commit(); + } + + public static int GetAgeingWorktimePreferences(Context paramContext, int paramInt) { + SharedPreferences sharedPreferences = paramContext.getSharedPreferences("AgingTest_workTime", 0); + String str = paramContext.getResources().getString(paramInt); + int time = sharedPreferences.getInt(str, 0); + return time; + } + + + /** + * android 7.0及以上 (2)扫描各个网络接口获取mac地址 + * + */ + /** + * 获取设备HardwareAddress地址 + * + * @return + */ + public static String getWifiMacAddress() { + Enumeration interfaces = null; + try { + interfaces = NetworkInterface.getNetworkInterfaces(); + } catch (SocketException e) { + e.printStackTrace(); + } + String hardWareAddress = null; + NetworkInterface iF = null; + if (interfaces == null) { + return null; + } + while (interfaces.hasMoreElements()) { + iF = interfaces.nextElement(); + try { + hardWareAddress = bytesToString(iF.getHardwareAddress()); + if (hardWareAddress != null) + break; + } catch (SocketException e) { + e.printStackTrace(); + } + } + return hardWareAddress; + } + + /*** + * byte转为String + * + * @param bytes + * @return + */ + private static String bytesToString(byte[] bytes) { + if (bytes == null || bytes.length == 0) { + return null; + } + StringBuilder buf = new StringBuilder(); + for (byte b : bytes) { + buf.append(String.format("%02X:", b)); + } + if (buf.length() > 0) { + buf.deleteCharAt(buf.length() - 1); + } + return buf.toString(); + } + + + + // 展讯获取cid + public static String GetCidFromSystem() { + String cid_file = SystemProperties.get("ro.product.partitionpath", "") + "miscdata"; + byte[] resCid = new byte[16]; + try { + byte[] buf = new byte[50]; + FileInputStream inputStream = new FileInputStream(cid_file); + int len = inputStream.read(buf); + if (len < 50) return null; + for (int i = 0; i < 16; i++) { + resCid[i] = buf[i + 28]; + } +// for (int i = 0; i < 16; i++) { +// if ((resCid[i] >= 0x30 && resCid[i] <= 0x39) || (resCid[i] >= 0x61 && resCid[i] <= 0x7A) || (resCid[i] >= 0x41 && resCid[i] <= 0x5A)) { +// // valid +// } else { +// // invalid +// for (int j = 28; j < 28 + 16; j++) { +// resCid[j] = 0x30; +// } +// break; +// } +// } + } catch (Exception e) { + e.printStackTrace(); + } + String cid = new String(resCid); + Log.d("FTUtils", "get cid=" + cid); + return cid; + } + + public static String getImei(Context context) { + TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + String imei = ""; + + Class clazz = null; + if (manager != null) { + clazz = manager.getClass(); + } + + try { + Method getImei = null; + if (clazz != null) { + getImei = clazz.getDeclaredMethod("getImei"); + } + if (getImei != null) { + getImei.setAccessible(true); + imei = (String) getImei.invoke(manager); + } + } catch (Exception e) { + e.printStackTrace(); + } + return imei; + } + + public static String getBtAddressViaReflection() { + return BluetoothAdapter.getDefaultAdapter().getAddress(); + } + public static boolean isL05() { + if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("l05")) + { + return true; + } + return false; + } + public static boolean isS06() { +// if (SystemProperties.get("ro.product.brand", "").equalsIgnoreCase("SPRD") && SystemProperties.get("ro.build.version.release", "").equalsIgnoreCase("8.1.0")) { +// return true; +// } + return false; + } + + public static boolean isA9(){ + if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("A9") + || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("YQ")) { + + return true; + } + return false; + } + public static boolean isV20(){ + if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("V20") + || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("C46")) { + + return true; + } + return false; + } + + public static boolean isGT09(){ + if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("GT09") + || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("GT09") + ) { + + return true; + } + return false; + } + + public static boolean isQ3FT(){ + + if ( SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("VitracK") || + SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("wtsrui") + || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("q3ft") + ) { + return true; + } + return false; + } + public static boolean isQ3F(){ + + if (getMODEL().contains("C41-QL02")||getMODEL().contains("C41S-QL02")|| SystemProperties.get("ro.product.isQ3F","").equalsIgnoreCase("true") || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("q3f")) { + return true; + } + return false; + } + public static boolean hasHRS_TEMP(){ + + if (getMODEL().contains("H88") + ||SystemProperties.get("ro.product.isH88","").equalsIgnoreCase("true") + || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("H88") + || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("A9") + || SystemProperties.get("persist.sys.customname","").equalsIgnoreCase("YQ") + ) { + return true; + } + return false; + } + + public static boolean isl004(){ + if( + SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("l004pt") + ){ + return true; + } + return false; + + } + public static boolean isC49(){ + if(SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("MW13M") + || SystemProperties.get("persist.sys.id_num","").equalsIgnoreCase("MW13C") + ){ + return true; + } + return false; + } + public static boolean notTuch(){ + if( + isl004() + ) + return true; + else + return false; + } +} diff --git a/app/version_code.properties b/app/version_code.properties index bc2deb6..62fb3fe 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Sat Mar 20 12:04:10 CST 2021 -VERSION_CODE=93 +#Fri May 14 18:53:15 CST 2021 +VERSION_CODE=96