add white list triggle.
authorTrillGates <williamtrillgates@gmail.com>
Mon, 6 Sep 2021 02:34:30 +0000 (10:34 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 6 Sep 2021 02:34:30 +0000 (10:34 +0800)
app/release/ICSer_V946_2109041740_release.apk [moved from app/release/ICSer_V945_2109031850_release.apk with 78% similarity]
app/release/output.json
app/src/main/AndroidManifest.xml
app/src/main/java/com/enqualcomm/support/service/PhoneCallListener.java
app/src/main/java/com/enqualcomm/support/utils/Util.java
app/src/main/java/com/ic/protocols/protocolAPIHelper.java
app/src/main/java/com/ic/protocols/protocol_fzd.java
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V945_2109031850_release.apk
rename to app/release/ICSer_V946_2109041740_release.apk
index b20780a..7646eb2 100644 (file)
Binary files a/app/release/ICSer_V945_2109031850_release.apk and b/app/release/ICSer_V946_2109041740_release.apk differ
index 0d7dc60..9bd395f 100644 (file)
@@ -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
index 95632d3..fc56c25 100644 (file)
     <protected-broadcast android:name="com.enqualcomm.support.ACTION_ISCONNECTED" />
     <protected-broadcast android:name="com.eqc.deskclock.YUN_ALARM_CHANGE" />
     <protected-broadcast android:name="com.enqualcomm.support.sos" />
+    
 
     <application
         android:name=".ICApplication"
index 5301806..c382f2b 100644 (file)
@@ -6,11 +6,15 @@ import android.content.Context;
 import android.database.ContentObserver;
 import android.database.Cursor;
 import android.net.Uri;
+import android.telephony.PhoneStateListener;
+import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.Log;
 
 import com.enqualcomm.support.provider.ICDatabaseHelper;
 import com.enqualcomm.support.provider.ICNotificationProvider;
+import com.enqualcomm.support.utils.ICLogger;
+import com.enqualcomm.support.utils.Util;
 
 import static com.enqualcomm.support.provider.ICGlobalSettingsProvider.SETTINGS;
 import static com.enqualcomm.support.provider.ICMembersProvider.MEMBERS;
@@ -26,6 +30,18 @@ public class PhoneCallListener {
 
     public PhoneCallListener(Context context) {
         this.mContext = context;
+        TelephonyManager telephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
+        telephonyManager.listen(new PhoneStateListener() {
+            @Override
+            public void onCallStateChanged(int state, String phoneNumber) {
+                ICLogger.d("state == > " + 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() {
index 6cbb5c0..45eee59 100644 (file)
@@ -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);
         }
index 0e3b99e..d370599 100644 (file)
@@ -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;
index 1ef67cd..eb8687b 100644 (file)
@@ -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);
index c458a10..0f5932b 100644 (file)
@@ -1,2 +1,2 @@
-#Fri Sep 03 18:50:54 CST 2021\r
-VERSION_CODE=945\r
+#Sat Sep 04 17:40:07 CST 2021\r
+VERSION_CODE=946\r