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

Work around READ_CALL_LOG being hard-restricted #308

Merged
merged 1 commit into from
Apr 21, 2023
Merged

Conversation

chenxiaolong
Copy link
Owner

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

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]>
@chenxiaolong chenxiaolong self-assigned this Apr 21, 2023
@chenxiaolong
Copy link
Owner Author

Test build: BCR-1.40.r6.g62324b3-debug.zip

@chenxiaolong chenxiaolong merged commit 517d548 into master Apr 21, 2023
@chenxiaolong chenxiaolong deleted the restricted branch April 21, 2023 16:55
chenxiaolong added a commit that referenced this pull request Apr 21, 2023
Signed-off-by: Andrew Gunnerson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Call log permission is never requested
1 participant