[GH-ISSUE #256] App crashes after installation. #185

Closed
opened 2026-02-28 01:23:35 +03:00 by kerem · 5 comments
Owner

Originally created by @KamilKalfas on GitHub (May 15, 2015).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/256

Hello,

I'm getting crash every time I'm trying to launch a SMSSync.
I'm using Java 7 and Android Studio. Built app is from master branch.

Looking for quick help.
Cheers,
Kamil
kkalfas@soldelo.com

05-15 14:41:26.836  19786-19812/org.addhen.smssync.debug E/IAB/DefaultSignatureValidator﹕ Invalid key specification.
05-15 14:41:26.838  19786-19812/org.addhen.smssync.debug E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-14482
    Process: org.addhen.smssync.debug, PID: 19786
    java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
            at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.generatePublicKey(DefaultSignatureValidator.java:107)
            at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.<init>(DefaultSignatureValidator.java:52)
            at com.github.jberkel.pay.me.IabHelper.<init>(IabHelper.java:120)
            at org.addhen.smssync.fragments.DonationFragment.checkUserHasDonated(DonationFragment.java:92)
            at org.addhen.smssync.activities.BaseActivity$1.run(BaseActivity.java:317)
     Caused by: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
            at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:155)
            at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47)
            at java.security.KeyFactory.generatePublic(KeyFactory.java:172)
            at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.generatePublicKey(DefaultSignatureValidator.java:102)
            at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.<init>(DefaultSignatureValidator.java:52)
            at com.github.jberkel.pay.me.IabHelper.<init>(IabHelper.java:120)
            at org.addhen.smssync.fragments.DonationFragment.checkUserHasDonated(DonationFragment.java:92)
            at org.addhen.smssync.activities.BaseActivity$1.run(BaseActivity.java:317)
     Caused by: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
            at com.android.org.conscrypt.NativeCrypto.d2i_PUBKEY(Native Method)
            at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:153)
            at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47)
            at java.security.KeyFactory.generatePublic(KeyFactory.java:172)
            at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.generatePublicKey(DefaultSignatureValidator.java:102)
            at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.<init>(DefaultSignatureValidator.java:52)
            at com.github.jberkel.pay.me.IabHelper.<init>(IabHelper.java:120)
            at org.addhen.smssync.fragments.DonationFragment.checkUserHasDonated(DonationFragment.java:92)
            at org.addhen.smssync.activities.BaseActivity$1.run(BaseActivity.java:317)```
Originally created by @KamilKalfas on GitHub (May 15, 2015). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/256 Hello, I'm getting crash every time I'm trying to launch a SMSSync. I'm using Java 7 and Android Studio. Built app is from master branch. Looking for quick help. Cheers, Kamil kkalfas@soldelo.com `````` 05-15 14:41:26.836 19786-19812/org.addhen.smssync.debug E/IAB/DefaultSignatureValidator﹕ Invalid key specification. 05-15 14:41:26.838 19786-19812/org.addhen.smssync.debug E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-14482 Process: org.addhen.smssync.debug, PID: 19786 java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.generatePublicKey(DefaultSignatureValidator.java:107) at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.<init>(DefaultSignatureValidator.java:52) at com.github.jberkel.pay.me.IabHelper.<init>(IabHelper.java:120) at org.addhen.smssync.fragments.DonationFragment.checkUserHasDonated(DonationFragment.java:92) at org.addhen.smssync.activities.BaseActivity$1.run(BaseActivity.java:317) Caused by: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:155) at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47) at java.security.KeyFactory.generatePublic(KeyFactory.java:172) at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.generatePublicKey(DefaultSignatureValidator.java:102)             at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.<init>(DefaultSignatureValidator.java:52)             at com.github.jberkel.pay.me.IabHelper.<init>(IabHelper.java:120)             at org.addhen.smssync.fragments.DonationFragment.checkUserHasDonated(DonationFragment.java:92)             at org.addhen.smssync.activities.BaseActivity$1.run(BaseActivity.java:317) Caused by: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long at com.android.org.conscrypt.NativeCrypto.d2i_PUBKEY(Native Method) at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:153)             at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47)             at java.security.KeyFactory.generatePublic(KeyFactory.java:172)             at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.generatePublicKey(DefaultSignatureValidator.java:102)             at com.github.jberkel.pay.me.validator.DefaultSignatureValidator.<init>(DefaultSignatureValidator.java:52)             at com.github.jberkel.pay.me.IabHelper.<init>(IabHelper.java:120)             at org.addhen.smssync.fragments.DonationFragment.checkUserHasDonated(DonationFragment.java:92)             at org.addhen.smssync.activities.BaseActivity$1.run(BaseActivity.java:317)``` ``````
kerem closed this issue 2026-02-28 01:23:36 +03:00
Author
Owner

