completed encode issues.
authorTrillGates <williamtrillgates@gmail.com>
Wed, 1 Sep 2021 09:46:07 +0000 (17:46 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Wed, 1 Sep 2021 09:46:07 +0000 (17:46 +0800)
app/release/ICSer_V936_2109011634_release.apk [moved from app/release/ICSer_V934_2109011157_release.apk with 77% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/utils/Util.java
app/src/main/java/com/ic/protocols/protocol_s123.java
app/version_code.properties

similarity index 77%
rename from app/release/ICSer_V934_2109011157_release.apk
rename to app/release/ICSer_V936_2109011634_release.apk
index 53e6a3d..27db775 100644 (file)
Binary files a/app/release/ICSer_V934_2109011157_release.apk and b/app/release/ICSer_V936_2109011634_release.apk differ
index 5f9e35f..83c3a63 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":934,"versionName":"2109011157","enabled":true,"outputFile":"ICSer_V934_2109011157_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V934_2109011157_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":936,"versionName":"2109011634","enabled":true,"outputFile":"ICSer_V936_2109011634_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V936_2109011634_release.apk","properties":{}}]
\ No newline at end of file
index 99f7051..6cbb5c0 100644 (file)
@@ -243,18 +243,19 @@ public class Util {
             Character.UnicodeBlock ub = Character.UnicodeBlock.of(myBuffer[i]);
             if (ub == Character.UnicodeBlock.BASIC_LATIN) {
                 //英文及数字等
-                sb.append(myBuffer[i]);
+                short s = (short) myBuffer[i];
+                String hexS = Integer.toHexString(s);
+                sb.append("00").append(hexS.toLowerCase());
             } else if (ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) {
                 //全角半角字符
-                int j = (int) myBuffer[i] - 65248;
-                sb.append((char) j);
+                short j = (short) ((short) myBuffer[i] - 65248);
+                String hexS = Integer.toHexString(j);
+                sb.append("00").append(hexS);
             } else {
                 //汉字
                 short s = (short) myBuffer[i];
                 String hexS = Integer.toHexString(s);
-//                String unicode = "\\u" + hexS;
-                String unicode = hexS;
-                sb.append(unicode.toLowerCase());
+                sb.append(hexS.toLowerCase());
             }
         }
         return sb.toString();
index 3609af4..5fa7340 100644 (file)
@@ -609,14 +609,12 @@ public class protocol_s123 {
         } else {
             return "";
         }
-
         for (CMD_TYPE key : cmdMap.keySet()) {
             if (msg.startsWith(CMDHEADER + cmdMap.get(key))) {
                 ICLogger.i("found cmd keyid=" + key + " ,keyname=" + cmdMap.get(key));
                 return cmdMap.get(key);
             }
         }
-
         return "";
     }
 
@@ -2992,7 +2990,12 @@ public class protocol_s123 {
             responseText = "";
             type = "1";
         }
+        //AP94
         ICLogger.d("responseText ==> " + responseText);
+        String encode = Util.utf8ToUnicode(responseText);
+        ICLogger.d("encode ==> " + encode);
+        String result = Util.decodeUnicode2Utf8(encode);
+        ICLogger.d("parse result ===> " + result);
         //在UI逻辑中,只要有处理就都是已经阅读。所以不存在取消阅读的说法。
         return genStringMessage(cmdMap.get(CMD_TYPE.AP94),
                 new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP94))
index 8d18ed6..9fd1a2e 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Sep 01 11:57:24 CST 2021\r
-VERSION_CODE=934\r
+#Wed Sep 01 16:34:35 CST 2021\r
+VERSION_CODE=936\r