File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/java/cn/wildfirechat/app Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public static String encrypt(String data) {
6868 //JDK1.8及以上可直接使用Base64,JDK1.7及以下可以使用BASE64Encoder
6969 //Android平台可以使用android.util.Base64
7070 String s = new String (Base64 .getEncoder ().encode (bytes ));
71- s = s .replace ("/" , "%2F " ).replace ("+" ,"%2B " ).replace ("=" ,"%3D " );
71+ s = s .replace ("/" , "~ " ).replace ("+" ,"- " ).replace ("=" ,"_ " );
7272 return s ;
7373 } catch (Exception e ) {
7474 e .printStackTrace ();
@@ -86,7 +86,7 @@ public static String decrypt(String data) {
8686 if (data == null )
8787 return null ;
8888 try {
89- data = data .replace ("%2F " , "/" ).replace ("%2B " , "+" ).replace ("%3D " , "=" );
89+ data = data .replace ("~ " , "/" ).replace ("- " , "+" ).replace ("_ " , "=" );
9090 Key secretKey = generateKey (password );
9191 Cipher cipher = Cipher .getInstance (CIPHER_ALGORITHM );
9292 IvParameterSpec iv = new IvParameterSpec (IV_PARAMETER .getBytes (CHARSET ));
You can’t perform that action at this time.
0 commit comments