@eyedol commented on GitHub (May 15, 2015):

@KamilKalfas I think it has to do with the in-app purchase feature; Did you set a value for inAppPurchasePubKey ? check the BUILDING.md for more details

<!-- gh-comment-id:102397450 --> @eyedol commented on GitHub (May 15, 2015): @KamilKalfas I think it has to do with the in-app purchase feature; Did you set a value for `inAppPurchasePubKey` ? check the [BUILDING.md](https://github.com/ushahidi/SMSSync/blob/develop/BUILDING.md) for more details
Author
Owner

@KamilKalfas commented on GitHub (May 15, 2015):

@eyedol Oh ! I didn't see that. Are there any requirements for this key in developer mode ? Also you can close this issue after response. Thanks !

<!-- gh-comment-id:102401297 --> @KamilKalfas commented on GitHub (May 15, 2015): @eyedol Oh ! I didn't see that. Are there any requirements for this key in developer mode ? Also you can close this issue after response. Thanks !
Author
Owner

@eyedol commented on GitHub (May 15, 2015):

Currently you've to set it. Google provides you with a debug key to work with I think. I'll improve the build to ignore it during dev mode.

<!-- gh-comment-id:102403829 --> @eyedol commented on GitHub (May 15, 2015): Currently you've to set it. Google provides you with a debug key to work with I think. I'll improve the build to ignore it during dev mode.
Author
Owner

@KamilKalfas commented on GitHub (May 15, 2015):

@eyedol Well, I've created gradle.properties file as you said filled with template from BUILDING.md and it's still crashing. I've temporary changed return value of DefaultSignatureValidator.generatePublicKey to null. Could you explain me a bit more how to fix this issue. So I'd be able to work with project in developer/debug mode.

<!-- gh-comment-id:102448510 --> @KamilKalfas commented on GitHub (May 15, 2015): @eyedol Well, I've created gradle.properties file as you said filled with template from [BUILDING.md](https://github.com/ushahidi/SMSSync/blob/develop/BUILDING.md) and it's still crashing. I've temporary changed return value of [DefaultSignatureValidator.generatePublicKey](https://github.com/ushahidi/SMSSync/blob/develop/libraries/pay-me/src/main/java/com/github/jberkel/pay/me/validator/DefaultSignatureValidator.java#L98) to null. Could you explain me a bit more how to fix this issue. So I'd be able to work with project in developer/debug mode.
Author
Owner

@eyedol commented on GitHub (May 16, 2015):

This is definitely a Base64 key error. I doubled checked the building doc and realized there was a typo, the app module should be smssync folder. Make sure you have the gradle.properties file in that folder not the root. Do a clean build.

In the develop I have provided SMSsync's pub key as the default key to fix this requirement and updated the building doc. Let me know if you're still hitting an issue

<!-- gh-comment-id:102560335 --> @eyedol commented on GitHub (May 16, 2015): This is definitely a [`Base64`](http://developer.android.com/google/play/billing/billing_integrate.html#billing-security) key error. I doubled checked the building doc and realized there was a typo, the `app` module should be `smssync` folder. Make sure you have the `gradle.properties` file in that folder not the root. Do a clean build. In the `develop` I have provided `SMSsync`'s pub key as the default key to fix this requirement and updated the building doc. Let me know if you're still hitting an issue
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#185
No description provided.