[Feature][T8TSK-291]modify the sensitive information in syslog (imei log)
Only Configure: No
Affected branch: GSW3.0-No-Connman
Affected module: log
Is it affected on both ZXIC and MTK: only MTK
Self-test: Yes
Doc Update: No
Change-Id: Ifa0d8f28791a0a58ab8d8a4e3176675d6c05d7ea
diff --git a/framework/lynq-ril-service/src/ril.cpp b/framework/lynq-ril-service/src/ril.cpp
index 01829e2..a30b0af 100755
--- a/framework/lynq-ril-service/src/ril.cpp
+++ b/framework/lynq-ril-service/src/ril.cpp
@@ -306,6 +306,7 @@
static int responseString(Parcel &p, void *response, size_t responselen);
//xf.li@20231120 modify for T8TSK-291 start
static int responseStringNoLog(Parcel &p, void *response, size_t responselen);
+static int responseStringsNoLog(Parcel &p, void *response, size_t responselen);
//xf.li@20231120 modify for T8TSK-291 end
static int responseVoid(Parcel &p, void *response, size_t responselen);
static int responseCallList(Parcel &p, void *response, size_t responselen);
@@ -2181,6 +2182,43 @@
writeStringToParcel(p, (const char *)response);
return 0;
}
+
+static int responseStringsNoLog(Parcel &p, void *response, size_t responselen) {
+ int numStrings;
+ char log_buf[512] = {0};
+
+ if (response == NULL && responselen != 0) {
+ RLOGE("invalid response: NULL");
+ return RIL_ERRNO_INVALID_RESPONSE;
+ }
+ if (responselen % sizeof(char *) != 0) {
+ RLOGE("responseStrings: invalid response length %d expected multiple of %d\n",
+ (int)responselen, (int)sizeof(char *));
+ return RIL_ERRNO_INVALID_RESPONSE;
+ }
+
+ if (response == NULL) {
+ p.writeInt32 (0);
+ } else {
+ char **p_cur = (char **) response;
+
+ numStrings = responselen / sizeof(char *);
+ p.writeInt32 (numStrings);
+
+ /* each string*/
+ startResponse;
+ for (int i = 0 ; i < numStrings ; i++) {
+ //appendPrintBuf("%s%s,", printBuf, (char*)p_cur[i]);
+ memset(log_buf, 0, sizeof(log_buf));
+ snprintf(log_buf, sizeof(log_buf), "%s,", (char*)p_cur[i]);
+ encode_log(log_buf, 6);
+ writeStringToParcel (p, p_cur[i]);
+ }
+ removeLastChar;
+ closeResponse;
+ }
+ return 0;
+}
//xf.li@20231120 modify for T8TSK-291 end
static int responseVoid(Parcel &p, void *response, size_t responselen) {
startResponse;