jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
289 stars 184 forks source link

this useful package but didn't work in release mode #98

Closed sfyanbel closed 2 years ago

sfyanbel commented 3 years ago

i have tested in debug mode it is worked but in release mode does not work

jaumard commented 3 years ago

Lot of people myself included are using it in release mode on production...

GabrielCR99 commented 3 years ago

Hey, @jaumard! Here in my case, it doesn't work in release too. Everything worked perfectly in debug mode, but when it comes to release (production on Playstore) it simply doesn't listen for the SMS code. Just a question, does the app signature changes between debug and release? If so, I think that's the problem, but I don't know yet.

jaumard commented 3 years ago

Just a question, does the app signature changes between debug and release? If so, I think that's the problem, but I don't know yet.

Signature is based on the keystore you use to sign your APK, if it's the same signature is the same, if not then it change and you need to use the correct hash

GabrielCR99 commented 3 years ago

Signature is based on the keystore you use to sign your APK, if it's the same signature is the same, if not then it change and you need to use the correct hash

Thanks for the answer, man! I'll be looking for the correct hash today, and then I'll check if works. Will be contacting you soon. Congratulations for the package, it's very useful!

sfyanbel commented 3 years ago

I'm sure the signature it's same And I still don't solve this issue

GabrielCR99 commented 3 years ago

@sfyanbel so, I was working on it today, and figured out that app signature does indeed change between release and debug. As @jaumard said, you need to use the correct hash. What I did was just get the signature using the method SmsAutoFill().getAppSignature, with await and so on. Then, I changed the SMS with the correct signature, and it worked perfectly!

yash365 commented 3 years ago

Hey @GabrielCR99 @jaumard i tried that method too while building the app I got the different hash key I testing it worked, but when I uploaded the app in the play store the same release hashkey didn't listen for play store. When I checked the same app uploaded in playstore version hashkey is changed. I tried getting the hashkey mentioned in sms-retriever-docs but getting this issue : issue

kamyar75 commented 3 years ago

Signature is based on the keystore you use to sign your APK, if it's the same signature is the same, if not then it change and you need to use the correct hash

Thanks for the answer, man! I'll be looking for the correct hash today, and then I'll check if works. Will be contacting you soon. Congratulations for the package, it's very useful!

how to solve this problem ?? change package name and get new signature ?? now, you app running is relase mode and debug mode ??

kamyar75 commented 3 years ago

My problem is solved, note that the app signature (for text message) may be different in release and debug mode, and my problem was solved accordingly.

mohamoha6200 commented 3 years ago

Guys we are way past debug vs release , the real problem is when you go live production on play store that's when play store re auto signs your app and the hash that used to work on release apks is no longer valid ! following the google docs to generate the right hash is tricky and all the hashes I generated didn't work any idea how to solve this ? @jaumard since you are using this on production can you confirm that the play store signing is different than normal release apks signature ?

jaumard commented 3 years ago

@jaumard since you are using this on production can you confirm that the play store signing is different than normal release apks signature ?

The hash should correspond to the keystore used to sign this app, I personaly use the same one in google play or when generating APK, appbundles. But I guess if you use different keystore on google play you should use the hash of google play keystore.

jaumard commented 2 years ago

Closing, please be careful of the hash you're using, let me know if you have other issues

eaglemindsdev commented 1 year ago

i have tested in debug mode it is worked but in release mode does not work

give me the sollutions