uni-app 开启闪退 错误:java.lang.IllegalArgumentException: Cannot parse iv:ciphertext:mac
uni-app 开启闪退 错误:java.lang.IllegalArgumentException: Cannot parse iv:ciphertext:mac
| 开发环境 | 版本号 | 项目创建方式 |
|---|---|---|
| HBuilderX | 4.01 | 云端 |
产品分类:HTML5+
手机系统:Android
手机系统版本号:Android 13
手机机型:RK3588
操作步骤:
- 开启应用
预期结果:
- 正常开启
实际结果:
- 闪退
bug描述:
错误内容日志:
2024-02-22 17:29:02.809 6868-6868 Html5Plus-onCreate pid-6868 E 1708594142809
2024-02-22 17:29:05.520 1653-1653 audit pid-1653 E rate limit exceeded
2024-02-22 17:29:02.839 6868-6868 AppRuntime pid-6868 E initUTS error java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.reflect.Field java.lang.Class.getField(java.lang.String)' on a null object reference
2024-02-22 17:29:02.843 6868-6868 plus.H5133EA61 pid-6868 E Invalid ID 0x00000000.
2024-02-22 17:29:02.849 6868-6868 Html5Plus-onResume pid-6868 E 1708594142849
2024-02-22 17:29:02.914 6868-6868 uni-AD pid-6868 E wm adapter version not match
2024-02-22 17:29:02.924 6868-6868 AndroidRuntime pid-6868 E FATAL EXCEPTION: main
Process: plus.H5133EA61, PID: 6868
java.lang.IllegalArgumentException: Cannot parse iv:ciphertext:mac
at io.dcloud.e.f.a$a.<init>(Unknown Source:16)
at io.dcloud.e.f.b.b(Unknown Source:27)
at io.dcloud.e.f.b.a(Unknown Source:28)
at io.dcloud.common.adapter.util.SP.getsBundleData(Unknown Source:3)
at io.dcloud.feature.gg.AolSplashUtil.getAL(Unknown Source:1)
at io.dcloud.feature.gg.dcloud.ADHandler.pull(Unknown Source:51)
at io.dcloud.feature.gg.dcloud.AolFeatureImpl.doForFeature(Unknown Source:141)
at io.dcloud.feature.gg.AolFeatureImplMgr.doForFeature(Unknown Source:5)
at io.dcloud.a.a(Unknown Source:16)
at io.dcloud.b$a.run(Unknown Source:5)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7870)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
2024-02-22 17:29:02.957 6868-6868 chromium pid-6868 E [ERROR:network_service_instance_impl.cc(179)] Failed to grant sandbox access to network context data for /data/user/0/plus.H5133EA61/app_webview/Default with result 7: No such file or directory (2)
2024-02-22 17:29:08.552 389-389 admin android.hardware.audio.service E es8323_mute: ZC enter mute=1
2024-02-22 17:29:05.876 389-389 alsa_route android.hardware.audio.service E set_controls() Can not get ctl : aw87xxx_profile_switch_0
2024-02-22 17:29:05.964 6868-6868 UncaughtEx...ionHandler plus.H5133EA61 E java.lang.IllegalArgumentException: Cannot parse iv:ciphertext:mac
更多关于uni-app 开启闪退 错误:java.lang.IllegalArgumentException: Cannot parse iv:ciphertext:mac的实战教程也可以访问 https://www.itying.com/category-93-b0.html
更多关于uni-app 开启闪退 错误:java.lang.IllegalArgumentException: Cannot parse iv:ciphertext:mac的实战教程也可以访问 https://www.itying.com/category-93-b0.html
在 uni-app 开发中,如果你遇到了 java.lang.IllegalArgumentException: Cannot parse iv:ciphertext:mac 这样的错误,通常与加密解密操作有关。这个错误表明在尝试解析加密数据时,传入的 iv(初始化向量)、ciphertext(密文)或 mac(消息认证码)格式不正确或缺失。
以下是一些可能的原因和解决方法:
1. 检查加密数据格式
确保你在加密和解密时使用的数据格式是正确的,特别是 iv、ciphertext 和 mac 的格式。这些数据通常需要以特定的方式进行拼接或分割。
2. 确认加密算法
确保在加密和解密时使用了相同的算法、密钥和初始化向量(IV)。如果算法或密钥不匹配,解密时会失败。
3. 检查数据完整性
在解密之前,确保 iv、ciphertext 和 mac 数据没有被篡改或损坏。如果有任何一部分数据丢失或不正确,解密操作会失败。
4. 调试日志
在代码中添加调试日志,打印出 iv、ciphertext 和 mac 的值,检查它们是否符合预期。这有助于定位问题所在。
5. 检查第三方库
如果你使用的是第三方库进行加密解密操作,确保库的版本和用法是正确的。有时库的更新可能会引入不兼容的更改。
6. 示例代码
以下是一个简单的加密解密示例,供参考:
const crypto = require('crypto');
// 加密
function encrypt(text, key, iv) {
const cipher = crypto.createCipheriv('aes-256-cbc', key, iv);
let encrypted = cipher.update(text, 'utf8', 'hex');
encrypted += cipher.final('hex');
return encrypted;
}
// 解密
function decrypt(encryptedText, key, iv) {
const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
let decrypted = decipher.update(encryptedText, 'hex', 'utf8');
decrypted += decipher.final('utf8');
return decrypted;
}
const key = crypto.randomBytes(32); // 256-bit key
const iv = crypto.randomBytes(16); // 128-bit IV
const text = 'Hello, World!';
const encrypted = encrypt(text, key, iv);
console.log('Encrypted:', encrypted);
const decrypted = decrypt(encrypted, key, iv);
console.log('Decrypted:', decrypted);

