Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon app store: Invalid publicKey for store #12

Closed
just4phil opened this issue Nov 7, 2014 · 14 comments
Closed

Amazon app store: Invalid publicKey for store #12

just4phil opened this issue Nov 7, 2014 · 14 comments
Labels

Comments

@just4phil
Copy link
Contributor

hi @noblemaster
i have issues with the amazon store:
i always get java.lang.IllegalArgumentException: Invalid publicKey for store: com.amazon.apps, key: ....
do you have any experiences with the amazon store?

bye
phil

@noblemaster
Copy link
Member

Sorry, haven't tested the Amazon store. What the error concerns I would try to check the following:

A) are you using the correct key? Is there actually a key???
B) is the key correctly formatted (spaces, line breaks, encoding...)?

You could check https://github.com/onepf/OpenIAB/ how they do it.

@just4phil
Copy link
Contributor Author

hmm
the sample:
https://github.com/onepf/OpenIAB/blob/dev/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/InAppConfig.java

doesnt use a key for amazon store!?

// STORE_KEYS_MAP.put(OpenIabHelper.NAME_AMAZON,
// "Unavailable. Amazon doesn't support RSA verification. So this mapping is not needed");

is that correct?

if i set the key = "" then i get:
java.lang.IllegalArgumentException: Store public key can't be null or empty value.

if i set the correct key then i get:
java.lang.IllegalArgumentException: Invalid publicKey for store: com.amazon.apps, key: .....

see also:
onepf/OpenIAB#125

@just4phil
Copy link
Contributor Author

....
after further investigation:
if i startup gdx-pay with deactivated: config.addStoreParam(PurchaseManagerConfig.STORE_NAME_ANDROID_AMAZON, AMAZONKEY);

then i get:
PurchaseObserver: handleInstallError!: Problem setting up in-app billing: IabResult: 3, Billing isn't supported (response: 3:Billing Unavailable)

it seems like there is something to fix about the amazon - IAP via our openIAB backend....

@noblemaster
Copy link
Member

Yes, looks like there is no key needed for Amazon. For testing I assume you are testing on a non-Amazon device!? Did you install the Amazon Tester:

Unless you install the Amazon Tester app on your device, billing won't work. Did you do that?

@just4phil
Copy link
Contributor Author

@noblemaster
i am testing on an amazon fire tv ......not sure if the tester app is needed in that case.
i will investigate.

but does your iab-purchasemgr support IAP without submitting a key?

@noblemaster
Copy link
Member

I guess in that case there should be an Amazon store installed and you won't need the tester app! How did you install the app on Amazon Fire TV? Did you make sure the Amazon signature is in there (install signature) when you copy it over?

but does your iab-purchasemgr support IAP without submitting a key?

Yes. Simply don't supply a key for Amazon and you are good.

@just4phil
Copy link
Contributor Author

@noblemaster
hm... i just sideloaded directly from eclipse run as .....
which amazon signature do you mean? sorry for asking newbie questions :)

@noblemaster
Copy link
Member

Maybe "signature" is the wrong name. Here is how you do it:
https://github.com/onepf/OpenIAB/wiki/How-To-support-Amazon-Appstore#test

When you install your app, make sure to do it with

  adb install -i com.amazon.venezia /path/to/YourApp.apk". 

Maybe you are also able to pass in "com.amazon.venezia" when you launch it via Eclipse, but not sure how/if that actually works???

@just4phil
Copy link
Contributor Author

ok got it....

but there is still something wrong.... i dont submit a store key now and i sideloaded via adb install -i com.amazon.venezia ....

11-12 14:55:44.503: I/IAP(21439): IAP: gdx-pay successfully instantiated.
11-12 14:55:44.503: I/AndroidInput(21439): sensor listener setup
11-12 14:55:44.513: I/PurchasingManager(21439): Purchasing Framework initialization complete. Build ID 1.0.3
11-12 14:55:44.513: D/PurchasingManager(21439): In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: org.onepf.oms.appstore.AmazonAppstoreBillingService@412ede48

...

11-12 14:55:46.635: E/AndroidRuntime(21439): java.lang.IllegalStateException: Wrong setup state: 3
11-12 14:55:46.635: E/AndroidRuntime(21439): at org.onepf.oms.OpenIabHelper.setupStateToString(OpenIabHelper.java:1024)
11-12 14:55:46.635: E/AndroidRuntime(21439): at org.onepf.oms.OpenIabHelper.checkSetupDone(OpenIabHelper.java:989)
11-12 14:55:46.635: E/AndroidRuntime(21439): at org.onepf.oms.OpenIabHelper.queryInventoryAsync(OpenIabHelper.java:919)
11-12 14:55:46.635: E/AndroidRuntime(21439): at com.badlogic.gdx.pay.android.openiab.PurchaseManagerAndroidOpenIAB.purchaseRestore(PurchaseManagerAndroidOpenIAB.java:316)
11-12 14:55:46.635: E/AndroidRuntime(21439): at com.badlogic.gdx.pay.PurchaseSystem.purchaseRestore(PurchaseSystem.java:159)
11-12 14:55:46.635: E/AndroidRuntime(21439): at de.philweb.philengine.common.PlatformResolver.requestPurchaseRestore(PlatformResolver.java:40)
11-12 14:55:46.635: E/AndroidRuntime(21439): at de.philweb.game2.screens.LoadingAsyncScreen.(LoadingAsyncScreen.java:112)
11-12 14:55:46.635: E/AndroidRuntime(21439): at de.philweb.game2.common.Tanks.getStartScreen(Tanks.java:174)

@noblemaster
Copy link
Member

Setup state 3 is defined as SETUP_IN_PROGRESS:
https://github.com/onepf/OpenIAB/blob/dev/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L108

Are you waiting for the purchase observer's handleInstall() to be called before you call purchaseRestore. Looks like you are trying to do a purchase restore while the purchase manager for Amazon is still being set up!?

@just4phil
Copy link
Contributor Author

Hi @noblemaster

I can check that, but i do it the same way on Google play and ouya. So IF it works there it should work for amazon also.....

Bye
Phil

@noblemaster
Copy link
Member

Good point. On the other hand, I just wrapped OpenIAB, so if it works for Google Play, it should also work for all the other stores including Amazon. I haven't added specific Amazon-code. Have you looked closer at OpenIAB to see how they do it there?

@just4phil
Copy link
Contributor Author

hi @noblemaster
i just checked again....if i dont submit a key i get:

java.lang.IllegalArgumentException: Store public key can't be null or empty value.
at org.onepf.oms.OpenIabHelper$Options$Builder.checkStoreKeyParam(OpenIabHelper.java:1469)
at org.onepf.oms.OpenIabHelper$Options$Builder.addStoreKeys(OpenIabHelper.java:1508)
at com.badlogic.gdx.pay.android.openiab.PurchaseManagerAndroidOpenIAB.install(PurchaseManagerAndroidOpenIAB.java:218)
at com.badlogic.gdx.pay.PurchaseSystem.install(PurchaseSystem.java:153)
at de.philweb.bubblr2HD.tools.PlatformResolver.initializeIAP(PlatformResolver.java:25)

@noblemaster
Copy link
Member

Are you passing in a "null"-key for Amazon? I think not passing in anything for Amazon at all might actually do the trick?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants