bitwarden / mobile

Retired Bitwarden mobile app for iOS and Android (MAUI/Xamarin).
https://bitwarden.com
GNU General Public License v3.0
102 stars 12 forks source link

Accessibility service: this service is malfunctioning #596

Open iudStUBHIRt0OEpRPyUDCmeS8izWb6Z9Y23ymXC opened 5 years ago

iudStUBHIRt0OEpRPyUDCmeS8izWb6Z9Y23ymXC commented 5 years ago

My accessibility service (android 9) keeps breaking. When I go to the enable screen android notifies me that this service is malfunctioning.

Let me know if I can supply any useful debug data.

pPmnBRRYhIemiuiy3VBYULJIzQyZaEvWMbCPH1P commented 5 years ago

What type of device?

iudStUBHIRt0OEpRPyUDCmeS8izWb6Z9Y23ymXC commented 5 years ago

Oneplus 3, Android 9 (stock).

bnzmyDYTrvosCYTBpRWo6takTuZYEJQ4xOHAQDL commented 5 years ago

Also appears on my Zenfone 6 with stock Android 9. There's no icon at status bar in the presence of password box. Reabling Bitwarden in accessibility can fix this problem for a while, but the problem reappears after several minutes.

iudStUBHIRt0OEpRPyUDCmeS8izWb6Z9Y23ymXC commented 5 years ago

Reabling Bitwarden in accessibility can fix this problem for a while, but the problem reappears after several minutes.

Confirming that this is the same for me. I can re-enable but after a time (unpredictable) it breaks again.

ghost commented 4 years ago

@actuallymentor if you're using a OnePlus device go into the battery settings, battery optimisation, click on the three dots in the top right, click advanced optimisation then disable deep optimisation. This seems to have fixed this issue for me.

iudStUBHIRt0OEpRPyUDCmeS8izWb6Z9Y23ymXC commented 4 years ago

@vargbeaumont thanks for the tip!

if you're using a OnePlus

I am.

disable deep optimisation

Did it just now and will post back if it ends up breaking.

kuy96FtzOZzFYPZm9cAYXr0YWeTZYWFDX3YAOwL commented 4 years ago

I have the same problem. I tried to keep deep optimization, but select "don't optimize" next to bitwarden optimization settings (settings -> battery -> battery optimisation). Will report back if I still encounter the problem.

iudStUBHIRt0OEpRPyUDCmeS8izWb6Z9Y23ymXC commented 4 years ago

Did it just now and will post back if it ends up breaking.

Confirming that even unoptimised it keeps crashing.

No other accessibility services have this issue currently.

hWqPwdSJv16av4QotW7S7UuIf0j6RolaMMXrcSq commented 4 years ago

Did somebody find a solution for this problem? I have the same problem

hdDUn8BcTOxRGQ4VKKMYKTparmKpSJobsLITSfK commented 4 years ago

Same issue here as well, OnePlus 3 (android 9) + battery optimization turned off

PqdYlnH8VDYU0NONa9tdKUHi1UR2BtYq77fdeto commented 4 years ago

Same issue on HUAWEI P smart Z (STK-LX1) with EMUI 9.1 (Android 9).

TQIPmmpBmmVRdAP0gzjTvd3jun9b1MeJdllr0Ua commented 4 years ago

Also can confirm this is happening on my Google Pixel 3 XL on the 11 Beta.

qiKMxWFSRv6lhu8l3BTcXw4h4BcBC0tot5XUjcS commented 3 years ago

OnePlus 8 running Android 11 checking in, same issue.

0M4N7JRocpoqwbEfSYh60Uv7ZdgL8mlZRwapOTW commented 3 years ago

Pixel 4 xl, android 11, same issue here also.

yKQb88Ef3Vif9mFd2frA71WH3fpmrofjLHUBuSZ commented 3 years ago

Hi Guys I also starting developing one Accessibility service and just trying to get kind of event and getting service is malfunctioning on oneplus 8T. Did u able to resolve the issue somehow.

BvatRtTnqKPC5tAHpYRFgaCO2HPAqmyVweizB9T commented 3 years ago

Identical problem on Poco F3 running MIUI 12.5 (Android 12)

Lt0C58CRHMFUpVA6unjPH18JTIAPESKsCrZE9G8 commented 3 years ago

Facing same issue in sending WhatsApp message using accessibility service but it crashes after 5 times working properly. Then I need to manually click 2 times back button to come back to my Original Android App after sending the message.

BbixyRgkuJHKdSmfw8ek5YnPgICsYNtV9XbbdPN commented 3 years ago

Redmi Note 9 Same message while trying to click the icon in quick settings.

yPL6A4EDbI92ykwDpqNHvZoyBAFM8OkC00gjC91 commented 2 years ago

Same error on Xiaomi Mi 9T Is there any fix soon?

HEN83FZlOcChHJ76J9lTCAn6061XQspWBQUuahU commented 2 years ago

Same issue MiUI12.5.5 on Mi 10T (Android 11)

