-
Notifications
You must be signed in to change notification settings - Fork 113
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
Call log permission is never requested #304
Comments
Hmm, I have no idea what would cause it to not show up in the app info screen. There's nothing an app can do (in theory) to prevent a permission from showing up there. I'm not able to reproduce this on my Pixel 7 Pro. Just to rule out the possibility of something lingering, can you try If that doesn't do it, the output of |
To clarify, the permission is there in App Info, and I can tap to change it from "Don't allow" to "Allow", but my change doesn't stick -- it remains under "Not allowed" when I go back to the previous screen. I assume this is the case because, although the manifest declares it, BCR hasn't actually requested that permission from me yet. I'm able to toggle the permissions that have been requested no problem. |
From
|
What the heck. I didn't know that was a thing for I'll play around and see if I can reproduce this. I don't know why it doesn't affect my device yet--maybe due to my use of debug builds. EDIT: Yup, debug build was the reason I didn't catch this. The permission is granted for those builds and switching from debug to non-debug builds does not add back the EDIT 2: Nope, my understanding wasn't quite right. I had an old debug build flashed via Magisk. Then I added |
This is pretty infuriating. So
I'm still looking through the AOSP code, but I'm not really seeing any great solutions. |
I'm assuming it's not possible to simply flag BCR with the |
Sounds like it might be possible to simply target API 28 as well, before this restriction was added, but again, I'm assuming you would've already done that unless there was good reason not to. |
I found a horrendous way to do this, but I think it'll work. I made a small command line application inside BCR that'll talk to Android's
and it successfully alters the flags. Seems to work on both GrapheneOS and stock Pixel OS. I just need to figure out how to switch from the root user to the system user without calling Also need to figure out if all the hidden APIs I'm calling exist in Android 9-12. |
Since Android 10, READ_CALL_LOG has been marked as a hard-restricted permission, which prevents it from being granted by the user unless the app is given an exemption. There are three types of exemptions: system, upgrade, and installer. System exemptions can be given by `/system/etc/default-permissions` (only on first boot) or via roles. Neither are usable for BCR. Upgrade exemptions are only given during Android OS upgrades that further restrict existing permissions. Installer exemptions are given by whichever app installs another app, but there's no installer when it comes to adding new system apps, like BCR. Since AOSP has no sane built-in way to exempt BCR from the hard restriction, we'll do it ourselves. This commit introduces a new CLI utility baked in BCR that will talk to PermissionManager (Android 11+) or PackageManager (Android 10) to adjust its permission flags. This will unfortunately require two flashes (but only one reboot) for the initial install, because BCR must have already been loaded by the package manager for the flags to be changed. However, once the exemption has been granted, it persists across future upgrades. Fixes: #304 Signed-off-by: Andrew Gunnerson <[email protected]>
Would you mind giving the test build at #308 a try? |
Confirmed working. Great work as always! |
Awesome, thanks for testing! |
Oops, I never responded to your suggestions, sorry.
This is a good idea, but I didn't end up trying it. Many of the roles are hardcoded to a specific preinstalled app, but this one in particular happens be tied to the default dialer option exposed in Android's settings. This would require code changes to have BCR pretend to be a dialer, but maybe Android would allow it to keep the exemption if you temporarily set BCR as the dialer and then change it back?
Another good idea (at least for OS's that don't enforce that the user app must be newer than the system app). I didn't go this route because the
This unfortunately won't work due to SELinux restrictions. User and system apps are labeled differently.
I may have missed something, but I don't think this is the case. As far as I can tell, the restrictions apply to apps targetting older API versions too. It technically doesn't break compatibility because Google Play grants exemptions for the apps they allow to use |
Definitely an impractical solution, then. Seamless or bust, I say.
Perhaps this could be used to work around the two flashes issue? |
Yeah, polling would probably work. It would need to be something else that's tied to the user logging in though. I believe |
This is more seamless since it removes the need to flash BCR twice. The startup service will wait up to one hour for the user to unlock the device before it performs the hard restriction removal. Logs are written to `/data/local/tmp/bcr_remove_hard_restrictions.log`. Issue: #304 Signed-off-by: Andrew Gunnerson <[email protected]>
Polling was a great idea: #309. Now we're back to seamless installs!
|
I can't seem to get BCR v1.40 to request the call log permission, even after clearing storage, even with the appropriate variable in my filename template. Apparently it can't be manually enabled in App Info either. Do you need anything from me to debug this?
The text was updated successfully, but these errors were encountered: