测试从网上下载的 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.<clinit>(NativeCrypto.java:764)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:56)
at org.conscrypt.OpenSSLProvider.<init>(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…