我可以跳过询问棉花糖的运行时权限吗?(Can i skip asking Runtime Permissions on marshmallow?)

编程入门 行业动态 更新时间:2024-10-15 18:23:03
我可以跳过询问棉花糖的运行时权限吗?(Can i skip asking Runtime Permissions on marshmallow?)

现在这对我来说非常有趣,我主要了解运行时权限,我很清楚为什么提出运行时权限? 以及我们如何使用它? 但是在这个问题中 ,由于这个运行时间允许的事情导致了一个问题,一个人提出了一个更新的方法来解决这个问题。

请参阅U.swap对同一问题的回答, 是答案。

这家伙提出了一个很好的工作解决方案,用户必须只批准一次权限,并且在他的余生中他不必担心所有运行时权限 ,应用程序将在marshmallow版本和Pre-marshmallow版本上运行,如评论中所述我和Commonsware之间讨论的所有评论。

@NiteshPareek:这个答案没有任何阻止该应用程序在Android 6.0+设备-Commonsware上运行

但这意味着我们可以通过运行时权限提出的安全性来购买? @CommonsWare - Tapan parmar

@Tapanparmar:不,因为用户可以在“设置”中手动撤消权限。 使用targetSdkVersion 22或更低版本意味着您的应用程序不会有任何运行时权限代码,因此用户需要在安装时同意您请求的权限。 这就是Android从一开始就运作的方式。 - CommonsWare

确定所以应用程序将在没有显示权限的情况下在marshmallow上运行 @CommonsWare - Tapan Parmar

@Tapanparmar:在安装应用程序时将向用户显示权限。 - CommonsWare

好的,所以我们可以跳过由此提供的那种怪异的权限,但这样做有什么缺点吗? @CommonsWare

@Tapanparmar:用户可以选择不安装您的应用,如果他们不喜欢预先授予所有权限。 此外,您可能希望基于更高的targetSdkVersion值的其他行为可能会丢失。 如果您还有其他问题, 另外提出Stack Overflow问题。 - CommonsWare

所以我想知道这样做有什么实际缺点吗? 安全性会发生什么,这是RunTimePermissions的主要目的。 这样做真的好吗?

请参阅答案中的评论或参见下图

Now this is something very interesting for me, I know mostly about Runtime Permissions and i am well aware of why Runtime Permissions proposed? and How we can use it? but in this question which is about a problem rising due to this run time permission thing, A guy proposed a pretty newer way to solve this problem.

See U.swap's answer on the same question,here is that answer.

This guy Proposed a nice and working solution that user have to approve Permissions only once and for rest of his life he don't have to worry about all Runtime permissions and application will run on marshmallow versions and Pre-marshmallow versions as discussed in comments see all comments as discussed between me and Commonsware.

@NiteshPareek: There is nothing about this answer that prevents the app from running on Android 6.0+ devices -Commonsware

but it means that we can buypass the security proposed by Runtime Permissions? @CommonsWare – Tapan parmar

@Tapanparmar: No, as users can manually revoke permissions in Settings. Having targetSdkVersion 22 or lower means that your app is not going to have any runtime permission code, so the user needs to agree to your requested permissions at install time. This is how Android worked from the beginning. – CommonsWare

ok so app will run on marshmallow without showing permissions? @CommonsWare - Tapan Parmar

@Tapanparmar: The user will be presented with permissions at the time the app is installed. – CommonsWare

ok so we can skip that freaking permissions providing by this but is there any drawbacks by doing it? @CommonsWare

@Tapanparmar: Users may elect not to install your app, if they do not like granting all the permissions up front. Also, other behaviors that you might want based on higher targetSdkVersion values may be lost. If you have additional concerns, please ask a separate Stack Overflow question. – CommonsWare

So i want to know are there any actual drawbacks of doing this? And what will happen to security which was main purpose of RunTimePermissions. And is it really preferable to do this?

See the comments here on the answer or see the image below

最满意答案

这样做有什么实际缺点吗?

如果用户不喜欢预先授予所有权限,则可以选择不安装您的应用。 此外,您可能希望基于更高的targetSdkVersion值的其他行为可能会丢失。

安全性会发生什么,这是RunTimePermissions的主要目的

没有。 您仍然需要所有<uses-permission>元素,用户仍然必须同意授予您权限。 但是,该协议主要在安装时发生,而不是在应用程序运行时发生。 请记住,Android 6.0+设备的用户仍然可以通过“设置”应用撤消dangerous级别的权限。

这样做真的好吗?

恕我直言,没有。 最终,有些事情会迫使你的手,并要求你升级你的targetSdkVersion 。 并且,正如我所指出的,用户可能更愿意不安装您的应用程序,使用其他应用程序,在安装时不要求大量权限的应用程序。 使用低于23的targetSdkVersion对于不再维护的应用程序或缺乏经验的开发人员来说是一个很好的答案。

are there any actual drawbacks of doing this?

Users may elect not to install your app, if they do not like granting all the permissions up front. Also, other behaviors that you might want based on higher targetSdkVersion values may be lost.

And what will happen to security which was main purpose of RunTimePermissions

Nothing. You still need all the <uses-permission> elements, and the user still has to agree to give you the permissions. However, that agreement occurs primarily at install time, not when the app is run. Bear in mind that users of Android 6.0+ devices still can revoke the dangerous-level permissions via the Settings app.

And is it really preferable to do this?

IMHO, no. Eventually, something is going to force your hand and require you to upgrade your targetSdkVersion. And, as I have noted, users may prefer to not install your app, going with some other app, one that does not ask for a lot of permissions at install time. Using a targetSdkVersion below 23 is a fine answer for apps that are no longer being maintained or for inexperienced developers.

更多推荐

本文发布于:2023-08-06 20:20:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1455813.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:跳过   棉花   权限   skip   Permissions

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!