WwzWPkiyo5yjy6BufMGyPF1opOPOvjhGOUOD98w commented 2 years ago

Same here MIUI 12.5 android 11, Poco X3 NFC

Clear app data, reinstall, reboot did not solves this problem.

IMG_20220118_192711

EBgO2cpvpvXiSbDavlNwzV1Ip8H5kEGfNR3DbGh commented 2 years ago

No go on Poco X3 Pro. Whats the deal yo?

eHMe3UWIsTzT5sIrAKyn1oDJqwjkDs9e8Eb0vAw commented 2 years ago

The same happens on Huawei P Smart 2018 with EMUI 9.1 (Android 9)

WwzWPkiyo5yjy6BufMGyPF1opOPOvjhGOUOD98w commented 2 years ago

Okay I found a simple solution.

Just give auto start permission and then problem solved.

Screenshot_20220630_073231

1XI1R7f5yHvqcdfwI9xXwlgf2wgLF1i4AHYz1Qa commented 2 years ago

@nri82 What phone and OS version are you running? I don't see that exact interface on my Pixel 3a running Android 12 (Build SP2A.220505.006). I wonder if there's a similar permission that goes by a different name?

WwzWPkiyo5yjy6BufMGyPF1opOPOvjhGOUOD98w commented 2 years ago

@nri82 What phone and OS version are you running? I don't see that exact interface on my Pixel 3a running Android 12 (Build SP2A.220505.006). I wonder if there's a similar permission that goes by a different name?

Poco X3 NFC, android 11, MIUI 12.5. in short you need to give auto start permission but I don't know it's works or not on your situation.

eHMe3UWIsTzT5sIrAKyn1oDJqwjkDs9e8Eb0vAw commented 2 years ago

Okay I found a simple solution.

Just give auto start permission and then problem solved.

@nri82 Autostart is not a thing on Huawei

WwzWPkiyo5yjy6BufMGyPF1opOPOvjhGOUOD98w commented 2 years ago

Okay I found a simple solution. Just give auto start permission and then problem solved.

@nri82 Autostart is not a thing on Huawei

Yes I noticed that my solution is working on Xiaomi MIUI sorry for this situation.

hdDUn8BcTOxRGQ4VKKMYKTparmKpSJobsLITSfK commented 2 years ago

How about using some Automator like "Tasker" to autostart the the app, say at interval of 1 hour. That might work. I no longer face this issue as I moved form OP3 to OP8

eHMe3UWIsTzT5sIrAKyn1oDJqwjkDs9e8Eb0vAw commented 2 years ago

How about using some Automator like "Tasker" to autostart the the app, say at interval of 1 hour. That might work. I no longer face this issue as I moved form OP3 to OP8

@Web-E Huawei also does not like these "Automators" and eventually kill those as well.

qiKMxWFSRv6lhu8l3BTcXw4h4BcBC0tot5XUjcS commented 2 years ago

It will vary for different phones. On the latest OnePlus software, you go to Settings > Apps > Auto launch, find the app you want to allow, and turn it on.

k9tJYH8ywHQmoCYEfLiIOb9en92asLkms9BTQ5c commented 2 years ago

Using Tasker to solve this problem probably won't work. Tasker has the same problem.

0AjC2ljob2esC3Cc6vkeqFSq74aenAUoi3Rx2pp commented 1 year ago

Android 12 MIUI, same problem. Not just this app some other apps' accessibility is broken.

qxkx8ZIcIELUi7CXcgCR15b0HWT1SuMfQzvUdeC commented 1 year ago

1- Force stop the application 2- Enable auto start 3- Enable battery saver first, then disable again. 4- Now enable accessibility again.

This solved the problem for MIUI 13 Android 12. The reason for this malfunction is;

1- Google is trying to cripple call recording apps and constantly limiting the use of Accessibility API 2- Some of the vendors like Xiaomi and Samsung kill background applications too often to "save" battery and this breaks how the app works.

By the way, although everything is working smoothly, Bitwarden fails to autofill password fields which open only numpad for entry.

2CGkmDCm5uA9IVlQqxSNrbtEuxB3vhsTooQa0Zz commented 1 year ago

Okay I found a simple solution.

Just give auto start permission and then problem solved.

Screenshot_20220630_073231

Yes, its work

k9tJYH8ywHQmoCYEfLiIOb9en92asLkms9BTQ5c commented 1 year ago

Sometimes Accessibility service fails for me, but when using Tasker, not Bitwarden. Also, I can't find this AutoStart option in my app info screen, or in the Permissions Manager. Android 11, running on a TCL A3. The Tasker people say it's due to a complicated bug in Android, best as I understand them.

kz0IqFwickNcknzaqlmBYDxwEGNfCfcFB1GjURV commented 1 year ago

Hi there. Thank you for clarifying what the issue is. Regarding any accessibility service, it's just impossible to re-enable them automatically if they either malfunction and/or are turned off, isn't it? At least without user interaction, I believe it's impossible to do so, am I right? Now, when you say "enable and disable battery saver", do you mean we ought to do that with the global battery saver or just within the app's settings? I've been experiencing the same issue on my Xiaomi 13 / Android 12 (RemiNote9). But I do wonder whether this malfunction would also happen on Android 13+. Androi 9 seems to be fine, but I yet have to test Android 10, and 11.

