AndroidP signapk.jar使用中UnsatisfiedLinkError问题解决

测试从网上下载的apk尝试安装时报错:

Performing Streamed Install
adb: failed to install D:\downloads\com.qualcomm.qti.perfdump.apk: Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: Package couldn't be installed in /data/app/com.qualcomm.qti.perfdump-FlfKF0_Q3Q3YwQaRiDAQgA==: Package com.qualcomm.qti.perfdump has no signatures that match those in shared user android.uid.shell; ignoring!]

尝试通过signapk.jar重新进行签名,报错:

java -jar signapk.jar platform.x509.pem platform.pk8 com.qualcomm.qti.perfdump.apk com.qualcomm.qti.perfdump1.apk 
Exception in thread "main" java.lang.UnsatisfiedLinkError: 'java.lang.String[] org.conscrypt.NativeCrypto.get_cipher_names(java.lang.String)'
    at org.conscrypt.NativeCrypto.get_cipher_names(Native Method)
    at org.conscrypt.NativeCrypto.(NativeCrypto.java:764)
    at org.conscrypt.OpenSSLProvider.(OpenSSLProvider.java:56)
    at org.conscrypt.OpenSSLProvider.(OpenSSLProvider.java:49)
    at com.android.signapk.SignApk.main(SignApk.java:942)

解决:

java -Djava.library.path=/home/xxx/android_dev/android/out/host/linux-x86/lib64 -jar signapk.jar platform.x509.pem platform.pk8 com.qualcomm.qti.perfdump.apk com.qualcomm.qti.perfdump1.apk 

之后安装成功:

D:\>adb install -r X:\android_dev\android\out\host\linux-x86\framework\com.qualcomm.qti.perfdump1.apk
Performing Streamed Install
Success

signapk源码:android/build/tools/signapk

├── Android.bp
├── OWNERS
├── SignApk.mf
├── src
│   └── com
│       └── android
│           └── signapk
│               ├── CountingOutputStream.java
│               └── SignApk.java
└── test
    └── run

编译完成后在android/out/host/linux-x86/framework/signapk.jar
platform.pk8和platform.x509.pem在android/build/target/product/security下:

├── Android.bp
├── Android.mk
├── fsverity-release.x509.der
├── media.pk8
├── media.x509.pem
├── networkstack.pk8
├── networkstack.x509.pem
├── platform.pk8
├── platform.x509.pem
├── README
├── shared.pk8
├── shared.x509.pem
├── testkey.pk8
├── testkey.x509.pem
├── verity_key
├── verity.pk8
└── verity.x509.pem

参考:
https://blog.csdn.net/u011379...

你可能感兴趣的:(android)