code: String decrypt(String text) throws AesException {
          byte[] original;
          try {
              // 设置解密模式为AES的CBC模式
              Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
              SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES");
              IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16));
              cipher.init(Cipher.DECRYPT_MODE, key_spec, iv);
  
              // 使用BASE64对密文进行解码
              byte[] encrypted = Base64.decodeBase64(text);
  
              // 解密
              original = cipher.doFinal(encrypted);
          } catch (Exception e) {
              e.printStackTrace();
              throw new AesException(AesException.DecryptAESError);
          }
  
          String xmlContent, from_appid;
          try {
              // 去除补位字符
              byte[] bytes = PKCS7Encoder.decode(original);
  
              // 分离16位随机字符串,网络字节序和AppId
              byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20);
  
              int xmlLength = recoverNetworkBytesOrder(networkOrder);
  
              xmlContent = new String(Arrays.copyOfRange(bytes, 20, 20 + xmlLength), CHARSET);
              from_appid = new String(Arrays.copyOfRange(bytes, 20 + xmlLength, bytes.length),
                      CHARSET);
          } catch (Exception e) {
              e.printStackTrace();
              throw new AesException(AesException.IllegalBuffer);
          }
  
          // appid不相同的情况
          if (!from_appid.equals(appId)) {
              throw new AesException(AesException.ValidateAppidError);
          }
          return xmlContent;
  
      }
docs: 对密文进行解密.
  
  @param text 需要解密的密文
  @return 解密得到的明文
  @throws AesException aes解密失败