From becda30777b36ad5c47ce61cf606f2bcafda068b Mon Sep 17 00:00:00 2001 From: liuguijing <123456> Date: Thu, 13 Feb 2025 20:16:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E9=80=9A=E7=94=A8=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BF=AE=E6=94=B9=E4=B8=AD=EF=BC=9A=E5=AF=B9=E4=BA=8E?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=E7=9A=84=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E5=92=8C=E6=96=87=E4=BB=B6=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xypower/mpmaster/sms/SimUtil.java | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java b/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java index b458d025..b303fce5 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/sms/SimUtil.java @@ -912,11 +912,24 @@ public class SimUtil { filePath = value; } } - HashMap hashMap = ValueTypeUtil.checkFilePathAndName(context, fileType); - filePath = hashMap.get(UpdateSysConfigUtil.FILEPATH); - fileName = hashMap.get(UpdateSysConfigUtil.FILENAME); - byte[] decode = Base64.decode(fileStr, Base64.NO_WRAP); - FilesUtils.writeFile(filePath + fileName, decode); + if (StringUtils.isNotEmpty(fileStr)) { + if (StringUtils.isEmpty(filePath)) { + HashMap hashMap = ValueTypeUtil.checkFilePathAndName(context, fileType); + filePath = hashMap.get(UpdateSysConfigUtil.FILEPATH); + fileName = hashMap.get(UpdateSysConfigUtil.FILENAME); + if (StringUtils.isEmpty(filePath) || StringUtils.isEmpty(fileName)) { + ifmessageCorrect = false; + } else { + filePath += fileName; + } + } + if (StringUtils.isNotEmpty(filePath)) { + byte[] decode = Base64.decode(fileStr, Base64.NO_WRAP); + FilesUtils.writeFile(filePath, decode); + } + } else { + ifmessageCorrect = false; + } } } catch (Exception ex) { ex.printStackTrace();