一个应用程序可以将其权限授予android中的另一个应用程序吗? [英] Can an app give its permission to another application in android?

查看:133
本文介绍了一个应用程序可以将其权限授予android中的另一个应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个说A的应用程序,该应用程序在安装时启用了所有权限.另一个应用程序说B没有权限,并且想要获得该权限. B可以与A进行通信,以便A可以将其许可权转让给B.

I have an application say A that have all the permissions enabled at installation. Another app Say B don't have a permission and want to get that permission. Can B communicate with A, So that A can transfer its permission to B.

PLS回复,我被困在这里.我想动态获得一些权限.这是最好的主意还是其他任何主意?

PLS reply, I'm stuck here. I want to get some permissions dynamically. Is this the best idea or any other idea?

推荐答案

据我所知,应用程序不一定会向其他应用程序授予权限,但前提是您是这两个应用程序的开发者,但AppB可以从AppA继承权限.如果AppA和AppB都在清单中声明了相同的sharedUserId值(android:sharedUserId ="xyz"),并且AppA和AppB都使用了相同的签名进行了签名,那么就权限而言,Android会将其视为同一应用.因此,例如,AppB可能在未经许可"perm1"的情况下存在于设备上.然后,可以使用"perm1"安装AppA.如果AppA和AppB具有相同的sharedUserId和签名,则在安装AppA时,将授予""perm1".

As far as I know, apps can't necessarily give permissions to other apps, BUT AppB could inherit permissions from AppA IF you are the developer of both apps. If both AppA and AppB declare the same sharedUserId value in their manifest (android:sharedUserId="xyz") AND both AppA and AppB are signed with the same signature, then Android will consider them to be the same app as far as permissions go. So, AppB could exist on the device without permission "perm1" for example. Then, AppA could be installed with "perm1". IF AppA and AppB have the same sharedUserId and signature then, when AppA is installed, AppB will be "granted" "perm1".

我现在还没有测试过,但是我知道它曾经工作过(大约一年前).

I haven't tested this just now, but I know it used to work (as of a year ago or so).

这篇关于一个应用程序可以将其权限授予android中的另一个应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