1

My understanding is this that we cannot use dangerous features of Android without asking the permissions for it. But I came across this application which is a camera application. I have installed it on 3 devices all above android Marshmallow but it never asked to use Camera Permission on any of those devices still the camera for it worked. Can someone explain me how is this even possible? Thanks!

Application Link: https://play.google.com/store/apps/details?id=com.jb.zcamera

Aiman Muzafar
  • 385
  • 1
  • 4
  • 11

2 Answers2

2

The only way around it, is to use a target SDK of 22 or lower. In which case the permissions will be requested at install. Note that you will not be able to distribute your app through the play store with a target Sdk lower than 26.

If the device is running Android 5.1 (API level 22) or lower, or the app's targetSdkVersion is 22 or lower, the system asks the user to grant the permissions at install time.

The camera permission is a dangerous permission.

Check for permissions

If your app needs a dangerous permission, you must check whether you have that permission every time you perform an operation that requires that permission. Beginning with Android 6.0 (API level 23), users can revoke permissions from any app at any time, even if the app targets a lower API level. So even if the app used the camera yesterday, it can't assume it still has that permission today.

The app you reference asks for runtime permissions.

This answer discusses the possible abuse of Android permissions. It's something that needs to be reported to Google.

Community
  • 1
  • 1
  • 1
    I think the first sentence is a bit confusing/misleading. Maybe remove it – Tim Dec 05 '18 at 10:38
  • @TimCastelijns what do you think now? –  Dec 05 '18 at 10:40
  • Note that you will not be able to distribute your app through the play store with a targetSdk lower than 26 – Tim Dec 05 '18 at 10:51
  • @TimCastelijns yes, I was going to add this app looks like it was made in 2018. So it can't be a low target sdk –  Dec 05 '18 at 10:51
1

If the dangerous permission is not granted then the camera will not be used. However, it can still work by delegating the process of taking a photo with an Intent to another camera application which will take the picture for you.

See Take Photos

Murat Karagöz
  • 35,401
  • 16
  • 78
  • 107
  • Thank you so much for taking your time and replying. But according to my understanding, the application is using a custom camera activity. It also installs a gallery app (which too never asks for any permissions). – Aiman Muzafar Dec 05 '18 at 11:12
  • @AimanMuzafar Can not say much else. These are the technical limitations. Another way around would be a system app. – Murat Karagöz Dec 05 '18 at 11:53
  • Thanks Murat Karagoz, really appreciate your help :) – Aiman Muzafar Dec 10 '18 at 11:19