From cb8846c02a20354f0274f8cb4544f13f6f43cb7f Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 19 Apr 2021 00:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3DesUtils=E9=9D=9E=E7=A9=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jeesite/common/codec/DesUtils.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/common/src/main/java/com/jeesite/common/codec/DesUtils.java b/common/src/main/java/com/jeesite/common/codec/DesUtils.java index 1db77ab3..fdb67694 100644 --- a/common/src/main/java/com/jeesite/common/codec/DesUtils.java +++ b/common/src/main/java/com/jeesite/common/codec/DesUtils.java @@ -73,15 +73,15 @@ public class DesUtils { String encData = ""; List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null; int firstLength = 0, secondLength = 0, thirdLength = 0; - if (firstKey != null && firstKey.equals("")) { + if (firstKey != null && !firstKey.equals("")) { firstKeyBt = getKeyBytes(firstKey); firstLength = firstKeyBt.size(); } - if (secondKey != null && secondKey.equals("")) { + if (secondKey != null && !secondKey.equals("")) { secondKeyBt = getKeyBytes(secondKey); secondLength = secondKeyBt.size(); } - if (thirdKey != null && thirdKey.equals("")) { + if (thirdKey != null && !thirdKey.equals("")) { thirdKeyBt = getKeyBytes(thirdKey); thirdLength = thirdKeyBt.size(); } @@ -90,7 +90,7 @@ public class DesUtils { if (leng < 4) { int[] bt = strToBt(data); int[] encByte = null; - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !firstKey.equals("")) { int[] tempBt; int x, y, z; tempBt = bt; @@ -105,7 +105,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { int[] tempBt; int x, y; tempBt = bt; @@ -117,7 +117,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && firstKey.equals("")) { + if (firstKey != null && !firstKey.equals("")) { int[] tempBt; int x = 0; tempBt = bt; @@ -137,7 +137,7 @@ public class DesUtils { String tempData = data.substring(i * 4 + 0, i * 4 + 4); int[] tempByte = strToBt(tempData); int[] encByte = null; - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) { int[] tempBt; int x, y, z; tempBt = tempByte; @@ -152,7 +152,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { int[] tempBt; int x, y; tempBt = tempByte; @@ -164,7 +164,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && firstKey.equals("")) { + if (firstKey != null && !firstKey.equals("")) { int[] tempBt; int x; tempBt = tempByte; @@ -181,7 +181,7 @@ public class DesUtils { String remainderData = data.substring(iterator * 4 + 0, leng); int[] tempByte = strToBt(remainderData); int[] encByte = null; - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) { int[] tempBt; int x, y, z; tempBt = tempByte; @@ -196,7 +196,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { int[] tempBt; int x, y; tempBt = tempByte; @@ -208,7 +208,7 @@ public class DesUtils { } encByte = tempBt; } else { - if (firstKey != null && firstKey.equals("")) { + if (firstKey != null && !firstKey.equals("")) { int[] tempBt; int x; tempBt = tempByte; @@ -236,15 +236,15 @@ public class DesUtils { String decStr = ""; List firstKeyBt = null, secondKeyBt = null, thirdKeyBt = null; int firstLength = 0, secondLength = 0, thirdLength = 0; - if (firstKey != null && firstKey.equals("")) { + if (firstKey != null && !firstKey.equals("")) { firstKeyBt = getKeyBytes(firstKey); firstLength = firstKeyBt.size(); } - if (secondKey != null && secondKey.equals("")) { + if (secondKey != null && !secondKey.equals("")) { secondKeyBt = getKeyBytes(secondKey); secondLength = secondKeyBt.size(); } - if (thirdKey != null && thirdKey.equals("")) { + if (thirdKey != null && !thirdKey.equals("")) { thirdKeyBt = getKeyBytes(thirdKey); thirdLength = thirdKeyBt.size(); } @@ -260,7 +260,7 @@ public class DesUtils { intByte[j] = Integer.parseInt(strByte.substring(j, j + 1)); } int[] decByte = null; - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("") && thirdKey != null && thirdKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("") && thirdKey != null && !thirdKey.equals("")) { int[] tempBt; int x, y, z; tempBt = intByte; @@ -275,7 +275,7 @@ public class DesUtils { } decByte = tempBt; } else { - if (firstKey != null && firstKey.equals("") && secondKey != null && secondKey.equals("")) { + if (firstKey != null && !firstKey.equals("") && secondKey != null && !secondKey.equals("")) { int[] tempBt; int x, y, z; tempBt = intByte; @@ -287,7 +287,7 @@ public class DesUtils { } decByte = tempBt; } else { - if (firstKey != null && firstKey.equals("")) { + if (firstKey != null && !firstKey.equals("")) { int[] tempBt; int x, y, z; tempBt = intByte;