From ff990384bc66434168706c17644226b87a239069 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Fri, 24 May 2024 18:05:59 +0800 Subject: [PATCH] =?UTF-8?q?[644][adas]=20=E6=B7=BB=E5=8A=A0VIN=E7=A0=81?= =?UTF-8?q?=E8=A7=A3=E6=9E=90=E4=BB=A5=E5=8F=8A=E5=B1=95=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=A0=E4=B8=BA=E8=AF=81=E4=B9=A6=E5=B0=BE?= =?UTF-8?q?=E9=83=A8\n=E5=AF=BC=E8=87=B4=E7=9A=84=E5=9F=9F=E6=8E=A7?= =?UTF-8?q?=E8=AF=81=E4=B9=A6=E6=A0=A1=E9=AA=8C=E5=A4=B1=E8=B4=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libraries/mogo-adas-data/src/main/proto/message_pad.proto | 3 ++- .../zhidao/support/adas/high/common/CertificateUtils.java | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/mogo-adas-data/src/main/proto/message_pad.proto b/libraries/mogo-adas-data/src/main/proto/message_pad.proto index 962820c486..54a15f6401 100644 --- a/libraries/mogo-adas-data/src/main/proto/message_pad.proto +++ b/libraries/mogo-adas-data/src/main/proto/message_pad.proto @@ -345,7 +345,8 @@ message CarConfigResp double maxAcceleration = 8; //最大加速度, 单位:m/s² string carType = 9; //车辆类型 string subCarType = 10; //车辆子类型 - reserved 11 to 100; + string vinCode = 11;//车辆vin码 + reserved 12 to 100; int32 mapVersion = 101;//dockVersion解析出版本号,仅用于版本对比,解析失败为-1。例如:"MAP-taxi_RoboTaxi_df_2.8.0.3_20220928_test" 解析结果为:20800 bool isDF = 102;//车型是否是东风 bool isHQ = 103;//车型是否是红旗 diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/CertificateUtils.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/CertificateUtils.java index 8741bbcde2..4bf3100704 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/CertificateUtils.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/CertificateUtils.java @@ -40,8 +40,12 @@ public class CertificateUtils { */ public static ByteString encode(@NonNull String crt) { if (TextUtils.isEmpty(crt)) return null; + String end = "-----END CERTIFICATE-----"; + if (crt.endsWith("\n")) { + end = end + "\n"; + } char line = 0; - crt = crt.replace("-----BEGIN CERTIFICATE-----\n", "").replace("-----END CERTIFICATE-----", ""); + crt = crt.replace("-----BEGIN CERTIFICATE-----\n", "").replace(end, ""); byte[] chars = new byte[crt.length()]; for (int i = 0; i < crt.length(); i++) { char c = crt.charAt(i); @@ -80,7 +84,7 @@ public class CertificateUtils { } builder.append(c); } - builder.append("-----END CERTIFICATE-----"); + builder.append("-----END CERTIFICATE-----\n"); return builder.toString(); }