Project

General

Profile

Actions

Issue #1870

closed

Failed to sign build due to ClassCastException [patch to fix this needs review]

Added by doak complex about 6 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Build system
Target version:
Start date:
01/23/2018
Due date:
% Done:

0%

Estimated time:
Resolution:
Device:
Galaxy S 3 (I9300)
Grant:
Type of work:

Description

I try to sign my build with ./vendor/replicant/sign-build i9300 but it fails with some java.lang.ClassCastException:

0 20:59:24 replicant@debian:~/rsm13% ./vendor/replicant/sign-build i9300
Enter password for /home/replicant/rsm13/vendor/replicant-security/media key> 
Enter password for /home/replicant/rsm13/vendor/replicant-security/platform key> 
Enter password for /home/replicant/rsm13/vendor/replicant-security/releasekey key> 
Enter password for /home/replicant/rsm13/vendor/replicant-security/shared key> 
rewriting RECOVERY/RAMDISK/default.prop:
  replace:  ro.bootimage.build.fingerprint=replicant_i9300:6.0.1/MOI10E/eng.replicant.20180122.125904:userdebug/test-keys
     with:  ro.bootimage.build.fingerprint=replicant_i9300:6.0.1/MOI10E/eng.replicant.20180122.125904:userdebug/release-keys
  replace:  ro.build.display.id=replicant_i9300-userdebug 6.0.1 MOI10E eng.replicant.20180122.125904 test-keys
     with:  ro.build.display.id=replicant_i9300-userdebug 6.0.1 MOI10E eng.replicant.20180122.125904
  replace:  ro.build.tags=test-keys
     with:  ro.build.tags=release-keys
    signing: FusedLocation.apk                (/home/replicant/rsm13/vendor/replicant-security/platform)
java.lang.ClassCastException: org.bouncycastle.asn1.DLSequence cannot be cast to org.bouncycastle.asn1.ASN1Integer
    at org.bouncycastle.asn1.pkcs.PrivateKeyInfo.<init>(PrivateKeyInfo.java:79)
    at org.bouncycastle.asn1.pkcs.PrivateKeyInfo.getInstance(PrivateKeyInfo.java:45)
    at com.android.signapk.SignApk.readPrivateKey(SignApk.java:250)
    at com.android.signapk.SignApk.main(SignApk.java:924)

   ERROR: signapk.jar failed: return code 1

1 20:59:37 replicant@debian:~/rsm13%

The APK seems to be build from ./build/tools/signapk which is checked-out at tag replicant-6.0-0003 like expected.
The same is true for ./external/bouncycastle if this matters.

Any ideas?

Actions

Also available in: Atom PDF