Direct command:
java -Djava.library.path=prebuilts/sdk/tools/linux/lib64/ -jar out/host/linux-x86/framework/signapk.jar build/target/product/security/platform.x509.pem build/target/product/security/platform.pk8 test.apk test_signed.apk
Description:
1. The role of -Djava.library.path = prebuilts / sdk / tools / linux / lib64 /, indicating the path where libconscrypt_openjdk_jni.so is sitting, will report the following error in the signature:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no conscrypt_openjdk_jni in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1871)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:25)
at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:54)
at org.conscrypt.OpenSSLBIOInputStream.<init>(OpenSSLBIOInputStream.java:34)
2. The path of signapk.jar in the source code environment is: out / host / linux-x86 / framework / signapk.jar
3. Platform signature files platform.x509.pem and platform.pk8 in the source code path: build / target / product / security /
4. Of course, if you collect the above files into a record, you only need to put the above path relative to a path.