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

fix: UAD crash when interacting with work profiles #448

Merged
merged 2 commits into from
Nov 20, 2022

Conversation

0x192
Copy link
Owner

@0x192 0x192 commented Nov 20, 2022

I finally had the opportunity to get my hands on an Android 12 phone to try to reproduce the crash reported by multiple people!

Here is the conclusion:

On recent Android devices, you can't interact with the user of the work profile. Any adb commands involving this user will fail with a Shell does not have permission to access user ${user}.

The crash: when the option affect all the users of the phone was on, UAD changed the state of the packages (in UAD memory) for all users as soon as the adb command for the user 0 succeed (yeah not great). Obviously, since no packages for the work profiles user were loaded in memory, UAD crashed by trying to changing non-existent data.

This pull request only fix the crash by preventing package state change in UAD before the associated command succeed (that sounds logic. I don't know why I didn't code this in the first place).

This means UAD will still try to mess up with the work profile user but without crashing or warning the user in the GUI it failed.

Next step: inform the user in the GUI.

Closes #413, #386, #377

On recent Android devices, you can't interact with the user of the work profile.

Closes #413, #386, #377
@0x192 0x192 added crash bug Something isn't working fix labels Nov 20, 2022
@0x192 0x192 merged commit 5ea6177 into main Nov 20, 2022
@0x192 0x192 deleted the fix/work_profile_crash branch November 20, 2022 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Closing automatically
1 participant