不再入EQC的库了,白名单
authorTrillGates <williamtrillgates@gmail.com>
Fri, 24 Dec 2021 13:56:02 +0000 (21:56 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Fri, 24 Dec 2021 13:56:02 +0000 (21:56 +0800)
app/release/ICSer_V1019_2112242133_release.apk [new file with mode: 0644]
app/release/output.json
app/src/main/java/com/ic/protocols/protocol_s123.java
app/version_code.properties

diff --git a/app/release/ICSer_V1019_2112242133_release.apk b/app/release/ICSer_V1019_2112242133_release.apk
new file mode 100644 (file)
index 0000000..45f9dff
Binary files /dev/null and b/app/release/ICSer_V1019_2112242133_release.apk differ
index 49ba423..b56846a 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1018,"versionName":"2112142040","enabled":true,"outputFile":"ICSer_V1018_2112142040_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1018_2112142040_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1019,"versionName":"2112242133","enabled":true,"outputFile":"ICSer_V1019_2112242133_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1019_2112242133_release.apk","properties":{}}]
\ No newline at end of file
index 41e29cc..e025ae3 100644 (file)
@@ -1317,39 +1317,40 @@ public class protocol_s123 {
             ContentResolver resolver = runtime.getContextProxy().getResolver();
             //添加之前先删除白名单的内容
             //删除第0组
-            resolver.delete(Uri.parse(ICMembersProvider.MEMBERS), "type=? and group_type is null", new String[]{
-                    ICDatabaseHelper.MemberType.WHITE_LIST + ""
-            });
-            resolver.delete(Uri.parse(ICMembersProvider.MEMBERS), "type=? and group_type=?", new String[]{
-                    ICDatabaseHelper.MemberType.WHITE_LIST + "", "0"
-            });
+            resolver.delete(Uri.parse(ICMembersProvider.MEMBERS),
+                    "type=? and group_type is null", new String[]{
+                            ICDatabaseHelper.MemberType.WHITE_LIST + ""
+                    });
+            resolver.delete(Uri.parse(ICMembersProvider.MEMBERS),
+                    "type=? and group_type=?", new String[]{
+                            ICDatabaseHelper.MemberType.WHITE_LIST + "", "0"
+                    });
             //从记录上看,
             for (int i = 0; i < phnums.length; i++) {
                 String[] tmp = phnums[i].split("\\|");
                 if (tmp.length == 2) {
                     String name = Util.decodeUnicode2Utf8(tmp[0]);
-                    String phonem = tmp[1];
-                    ICLogger.i("phnums[" + i + "]=" + phnums[i] + ",split = " + tmp.length + " , name=" + name + ",-" + phonem);
-                    contactArray.add(new Contact(Contact.CATEGORY_CALL, name, phonem));
+                    String phoneNum = tmp[1];
+                    ICLogger.i("phnums[" + i + "]=" + phnums[i] + ",split = " + tmp.length + " , name=" + name + ",-" + phoneNum);
+                    contactArray.add(new Contact(Contact.CATEGORY_CALL, name, phoneNum));
                     ContentValues contentValues = new ContentValues();
                     contentValues.put(ICDatabaseHelper.fType, ICDatabaseHelper.MemberType.WHITE_LIST);
-                    contentValues.put(ICDatabaseHelper.fPhoneNum, phonem);
+                    contentValues.put(ICDatabaseHelper.fPhoneNum, phoneNum);
                     contentValues.put(ICDatabaseHelper.fUserName, name);
                     //这个是第0组
                     contentValues.put(ICDatabaseHelper.fGroup, 0);
                     contentValues.put(ICDatabaseHelper.fCreateTime, System.currentTimeMillis());
                     contentValues.put(ICDatabaseHelper.fUpdateTime, System.currentTimeMillis());
                     resolver.insert(Uri.parse(ICMembersProvider.MEMBERS), contentValues);
+                    ICLogger.d("insert completed..");
                 } else {
                     ICLogger.i("phnums[" + i + "]=" + phnums[i] + ",split = " + tmp.length);
                 }
             }
-            runtime.getDbHelper().saveContacts(contactArray,
-                    false, false, true, false, false, false);
+            //runtime.getDbHelper().saveContacts(contactArray, false, false, true, false, false, false);
         } else {
             ICLogger.i(" BP14 format error!");
         }
-
     }
 
 
