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

released apk #9

Open
codingjeremy opened this issue Sep 10, 2019 · 34 comments
Open

released apk #9

codingjeremy opened this issue Sep 10, 2019 · 34 comments
Labels
migrated googlesamples Migrated from old googlesamples repos

Comments

@codingjeremy
Copy link
Contributor

Issue by shikhakothiyal
Monday Dec 17, 2018 at 06:54 GMT
Originally opened as googlearchive/android-credentials#30


Hash key generated is not working for released apk. Do we have different keys for released and debug mode. What changes in program we need to make to get the key for released mode.

@codingjeremy
Copy link
Contributor Author

Comment by Rissmon
Tuesday Jan 01, 2019 at 12:26 GMT


Facing the related issue with SMS Retriever API. Once the application is downloaded from the play store the automatic msg reading is not working.

@codingjeremy
Copy link
Contributor Author

Comment by PemmasaniRajesh
Friday Jan 04, 2019 at 08:06 GMT


I'm also facing the same issue. I've generated the haskey using AppSignatureHelper class and it is working fine in release mode also. But when I downloaded the apk from playstore, it is not working

@codingjeremy
Copy link
Contributor Author

Comment by shikhakothiyal
Friday Jan 04, 2019 at 21:15 GMT


Go to build gradient ->and change debugging mode to release mode -> now again run the code and you will get a new key.

@codingjeremy
Copy link
Contributor Author

Comment by PemmasaniRajesh
Saturday Jan 05, 2019 at 08:22 GMT


It is working in release mode, when i download the apk from playstore it is not working. Google App Signing is enabled for my app. Is this the case, it is not working?

@codingjeremy
Copy link
Contributor Author

Comment by Rissmon
Saturday Jan 05, 2019 at 09:25 GMT


@PemmasaniRajesh It's the same issue I am facing. Any solution to this problem?.

API is working for debug and release build but once uploaded to playstore with Google App Signing is enabled SMS Retrieval API stop working.
I even tried generating the hashkey using AppSignatureHelper from the playstore downloaded build and still, I am facing the same issue.

@codingjeremy
Copy link
Contributor Author

Comment by Rissmon
Saturday Jan 05, 2019 at 10:22 GMT


Go to build gradient ->and change debugging mode to release mode -> now again run the code and you will get a new key.

@shikhakothiyal It will work for release and debug build. We are facing this issue when the same build is downloaded from playstore.

@codingjeremy
Copy link
Contributor Author

Comment by sahil994
Monday Jan 07, 2019 at 07:48 GMT


Facing same issue the API is working fine for release and debug build and does not work when i downloaded from Play Store.

@codingjeremy
Copy link
Contributor Author

Comment by ithinkihaveacat
Monday Jan 07, 2019 at 09:59 GMT


Are there any messages in the logs?

@codingjeremy
Copy link
Contributor Author

Comment by Rissmon
Monday Jan 07, 2019 at 10:10 GMT


@ithinkihaveacat Issue exists only for the play store build so I'm not able to extract any logs.

@codingjeremy
Copy link
Contributor Author

Comment by vikas56
Tuesday Jan 08, 2019 at 11:12 GMT


keep log for playstore build and check hash key generated.Because signed apk,debug apk and playstore build apk have different hash keys.Give that hash key of playstore build to backend folks.

@codingjeremy
Copy link
Contributor Author

Comment by Rissmon
Tuesday Jan 08, 2019 at 11:26 GMT


keep log for playstore build and check hash key generated.Because signed apk,debug apk and playstore build apk have different hash keys.Give that hash key of playstore build to backend folks.

Yes i tried that but still same issue

@codingjeremy
Copy link
Contributor Author

Comment by PemmasaniRajesh
Thursday Jan 10, 2019 at 13:31 GMT


keep log for playstore build and check hash key generated.Because signed apk,debug apk and playstore build apk have different hash keys.Give that hash key of playstore build to backend folks.

Yeah this is working for me....

@codingjeremy
Copy link
Contributor Author

Comment by sureshperiyasamy
Wednesday Feb 20, 2019 at 17:25 GMT


keep log for playstore build and check hash key generated.Because signed apk,debug apk and playstore build apk have different hash keys.Give that hash key of playstore build to backend folks.

Yeah this is working for me....

@PemmasaniRajesh Are you generating Hash key using AppSignatureHelper class ?

@codingjeremy
Copy link
Contributor Author

Comment by kunalsale
Wednesday Mar 06, 2019 at 13:41 GMT


I'm facing the same issue. It is working fine in debug build as I'm using AppSignatureHelper for hash key. I used the following command to generate the hash for signed build:

