PhilippC / keepass2android

Password manager app for Android
https://play.google.com/store/apps/details?id=keepass2android.keepass2android
GNU General Public License v3.0
4.73k stars 382 forks source link

Support Autofill in Kiwi Browser (Chromium fork) #834

Closed 4-FLOSS-Free-Libre-Open-Source-Software closed 2 years ago

4-FLOSS-Free-Libre-Open-Source-Software commented 5 years ago

Basically this is an enhancement Chromium with chrome web store extensions support appeared on XDA developers. Kiwi Browser

ironically you can install Kee/chromiepass/keepasshttpconnector/kepassxc-browser chrome extensions into it. but while it however cannot communicate with kp2a natively :)

PhilippC commented 4 years ago

is there any other app that is providing autofill in Kiwi? I didn't find any nor does it work with Android autofill (not even with Compat mode enabled, see #290)

4-FLOSS-Free-Libre-Open-Source-Software commented 4 years ago

is there any other app that is providing autofill in Kiwi?

Thank you for adding to future milestone. Unfortunately I do not know about another example that supports autofill with this browser. Sadly can't provide example for that functionality.

Thought it would exist in some way since it's claim to be a chromium fork. But will check.

jakommo commented 4 years ago

There is https://github.com/bitwarden/mobile/issues/335 , which sounds like bitwarden should work with kiwi, but I just did a quick test and it does not seem to work, though I haven't used bitwarden before so I might be missing something.

4-FLOSS-Free-Libre-Open-Source-Software commented 4 years ago

There is bitwarden/mobile#335 , which sounds like bitwarden should work with kiwi, but I just did a quick test and it does not seem to work, though I haven't used bitwarden before so I might be missing something.

I have tried it and it simply works.

is there any other app that is providing autofill in Kiwi? I didn't find any nor does it work with Android autofill (not even with Compat mode enabled, see #290)

Yes, as mentioned earlier from other. Auto fill is possible with bitwarden. Website detected and choosing entry correctly. Screenshot_2020-03-27-17-20-57-580_com kiwibrowser browser~01

kkuhle commented 4 years ago

Would be nice to get the accessibility autofill plugin working as I just started using Kiwi. Won't be using it for long if I can't use keepass with it though.

PhilippC commented 4 years ago

@4-FLOSS-Free-Libre-Open-Source-Software could you please repeat your test with Kiwi+Bitwarden? It doesn't work for me. If it does for you, please let me know which version of Android, kiwi and Bitwarden you are running!

4-FLOSS-Free-Libre-Open-Source-Software commented 4 years ago

Android 10. Kiwi 77.0.3865.92

Bitwarden will be latest stable from repo . As Im not using it normally but kp2a instead, removed it. I will test it again and report information.

Please make sure, to enable both services. Auto fill & accessibility service.

This wasn't enough for bitwarden entry offer to appear. It is important, the bitwarden app is given the so called Android permission:

Show pop-ups

It was disabled and than the entry filling will not show for me.

With this enabled it works. If not. Nothing happened. Everything else default settings.

Please check. If you need more information let me know.

Sample bitwarden tresor used kee@pass.2a:12345678

Used this version: https://mobileapp.bitwarden.com/fdroid/repo/

2.4.3 2518 21 29

IMG_20200622_233602 IMG_20200622_225007 IMG_20200622_224235 IMG_20200622_224209

Freundliche Grüße


4-FLOSS-Free-Libre-Open-Source-Software commented 4 years ago

IMG_20200623_093216 IMG_20200622_233602 IMG_20200622_225007 IMG_20200622_224235 IMG_20200622_224209

PhilippC commented 4 years ago

so you are activating the Accessibility service, right?

4-FLOSS-Free-Libre-Open-Source-Software commented 4 years ago

Ja.

Suncatcher commented 3 years ago

I would love to have autofill too, Kiwi is a cool browser which definitely deserves KP2A.

4-FLOSS-Free-Libre-Open-Source-Software commented 3 years ago

References:

https://github.com/kiwibrowser/src.next/issues/64 https://github.com/kiwibrowser/src/issues/31#issuecomment-885536343

some overview....: https://github.com/Kunzisoft/KeePassDX/wiki/AutoFill#compatibility-mode

kkuhle commented 3 years ago

We can get autofill (autofill service not accessibility in case anyone wants to use that instead) to work as detailed in this kiwibrowser comment but it might be something that has to be re-applied to have it continue working.

In 132 in this comment it was suggested to run some compatibility commands manually.

  • Store the current autofill_compat_mode_allowed_packages in a variable:
    n=$(settings get global autofill_compat_mode_allowed_packages)

If I run this command without storing in a variable to see the output, here is what I get:

settings get global autofill_compat_mode_allowed_packages                                                                           <
com.android.chrome[url_bar]:com.brave.browser[url_bar]:com.brave.browser_beta[url_bar]:com.brave.browser_nightly[url_bar]:com.chrome.beta[url_bar]:com.chrome.dev[url_bar]:com.chrome.canary[url_bar]:com.microsoft.emmx[url_bar]:com.opera.browser[url_field]:com.opera.browser.beta[url_bar]:com.opera.mini.native[url_bar]:com.opera.mini.native.beta[url_bar]:com.sec.android.app.sbrowser[location_bar_edit_text]:com.sec.android.app.sbrowser.beta[location_bar_edit_text]:org.mozilla.fennec_aurora[url_bar]:org.mozilla.firefox[url_bar]:org.mozilla.firefox_beta[url_bar]

