AOSP生成签名的工厂映像和完整更新包

时间:2017-06-21 00:57:14

标签: android build openssl pgp

我正在尝试为AOSP rom生成签名工厂映像和完整更新包,名为copperhead os。

我在Generat使用release.sh脚本签署工厂映像和完整更新包时完成了构建:

script/release.sh marlin

它要求输入密码,注意我在生成发布签名密钥(所有这些密码的空白密码短语)的构建过程之前将密钥密码保留为空白。

我不能把这个留空,当我把所谓的密码短语带入

suhaib@suhaib:~/sdk/copperheados-N2G47X.2017.06.15.06.09.53$ script/release.sh sailfish
Enter password for keys/sailfish/releasekey key> 
Enter password for keys/sailfish/releasekey key> 
rewriting VENDOR/build.prop:
  replace:  ro.vendor.build.fingerprint=Android/aosp_sailfish/sailfish:7.1.2/N2G47X/2017.06.20.18.57.32:user/test-keys
     with:  ro.vendor.build.fingerprint=Android/aosp_sailfish/sailfish:7.1.2/N2G47X/2017.06.20.18.57.32:user/release-keys
    signing: imssettings.apk                 (keys/sailfish/platform)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
    signing: ims.apk                         (keys/sailfish/platform)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
    signing: colorservice.apk                (keys/sailfish/platform)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
    signing: SSRestartDetector.apk           (keys/sailfish/platform)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
    signing: InputDevices.apk                (keys/sailfish/platform)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
    signing: MediaProvider.apk               (keys/sailfish/media)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
    signing: ExternalStorageProvider.apk     (keys/sailfish/platform)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
    signing: Updater.apk                     (keys/sailfish/releasekey)
Picked up _JAVA_OPTIONS: -XX:-UsePerfData
signapk: Password for keys/sailfish/releasekey.pk8 may be bad.
java.security.spec.InvalidKeySpecException: Cannot retrieve the PKCS8EncodedKeySpec
    at javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(EncryptedPrivateKeyInfo.java:255)
    at com.android.signapk.SignApk.decryptPrivateKey(SignApk.java:243)
    at com.android.signapk.SignApk.readPrivateKey(SignApk.java:259)
    at com.android.signapk.SignApk.main(SignApk.java:1105)
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
    at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:989)
    at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:845)
    at com.sun.crypto.provider.PBES1Core.doFinal(PBES1Core.java:416)
    at com.sun.crypto.provider.PBEWithMD5AndDESCipher.engineDoFinal(PBEWithMD5AndDESCipher.java:316)
    at javax.crypto.Cipher.doFinal(Cipher.java:2165)
    at javax.crypto.EncryptedPrivateKeyInfo.getKeySpec(EncryptedPrivateKeyInfo.java:250)
    ... 3 more

   ERROR: signapk.jar failed: return code 1

1 个答案:

答案 0 :(得分:0)

似乎我在生成构建时偶然输入了一个密钥无论如何都试图重建而没有密钥密码,这就解决了