keytool -exportcert -alias MyAndroidKey -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp cat | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11`

But SMS is not getting auto retrieved. Is there any solution for the issue?

@codingjeremy
Copy link
Contributor Author

Comment by sureshperiyasamy
Wednesday Mar 06, 2019 at 13:55 GMT


I'm facing the same issue. It is working fine in debug build as I'm using AppSignatureHelper for hash key. I used the following command to generate the hash for signed build:

keytool -exportcert -alias MyAndroidKey -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp cat | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11`

But SMS is not getting auto retrieved. Is there any solution for the issue?

Use this ruby script and get hash key it worked fine for me
https://github.com/michalbrz/sms-retriever-hash-generator/blob/master/google_play_sign.rb

@codingjeremy
Copy link
Contributor Author

Comment by shivamverma676
Tuesday Mar 12, 2019 at 13:20 GMT


Facing same issue the API is working fine for release and debug build and does not work when i downloaded from Play Store.

So i found the solution, i have provide the play store generated hash to backend. For generate hash key on playstore, i have used AppSignatureHelper class and make Toast for the generated hash key and upload this build on play store. After successfully rollout, i have download the build. Now Toast will show with the playstore generated hash key, provide this key to backend. It is working fine for me.

@codingjeremy
Copy link
Contributor Author

Comment by taufik1993
Wednesday Mar 27, 2019 at 11:36 GMT


I am using SMS API for read OTP, I have uploaded build on play store and install in mobile from play store, first time message was not read but when i kill application and run again it is work, Why?

@codingjeremy
Copy link
Contributor Author

Comment by taufik1993
Wednesday Mar 27, 2019 at 11:40 GMT


I'm facing the same issue. It is working fine in debug build as I'm using AppSignatureHelper for hash key. I used the following command to generate the hash for signed build:
keytool -exportcert -alias MyAndroidKey -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp cat | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11`
But SMS is not getting auto retrieved. Is there any solution for the issue?

Use this ruby script and get hash key it worked fine for me
https://github.com/michalbrz/sms-retriever-hash-generator/blob/master/google_play_sign.rb

When i am running this file this way
ruby google_play_sign.rb --package com.your.app --google-play-key deployment_key.der,
and
ruby google_play_sign.rb --package com.your.app --keystore keystore.jks --keystore-password mypassword --key-alias myalias

but getting this result
'shasum' is not recognized as an internal or external command,
operable program or batch file.
Your SMS hashcode is:

@codingjeremy
Copy link
Contributor Author

Comment by shikhakothiyal
Wednesday Mar 27, 2019 at 13:41 GMT


Change the build variant setting to release mode and regenerate your key.
Use this key for verification and everything will work fine.

On Wed, Mar 27, 2019, 5:10 PM Taufik Hussain notifications@github.com
wrote:

I'm facing the same issue. It is working fine in debug build as I'm using
AppSignatureHelper for hash key. I used the following command to generate
the hash for signed build:
keytool -exportcert -alias MyAndroidKey -keystore
MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n
com.example.myapp cat | sha256sum | tr -d "[:space:]-" | xxd -r -p |
base64 | cut -c1-11`
But SMS is not getting auto retrieved. Is there any solution for the issue?

Use this ruby script and get hash key it worked fine for me

https://github.com/michalbrz/sms-retriever-hash-generator/blob/master/google_play_sign.rb

How to run this file?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
googlearchive/android-credentials#30 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AbPHx4UfeXeFH2_YtcLJ6NwUW0bnER9fks5va1izgaJpZM4ZVxqA
.

@codingjeremy
Copy link
Contributor Author

Comment by taufik1993
Thursday Mar 28, 2019 at 04:36 GMT


Change the build variant setting to release mode and regenerate your key. Use this key for verification and everything will work fine.

