android-app-ops

AOSP: How to restrict app accessing Camera, Location?

别来无恙 提交于 2020-01-05 12:29:29
问题 I'm trying to restrict apps in Android by modifying source code. I was able to get it working for Internet, but I was not able to restrict apps from using Camera or Location? Internet permission is enforced at linux process level with group-id. But I Camera/Location are not enforced the same way. So I want to know what is the best place to restrict the apps for these permissions. Are checkCallingPermission() enforceCallingPermission() methods the right ones? 回答1: Yes, you're right. In these

What happens when permission is disabled with OS 4.3's new feature?

梦想与她 提交于 2019-12-01 05:25:54
I heard that OS 4.3 has hidden feature to disable some permissions w/o repackaging APK. When we release app, we add necessary permissions and make app work. But that feature can disable permissions. I know some app have been doing this though it's a hack and I don't need to care. But with OS 4.3, user can easily can do this. Now my question is, when permission is disabled, does corresponding API throws exception? (I guess so.) If this is true, I should add try-catch for some operations otherwise novice user may end up thinking my app is poorly designed. Or, I will add some code to check

What happens when permission is disabled with OS 4.3's new feature?

ε祈祈猫儿з 提交于 2019-12-01 03:45:13
问题 I heard that OS 4.3 has hidden feature to disable some permissions w/o repackaging APK. When we release app, we add necessary permissions and make app work. But that feature can disable permissions. I know some app have been doing this though it's a hack and I don't need to care. But with OS 4.3, user can easily can do this. Now my question is, when permission is disabled, does corresponding API throws exception? (I guess so.) If this is true, I should add try-catch for some operations