k9tJYH8ywHQmoCYEfLiIOb9en92asLkms9BTQ5c commented 1 year ago

Unfortunately, I'm not an expert on how the Android accessibility service is programmed, or any of Android, for that matter. I'm just a user of Tasker and Bit Warden (and a retired professional software engineer) and not happy with the mixed uses of the accessibility service. Android wants accessibility service to be just for disabled people, but there are certain apps, like Tasker and Bit Warden, that want to be helpful by making devices more useful for everyone. Ideally, Android should provide an "internal" or "advanced" service for such Apps, separate from accessibility service. We need one or two more Permission categories, probably. But only Android developers can help, and they seem unwilling to. Developers of apps like Tasker and Bit Warden must kludge together solutions to get around current Android limitations. The situation is unfair, but not an unusual one in software development history.

k9tJYH8ywHQmoCYEfLiIOb9en92asLkms9BTQ5c commented 1 year ago

It seems to me that one such kludge is to run a separate service or app that monitors the accessibility service and re-enables it when Android decides to stop it or to block permission to use it. Such a service only needs to run once every few seconds.

kz0IqFwickNcknzaqlmBYDxwEGNfCfcFB1GjURV commented 1 year ago

It seems to me that one such kludge is to run a separate service or app that monitors the accessibility service and re-enables it when Android decides to stop it or to block permission to use it. Such a service only needs to run once every few seconds.

Well, as far as I'm concerned, it's impossible to re-enable an accessibility service without user interaction after it has been turned off. Nevertheless, I don't know if it's possible to automatically fix it if the problem is that it is malfunctioning while still being on. In this case, theoretically, one should be able to do something in order to automatically repair the malfunction. Maybe a work manager could fix it. I'm sure it's possible to monitor the service state at the least. I can't believe no one has found a workaround. Or maybe they have and haven't shared it yet.

kz0IqFwickNcknzaqlmBYDxwEGNfCfcFB1GjURV commented 1 year ago

Now that I think about it, it'd make sense to be cautious not to share the workaround because android developers would just patch it. I mean, clearly they have no intention of prioritizing continuity on Android services in general.

k9tJYH8ywHQmoCYEfLiIOb9en92asLkms9BTQ5c commented 1 year ago

Over at least the past year, the Tasker developer has frequently posted supposed fixes for the problem that restarting Android or installing a new version sometimes stops the accessibility service, including his creating a separate app that the user installs. None of these fixes have worked perfectly for me, although some have helped. I agree that it may not be ethical to publicize a fix, since it currently seems against the wishes of the Android developers. As I said, there needs to be a new and separate service for apps like Tasker and Bit Warden to give them the ability to do what they need to do.

kz0IqFwickNcknzaqlmBYDxwEGNfCfcFB1GjURV commented 1 year ago

Over at least the past year, the Tasker developer has frequently posted supposed fixes for the problem that restarting Android or installing a new version sometimes stops the accessibility service, including his creating a separate app that the user installs. None of these fixes have worked perfectly for me, although some have helped. I agree that it may not be ethical to publicize a fix, since it currently seems against the wishes of the Android developers. As I said, there needs to be a new and separate service for apps like Tasker and Bit Warden to give them the ability to do what they need to do.

I totally agree with you. Not only would it be unethical, it'd also be a problem to the one that found the fix because Android would take a look and patch it. If I found a fix, I wouldn't want to let Android know. I mean, I understand their posture on this matter; nevertheless, like you well said, they should at least allow some apps to use an unrestricted type of service that let's them do what they are intending to do. I agree 100%. If anyone would like to create an entire new mobile OS, please let me know so we can team up because I'm tired of Android...he he.

7lfx5egSoCxap6IIzA0i7y1bOqMJqcyXqZGg5qg commented 8 months ago

Had this issue myself with poco F3, miui 14 and bitwarden.

Autostart (once I be found the setting which moved) didn't fix it, Bitwarden still shows it is malfunctioning.

Tried to lock the app but there is this bug on the recent apps and 3rd party launchers in the menu when you long press dues but sure.

Eventually found it (miui seen to have a competition at each release to move a setting to the most obscure place possible).

That works - is you lock Bitwarden in memory, the accessibility is fixed.

Why that should error out is this is but dry must, in itself, be a bug.

Locking the app (not too be confused with lock app which is completely different ffs) can now be found under Security -> Boost Speed -> Lock Apps.

Can I just say how much I enjoy, in this screen, the fact that the apps are listed in NI discernable order. And just wtf has Boost Speed got to do with Security?

It's as if they are trying to make it impossible to find and, if you are lucky enough to stumble across it, unnecessarily awkward to use. Jesus, Xiaomi..

Still - that's how I got it working.

ItsAdi22 commented 3 months ago

I am facing the same issue in realme 6