How do I determine why my Android app requires certain permissions?

前端 未结 4 1538
执念已碎
执念已碎 2021-01-05 01:25

Let\'s say I have taken over development of an Android app, and my boss asks me why our app requires certain permissions to be displayed to users who buy the app on the Andr

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-05 01:29

    Remove a permission and see where the app fails. The answer will be in the logcat output.

    That's not an ideal solution though, since you might not know what you need to do in the app to trigger that permission.

    I suspect "Read phone status and identity" means that the app is using the device IMEI or similar identifying information to uniquely identify the device to ensure that the app is only being run on a registered device. Or it might just be used as a sort of cookie to track the owner. Look for that code. And remove it, because that's the wrong way to do it. If you need to identify a specific android device, use ANDROID_ID from the Settings.Secure class. http://developer.android.com/reference/android/provider/Settings.Secure.html

    As for "Retrieve running applications", I find that one somewhat suspicious. A very common way to implement GPS tracking is to launch a separate service in its own process. This way, if the app should crash, the service will keep going and can be re-attached. In this case, it's possible that the app is using the "Retrieve running applications" to identify and kill the service process. But if so, it's a clumsy way to do it.

提交回复
热议问题