question

maxnalin avatar image
maxnalin asked

Help for Game Circle initialization

Good afternoon, like many others I'm unable to find the reason for failure in Game Circle initialization in Android. - created configuration - retrieved MD5 from release keystore - created api key, downloaded api_key.txt and copied to assets subfolder - integrated library, etc. Any suggestions are appreciated. Thank you. Here's part of the logcat: 07-09 16:05:03.121: D/com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager.PII(31317): AmazonAuthorizationManager:sdkVer=1.0.0 libVer=3.3.0: 07-09 16:05:03.121: I/com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager(31317): Options bundle is null 07-09 16:05:03.121: I/com.amazon.identity.auth.device.appid.AbstractAppIdentifier(31317): getAppInfo : packageName=com.maxnalin.crazyspanner 07-09 16:05:03.121: I/com.amazon.identity.auth.device.appid.AbstractAppIdentifier(31317): Finding API Key for com.maxnalin.crazyspanner 07-09 16:05:03.125: I/com.amazon.identity.auth.device.utils.ThirdPartyResourceParser(31317): Attempting to parse API Key from assets directory 07-09 16:05:03.125: I/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): Begin decoding API Key for packageName=com.maxnalin.crazyspanner 07-09 16:05:03.164: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(31317): APIKey: 07-09 16:05:03.171: I/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): num sigs = 1 07-09 16:05:03.171: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(31317): Signature checking.: 07-09 16:05:03.171: D/com.amazon.identity.auth.device.appid.APIKeyDecoder.PII(31317): Fingerpirint checking: 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): Failed to decode: Decoding fails: certificate fingerprint can't be verified! 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): java.lang.SecurityException: Decoding fails: certificate fingerprint can't be verified! 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): at com.amazon.identity.auth.device.appid.APIKeyDecoder.verifyPayload(APIKeyDecoder.java:332) 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): at com.amazon.identity.auth.device.appid.APIKeyDecoder.doDecode(APIKeyDecoder.java:127) 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): at com.amazon.identity.auth.device.appid.APIKeyDecoder.decode(APIKeyDecoder.java:91) 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): at com.amazon.identity.auth.device.appid.AbstractAppIdentifier.getAppInfo(AbstractAppIdentifier.java:85) 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): at com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager. (AmazonAuthorizationManager.java:123) 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): at com.amazon.ags.api.AmazonGamesClient.initialize(AmazonGamesClient.java:144) 07-09 16:05:03.218: W/com.amazon.identity.auth.device.appid.APIKeyDecoder(31317): at com.maxnalin.crazyspanner.CrazySpanner.onResume(CrazySpanner.java:131)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

IBRAHEEM avatar image
IBRAHEEM answered
i'm having the same problem,
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
This is most likely the issue with wrong MD5 is registered while generating API Key. You can generate your application's signature by using keytool, which comes with Java JDK. Please note the path to your keystore may vary depending on your operating system. For Macs it is typically located at /Users//.android/ and for Windows C:\Users\\.android\. You also need to verify you are using the correct password. For debug, use "android" to generate the keyhash. The tool should ask for a password, if it does not you have the wrong keystore path. (keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64) If you are still getting the same error you can also use the Packagemanager Class to pull the signature from your app and place it in your log. Some developers do seem to have issues pulling the proper key value using the keytool. A basic example using the PackageManager: //Pull the signature public String getAppSignature(final String packageName) { Signature[] sigs; try { sigs = getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES).signatures; for (Signature sig : sigs) { MessageDigest md; md = MessageDigest.getInstance("SHA1"); md.update(sig.toByteArray()); String hash = new String(Base64.encode(md.digest(), 0)); return hash; } } catch (NameNotFoundException e) { Log.d(LOG_NAME, "Package Name Not Found"); e.printStackTrace(); } catch (NoSuchAlgorithmException e) { Log.d(LOG_NAME, "No Such Algorithm"); e.printStackTrace(); } Log.d(LOG_NAME, "AppSig Failed"); return null; } //Throw it in your log final String sig = getAppSignature(); if (sig != null) { Log.d(LOG_NAME, "Signature : " + sig); }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

maxnalin avatar image
maxnalin answered
Thank you, there's still one thing I don't understand. Do I have to use the debug keystore for the release version ?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

DougM@Amazon avatar image
DougM@Amazon answered
Hi maxnalin, We would suggest using your debug keystore and API_KEY.txt file to test. Once your tests are completed, your release keystore associated with the same package name on the same Security Profile and API_KEY.txt file would be what you would want to use. This way if you want to use GameCircle on Google Play you would be able to do so. We do suggest validating that your GameCircle configuration still works following the change in API key and signature, as with any changes in your app.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.