美文网首页程序员
Android8.1源码下对APK进行系统签名

Android8.1源码下对APK进行系统签名

作者: 网路元素 | 来源:发表于2019-07-01 17:58 被阅读9次

      在Android8.1上面继续参考http://blog.sina.com.cn/s/blog_3e4774e30101e1y5.html这篇文章来对APK进行Android系统源码环境下的签名,发现签名时出现如下错误:

    Exception in thread "main" java.lang.ExceptionInInitializerError

    at org.conscrypt.OpenSSLBIOInputStream.(OpenSSLBIOInputStream.

    at org.conscrypt.OpenSSLX509Certificate.fromX509PemInputStream(OpenSSLX509Certificate.

    at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.

    at org.conscrypt.OpenSSLX509CertificateFactory$1.fromX509PemInputStream(OpenSSLX509CertificateFactory.

    at org.conscrypt.OpenSSLX509CertificateFactory$Parser.generateItem(OpenSSLX509CertificateFactory.

    at org.conscrypt.OpenSSLX509CertificateFactory.engineGenerateCertificate(OpenSSLX509CertificateFactory.

    at

    at com.android.signapk.SignApk.readPublicKey(SignApk.

    at com.android.signapk.SignApk.main(SignApk.

    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.

    at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.

    at org.conscrypt.NativeCrypto.(NativeCrypto.

    ... 9 more

      查了下资料,需要将命令由如下:

      java -jar out/host/linux-x86/framework/signapk.jar build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 xinu.apk xinu_new.apk

     修改为:

     java-Xmx2048m -Djava.library.path="out/host/linux-x86/lib64"-jar out/host/linux-x86/framework/signapk.jar build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 xinu.apk xinu_new.apk

      参考资料:https://ask.csdn.net/questions/684938

    相关文章

      网友评论

        本文标题:Android8.1源码下对APK进行系统签名

        本文链接:https://www.haomeiwen.com/subject/nnencctx.html