On Android, if you install Xposed, there's XPrivacy [0], which essentially had this premise. Unfortunately, it only supports versions 4.0.3-5.1.1 (and is no longer maintained).
I haven't been following the rooting community for a while, so someone can probably correct me if there's a better alternative now, but I believe the replacement is XPrivacyLua [1].
[0] https://github.com/M66B/XPrivacy
[1] https://www.xda-developers.com/xprivacylua-xposed-module-pri...