^ these appear to be all of the other browsers that I have installed where autofill works.

autofill for kiwi doesn't work as set up above

  • add kiwi browser to this list
    settings put global autofill_compat_mode_allowed_packages $n:com.kiwibrowser.browser[url_bar]

    and now I have kiwi listed

    settings get global autofill_compat_mode_allowed_packages                                                                           <
    com.android.chrome[url_bar]:com.brave.browser[url_bar]:com.brave.browser_beta[url_bar]:com.brave.browser_nightly[url_bar]:com.chrome.beta[url_bar]:com.chrome.dev[url_bar]:com.chrome.canary[url_bar]:com.microsoft.emmx[url_bar]:com.opera.browser[url_field]:com.opera.browser.beta[url_bar]:com.opera.mini.native[url_bar]:com.opera.mini.native.beta[url_bar]:com.sec.android.app.sbrowser[location_bar_edit_text]:com.sec.android.app.sbrowser.beta[location_bar_edit_text]:org.mozilla.fennec_aurora[url_bar]:org.mozilla.firefox[url_bar]:org.mozilla.firefox_beta[url_bar]:com.kiwibrowser.browser[url_bar]

    and now autofill for kiwi works

Is there any way to add kiwi to this list without taking manual action to do it?

How are these other browsers getting added when they're installed?

Edit: if anyone wants to add it in the meantime before @kiwibrowser is potentially able to fix and does not have root (unless there is some other way to run these commands from device without root), you can use adb like this. (there is a way that I haven't used personally for tasker to send adb commands)

  1. store the current settings in a variable

    n=$(adb shell settings get global autofill_compat_mode_allowed_packages | sed 's/\:com.kiwibrowser.browser\[url_bar\]//g')
    • in the above command, I am stripping kiwibrowser with sed because I don't want to have it appear multiple times. If kiwibrowser doesn't exist, the | sed portion doesn't do anything
  2. add kiwibrowser to list of autofill_compat_mode_allowed_packages

    adb shell settings put global autofill_compat_mode_allowed_packages $n:com.kiwibrowser.browser[url_bar]
  3. Restart kiwibrowser

As kawaiiDango mentioned the settings may revert after some time (maybe after reboot?) so I am using tasker for my purposes to try to keep it persistent. A restart of kiwibrowser is required if the setting is applied after kiwibrowser is already running.

The developer is trying to sort out how he can get his app added to this list so that autofill service will work without the manual steps detailed above to get support for autofill service.

As for the accessibility (KP2A AutoFillPlugin), I cannot get this working. I've recently switched to the accessibility method over the service for reasons I can't really remember at the moment, so I'd like to get this working if possible.

@PhilippC do you know if there is any setting that KP2A AutoFillPlugin (like autofill_compat_mode_allowed_packages for the service) that could allow it to extract the URL instead of the app package name?

@kiwibrowser do you have any idea what might be preventing KP2A AutoFillPlugin (KeePass accessibility autofill solution) from getting the URL from kiwibrowser?

Edit: I tested with Bitwarden after a quick setup and it does in fact work with Bitwarden Accessibility as suggested previously.

lorddoumer commented 3 years ago

@kkuhle thank you so much for this tip! working like a charm with those two steps :)

PhilippC commented 2 years ago

should work with 1.09b (https://play.google.com/apps/testing/keepass2android.keepass2android)

kkuhle commented 2 years ago

Thanks, @PhilippC! Excited that this is working now! It seemed to be working without any manual work on the previous version of Keepass2Android per an update to Kiwibrowser discussed in 84 -- I don't know if updating to 1.09b is necessary. However, I did and I didn't find this in the release notes and didn't pay close enough attention to the app release notes when I updated. Did we just add gboard suggestions for autofill!?

If it was already here, I'm disappointed that I hadn't noticed it before. I tried bitwarden for a couple days and this was the only feature I felt keepass could improve on (there were so many other things keepass has over bitwarden other than this IMO). Really excited to have had this added (or discovered it if it was already there! Thanks a ton.

I suppose this is for the autofill service working and not the kp2a accessibility working (it still does not work). I generally use the system autofill, but have use for the accessibility autofill plugin from time to time (I have a tasker task with a gesture to activate it along with kpsa accessibility setting). This is because there are a few areas that the system autofill simply does not work at all. Whether it be a for a handful of websites or apps. I do not believe this is keepass, but a limitation of the autofill framework.

The screenshots below show the behavior with the latest Keepass2Android:

Is there any way to get the kp2a accessibility plugin updated so that Kiwi browser is able to also use it @PhilippC?

PhilippC commented 2 years ago

@kkuhle it's true that maybe this was fixed rather by Kiwi than by KP2A. I just tested with the latest version and saw that it's working :-)

Regarding inline suggestions, these are mentioned in the beta's change log and release notes and were introduced just yesterday.

I am not planning to update the accessibility service. I have too little time for development anyway :-(. I suggest to use the built-in keyboard whenever autofill does not work.

lorddoumer commented 2 years ago

somehow the workaround via adb-wifi doesn't work now anymore (doesn't seem to work without for me) :(

EDIT: oh my bad - needed to select "autofill" after a long tap, then it works again :)