@@ -1941,26 +1942,24 @@ public class protocol_s123 {
                     voiceContent.serverTime = TimeUtil.getSystemTime3();
                     voiceContent.preview = String.valueOf(Util.getDuration(voiceContent.content));
                     runtime.getDbHelper().updateMessage(voiceContent, uri2);
-//                runtime.getContextProxy().sendBroadcast(ACTION_IMESSAGE, runtime);
+                    //runtime.getContextProxy().sendBroadcast(ACTION_IMESSAGE, runtime);
                     connection.DeliverCMDMessageToSystem("NewVoice", amrFilepath);//通知下面线程状态变化
                 }
             } catch (Exception e) {
                 ICLogger.e(e.getMessage(), e);
             }
-
         } else {
             log("handleBP28", "format Error");
-//            connection.send(genStringMessage("AP28",AP28(Name,appendIndex,packetCount,currentId,0)));
+            //connection.send(genStringMessage("AP28",AP28(Name,appendIndex,packetCount,currentId,0)));
         }
-
     }
 
     public void sendBroadcast(String cmd, Runtime dev) {
-
-        ComponentName componentName = new ComponentName("com.eqc.watch", "com.eqc.watch.launcher.ChatActivity");
+        ComponentName componentName = new ComponentName("com.eqc.watch",
+                "com.eqc.watch.launcher.ChatActivity");
         Intent intent = new Intent("android.intent.action.MAIN");
-//              intent.putExtra("ACTIVITY_TYPE", 2);
-//              intent.addCategory("android.intent.category.DEFAULT");
+        //intent.putExtra("ACTIVITY_TYPE", 2);
+        //intent.addCategory("android.intent.category.DEFAULT");
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         intent.setComponent(componentName);
         dev.getContextProxy().context.startActivity(intent);
@@ -1968,7 +1967,6 @@ public class protocol_s123 {
 
     //白名单开关(下行协议号:BP84,响应:AP84)
     public static StringMessage AP84(String index, int success) {
-
         //设备响应:      IWAP80,080835,1#
         //080835:指令流水号
         //1:表示设备执行成功,0 表示设备执行失败
@@ -1980,7 +1978,7 @@ public class protocol_s123 {
     }
 
     public void handleBP84(String cmd, Connection connection) {
-//示例:
+        //示例:
         //IWBP84,353456789012345,080835,1#
         //说明:
         //IW:标识符
@@ -2002,12 +2000,10 @@ public class protocol_s123 {
         } else {
             ICLogger.i("BP84 format error!");
         }
-
     }
 
     //17.绑定解绑(下行协议号:BP68,响应:AP68)
     public static StringMessage AP68(String index, String cmd) {
-
         //设备响应:      IWAP86, 080835,1#
         //080835:指令流水号
         return genStringMessage("AP86", new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP68))
@@ -3926,7 +3922,7 @@ public class protocol_s123 {
      * @param cmd
      */
     private void handleBP99(String cmd) {
-        //IWBP99,866671044898063,33936,https://www.baidu.com
+        //IWBP99,866671044898063,33936,https://www.baidu.com#
         //解析数据,设置数据
         String[] split = cmd.split(CMDSPLIT);
         if (split.length == 4) {
index 9e98190..9ebaecd 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Dec 14 20:40:52 CST 2021\r
-VERSION_CODE=1018\r
+#Fri Dec 24 21:33:01 CST 2021\r
+VERSION_CODE=1019\r