APK签名提示Exception in thread “main“ java.lang.ExceptionInInitializerError错误

   日期:2020-11-01     浏览:304    评论:0    
核心提示:在ASOP源码中对apk使用以下命令进行签名时java -Xms512m -jar signapk.jar -w platform.x509.pem platform.pk8 to_be_signed.apk demo_Signed.apk会出现报错提示:Exception in thread “main” java.lang.ExceptionInInitializerErrorat org.conscrypt.OpenSSLBIOInputStream.(OpenSSLBIOInputStre

在ASOP源码中对apk使用以下命令进行签名时
java -Xms512m -jar signapk.jar -w platform.x509.pem platform.pk8 to_be_signed.apk demo_Signed.apk
会出现报错提示:

Exception in thread “main” java.lang.ExceptionInInitializerError
at org.conscrypt.OpenSSLBIOInputStream.(OpenSSLBIOInputStream.java:34)
at org.conscrypt.OpenSSLX509Certificate.fromX509PemInputStream(OpenSSLX509Certificate.java:129)
at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:226)
at org.conscrypt.OpenSSLX509CertificateFactory 1. f r o m X 509 P e m I n p u t S t r e a m ( O p e n S S L X 509 C e r t i f i c a t e F a c t o r y . j a v a : 222 ) a t o r g . c o n s c r y p t . O p e n S S L X 509 C e r t i f i c a t e F a c t o r y 1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:222) at org.conscrypt.OpenSSLX509CertificateFactory 1.fromX509PemInputStream(OpenSSLX509CertificateFactory.java:222)atorg.conscrypt.OpenSSLX509CertificateFactoryParser.generateItem(OpenSSLX509CertificateFactory.java:100)
at org.conscrypt.OpenSSLX509CertificateFactory.engineGenerateCertificate(OpenSSLX509CertificateFactory.java:278)
at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339)
at com.android.signapk.SignApk.readPublicKey(SignApk.java:184)
at com.android.signapk.SignApk.main(SignApk.java:1007)
Caused by: java.lang.IllegalArgumentException: Failed to load any of the given libraries: [conscrypt_openjdk_jni-linux-x86_64, conscrypt_openjdk_jni-linux-x86_64-fedora, conscrypt_openjdk_jni]
at org.conscrypt.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:176)
at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:49)
at org.conscrypt.NativeCrypto.(NativeCrypto.java:53)

原因是缺少参数:-Djava.library.path,加上该参数
java -Xmx512m -Djava.library.path=./prebuilts/sdk/tools/linux/lib64/ -jar signapk.jar -w platform.x509.pem platform.pk8 tobe_signed.apk demo_Signed.apk

 
打赏
 本文转载自:网络 
所有权利归属于原作者,如文章来源标示错误或侵犯了您的权利请联系微信13520258486
更多>最近资讯中心
更多>最新资讯中心
0相关评论

推荐图文
推荐资讯中心
点击排行
最新信息
新手指南
采购商服务
供应商服务
交易安全
关注我们
手机网站:
新浪微博:
微信关注:

13520258486

周一至周五 9:00-18:00
(其他时间联系在线客服)

24小时在线客服