On Wed, Mar 27, 2019, 5:10 PM Taufik Hussain @.***> wrote: I'm facing the same issue. It is working fine in debug build as I'm using AppSignatureHelper for hash key. I used the following command to generate the hash for signed build: keytool -exportcert -alias MyAndroidKey -keystore MyProductionKeys.keystore | xxd -p | tr -d "[:space:]" | echo -n com.example.myapp cat | sha256sum | tr -d "[:space:]-" | xxd -r -p | base64 | cut -c1-11` But SMS is not getting auto retrieved. Is there any solution for the issue? Use this ruby script and get hash key it worked fine for me https://github.com/michalbrz/sms-retriever-hash-generator/blob/master/google_play_sign.rb How to run this file? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#30 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AbPHx4UfeXeFH2_YtcLJ6NwUW0bnER9fks5va1izgaJpZM4ZVxqA .

I have changed build variant but getting same issue first time message was not read but when i kill application and run again its work why??
If i am wrong please suggest me.

@codingjeremy
Copy link
Contributor Author

Comment by taufik1993
Thursday Mar 28, 2019 at 05:08 GMT


keep log for playstore build and check hash key generated.Because signed apk,debug apk and playstore build apk have different hash keys.Give that hash key of playstore build to backend folks.

First time message was not read but when i kill application and run again its work why??

@codingjeremy
Copy link
Contributor Author

Comment by VikhyatC
Tuesday Apr 23, 2019 at 04:43 GMT


keep log for playstore build and check hash key generated.Because signed apk,debug apk and playstore build apk have different hash keys.Give that hash key of playstore build to backend folks.

Yeah this is working for me....

@PemmasaniRajesh Are you generating Hash key using AppSignatureHelper class ?
I am using AppSignatureHelper to generate hash and facing the same issue.any suggestions? I'm kind running late from my deadline!

@codingjeremy
Copy link
Contributor Author

Comment by PemmasaniRajesh
Tuesday Apr 23, 2019 at 05:15 GMT


Yes, I'm using the AppSignatureHelper class only....

@codingjeremy
Copy link
Contributor Author

Comment by VikhyatC
Tuesday Apr 23, 2019 at 05:16 GMT


Yes, I'm using the AppSignatureHelper class only....

does it work for you?

@codingjeremy
Copy link
Contributor Author

Comment by PemmasaniRajesh
Tuesday Apr 23, 2019 at 05:17 GMT


Yup....

@codingjeremy
Copy link
Contributor Author

Comment by VikhyatC
Tuesday Apr 23, 2019 at 05:23 GMT


I'm using this link to generate a app hash. https://github.com/googlesamples/android-credentials/blob/master/sms-verification/android/app/src/main/java/com/google/samples/smartlock/sms_verify/AppSignatureHelper.java. am i missing something?.Since this implementation is working on release and debug app but not the app downloaded from playstore.

@codingjeremy
Copy link
Contributor Author

Comment by PemmasaniRajesh
Tuesday Apr 23, 2019 at 05:31 GMT


Yeah, I'm also using the same class. I don't know how you're generating the hashkey in release mode.

The hashkey is different for release build and playstore build. First release the app in playstore by generating the hashkey in some screen of your app as toast message. Once you download the app from playstore, you can get the hashkey and save it. After this, release the app once again in playstore with the new hashkey.

@codingjeremy
Copy link
Contributor Author

Comment by taufik1993
Tuesday Apr 23, 2019 at 05:34 GMT


I'm using this link to generate a app hash. https://github.com/googlesamples/android-credentials/blob/master/sms-verification/android/app/src/main/java/com/google/samples/smartlock/sms_verify/AppSignatureHelper.java. am i missing something?.Since this implementation is working on release and debug app but not the app downloaded from playstore.

I facing same issue but when i have registered my BroadcastReciever class inside AndroidManifast.xml It's working fine for me.

@codingjeremy
Copy link
Contributor Author

Comment by VikhyatC
Tuesday Apr 23, 2019 at 05:41 GMT


Yeah, I'm also using the same class. I don't know how you're generating the hashkey in release mode.

The hashkey is different for release build and playstore build. First release the app in playstore by generating the hashkey in some screen of your app as toast message. Once you download the app from playstore, you can get the hashkey and save it. After this, release the app once again in playstore with the new hashkey.
Thanks i shall try this method although i will have to create an internal release first since its also stated in the documentation that the AppSignatureHelper class has to be removed before releasing it for production.However will the keys change for alpha and production builds?

@codingjeremy
Copy link
Contributor Author

Comment by PemmasaniRajesh
Tuesday Apr 23, 2019 at 05:46 GMT


I'm not sure about this. I've tried in production only and it worked. I hope it will not change for alpha and production builds.

@codingjeremy codingjeremy added the migrated googlesamples Migrated from old googlesamples repos label Sep 18, 2019
@Yuvi7447
Copy link

I have a question.
Does the Google Play signs the App for beta track and alpha track using the same certificate used in production?
We have an app published on production, we have calculated hash string correctly and auto read OTP feature works perfectly on production. Now we have created a closed track release for upcoming app update to test and somehow the auto read OTP feature does not work on it.
I got to know google play signs the app when App Signing by Google is enabled and hash string will be different. But, when we submit app update on Alpha/ Beta track, does it uses the same certificate to sign the App that currently it is using for Production.
Can anyone help me understand this? We are blocked on release because we are unable to test auto read OTP feature with Alpha/Beta release which is currently working fine in Production.

@papabeckum007
Copy link

papabeckum007 commented Nov 20, 2020 via email

@Yuvi7447
Copy link

Can you please elaborate? Feature works perfectly, but we are blocked on the Hash String part. We are seeing it is not working in Alpha/Beta, if the certificate is same for prdo/Alpha/Beta then Hash String for auto read OTP won't be different.

@sanjeet007
Copy link

Same problem but can anyone confirm it there any specific message format like it should start with <#> 2345 is your otp hashkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrated googlesamples Migrated from old googlesamples repos
Projects
None yet
Development

No branches or pull requests

4 participants