Enabling Fine-Grained Permissions in Smartphones