buttercup / buttercup-mobile

:iphone: React-Native mobile application for Buttercup
https://buttercup.pw
GNU General Public License v3.0
392 stars 69 forks source link

Update for Android Autofill bridge #288

Closed se1exin closed 2 years ago

se1exin commented 2 years ago

@perry-mitchell Looks like you were just missing the initial calls to the AutofillBridge that request Android to add Buttercup as an Autofill provider to the device. I've also updated the App.tsx to correctly detect the flag to say it is being opened from Autofill.

Note I haven't tested the changes on iOS, but I don't see why it would do anything other than make it work better there as well.

se1exin commented 2 years ago

@perry-mitchell I found a new issue but it looks to be on the Buttercup JS side, I'm hoping you can take care of it?

When selecting 'Continue with Buttercup' from an autofill prompt, the AutofillApp is opened (on the React side). This is working fine, but when I go to unlock a vault I get undefined is not a function.

Screenshots: Screenshot_20220102_151144

Screenshot_20220102_151029

perry-mitchell commented 2 years ago

Wow, that was quick!

Thanks again for saving us on this one.. I'm certain Buttercup would still be without autofill if it wasn't for you 😄

I'll merge this, looks excellent. I'll add the necessary switch/option as well as part of the next release.

perry-mitchell commented 2 years ago

When selecting 'Continue with Buttercup' from an autofill prompt, the AutofillApp is opened (on the React side). This is working fine, but when I go to unlock a vault I get undefined is not a function.

I'll keep an eye out for this. It works on the iOS side so perhaps it's something with the crypto bridge I've messed up.. Let's see.

perry-mitchell commented 2 years ago

Hi @se1exin - It seems that the error regarding that "undefined is not a function" is due to getEntriesForSourceID not existing on the autofill bridge:

image

Though after checking v1 of the app, I also don't see it there. It's getting late here so I could have missed something 😅 - I'll keep looking. If something comes to mind please let me know :)

perry-mitchell commented 2 years ago

Ok, think I got it.. Implemented it in fe97d6a05eb1d78034b21afb85435f19955b0729 - Seems to work after a quick test 😄

se1exin commented 2 years ago

@perry-mitchell now you have me scratching my head 😆

I've just gone back through v1 and getEntriesForSourceID never existing on the bridge, or is it in the codebase anywhere. I can't find it in the PRs that added autofill either... so I have no idea where that method came from.

se1exin commented 2 years ago

Ok, think I got it.. Implemented it in fe97d6a - Seems to work after a quick test smile

Ahh! I though I had seen it somewhere, good to see you figured it out