From: TrillGates Date: Mon, 6 Sep 2021 02:34:30 +0000 (+0800) Subject: add white list triggle. X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=4e0fb7850df7d615dfa51b63529a8e9c305978d5;p=icsupport.git add white list triggle. --- diff --git a/app/release/ICSer_V945_2109031850_release.apk b/app/release/ICSer_V946_2109041740_release.apk similarity index 78% rename from app/release/ICSer_V945_2109031850_release.apk rename to app/release/ICSer_V946_2109041740_release.apk index b20780a5..7646eb2a 100644 Binary files a/app/release/ICSer_V945_2109031850_release.apk and b/app/release/ICSer_V946_2109041740_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 0d7dc60b..9bd395f9 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":945,"versionName":"2109031850","enabled":true,"outputFile":"ICSer_V945_2109031850_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V945_2109031850_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":946,"versionName":"2109041740","enabled":true,"outputFile":"ICSer_V946_2109041740_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V946_2109041740_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 95632d3c..fc56c25a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -103,6 +103,7 @@ + " + state); + ICLogger.d("phoneNumber == > " + phoneNumber); + if (state == TelephonyManager.CALL_STATE_IDLE) { + Util.setSystemProperties("persist.sys.call.monitor", "false"); + ICLogger.d("persist.sys.call.monitor ==> " + Util.getSystemProperties("persist.sys.call.monitor")); + } + } + }, PhoneStateListener.LISTEN_CALL_STATE); } public void initObserver() { diff --git a/app/src/main/java/com/enqualcomm/support/utils/Util.java b/app/src/main/java/com/enqualcomm/support/utils/Util.java index 6cbb5c0c..45eee59d 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/Util.java +++ b/app/src/main/java/com/enqualcomm/support/utils/Util.java @@ -458,19 +458,12 @@ public class Util { } static public void setSystemProperties(String key, int defaultValue) { - String value = String.valueOf(defaultValue); - try { - Class c = Class.forName("android.os.SystemProperties"); - Method set = c.getMethod("set", String.class, String.class); - set.invoke(c, key, value); - } catch (Exception e) { - e.printStackTrace(); ICLogger.e(e.getMessage(), e); } diff --git a/app/src/main/java/com/ic/protocols/protocolAPIHelper.java b/app/src/main/java/com/ic/protocols/protocolAPIHelper.java index 0e3b99e7..d3705997 100644 --- a/app/src/main/java/com/ic/protocols/protocolAPIHelper.java +++ b/app/src/main/java/com/ic/protocols/protocolAPIHelper.java @@ -1275,7 +1275,7 @@ public class protocolAPIHelper { ret = null; break; case Config.PROTOCOL_FZD: - ret = protocolfzd_handler.MEMBERS(); + //ret = protocolfzd_handler.MEMBERS(); break; case Config.PROTOCOL_MQTT: ret = null; @@ -1322,7 +1322,7 @@ public class protocolAPIHelper { ret = null; break; case Config.PROTOCOL_FZD: - ret = protocolfzd_handler.AGREG(); + // ret = protocolfzd_handler.AGREG(); break; case Config.PROTOCOL_MQTT: ret = null; diff --git a/app/src/main/java/com/ic/protocols/protocol_fzd.java b/app/src/main/java/com/ic/protocols/protocol_fzd.java index 1ef67cd1..eb8687b7 100644 --- a/app/src/main/java/com/ic/protocols/protocol_fzd.java +++ b/app/src/main/java/com/ic/protocols/protocol_fzd.java @@ -2280,6 +2280,13 @@ public class protocol_fzd { values.put(ICDatabaseHelper.sKey, cmdMap.get(cmd)); values.put(ICDatabaseHelper.sValue, data); resolver.insert(Uri.parse(ICGlobalSettingsProvider.SETTINGS), values); + + if (data.equals("1")) { + Util.setSystemProperties("persist.sys.whitelist.enable", "true"); + } else { + Util.setSystemProperties("persist.sys.whitelist.enable", "false"); + } + ICLogger.i("收到服务器指令:白名单" + (data.equals("1") ? "开" : "关")); } /** @@ -2379,11 +2386,13 @@ public class protocol_fzd { private void doCall(String data, Runtime runtime) { //拨号 Intent intent = new Intent(Intent.ACTION_CALL); + ICLogger.d("do call number ==> " + data); intent.setData(Uri.parse("tel:" + data)); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); if (ActivityCompat.checkSelfPermission(runtime.getContextProxy().context, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { ICLogger.d("no permission to call..."); + Util.setSystemProperties("persist.sys.call.monitor", "false"); return; } runtime.getContextProxy().context.startActivity(intent); diff --git a/app/version_code.properties b/app/version_code.properties index c458a104..0f5932bc 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Fri Sep 03 18:50:54 CST 2021 -VERSION_CODE=945 +#Sat Sep 04 17:40:07 CST 2021 +VERSION_CODE=946