授予系统权限的应用程序在Android模拟器 [英] grant system permissions to an app in the android emulator

查看:610
本文介绍了授予系统权限的应用程序在Android模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个应用程序,将Android设备作为系统的应用程序中的捆绑。制造商是一个出路于提供设备给我们,所以在此期间,我想授予在模拟器我的应用程序的系统级权限这样我就可以自动更新功能,会做的APK的静默安装没有任何交互工作从用户。从我读过,它的我的理解,要能做到静默安装在Android上的唯一方法是,如果您的应用程序使用相同的证书作为操作系统签名。那么,如何可以模拟这个在模拟器?

I am building an app that will be bundled on an android device as a system app. The manufacturer is a ways out on delivering the device to us, so in the meantime I'd like to grant my app system level permissions in the emulator so I can work on an auto update feature that will do silent installs of APKs without any interactions from the user. From what I've read, its my understanding that the only way to be able to do silent installs on android is if your app is signed with the same cert as the OS. So how can I simulate this in the emulator?

推荐答案

如果你想有一个signatureOrSystem许可,您只需要放置在系统映像;你不需要任何特殊的证书进行签名。你可以这样做一个一次性的(直到退出模拟器)是这样的:

If you want a signatureOrSystem permission, you just need to be placed on the system image; you don't need to be signed with any special cert. You can do this as a one-off (until you exit the emulator) like this:

> adb root
> adb remount
> adb push /path/to/My.apk /system/app/My.apk

一旦你这样做,你可以使用正常的过程中对数据分区中安装更多的更新(亚行安装-r /path/to/My.apk,这是开发者工具,当您从Eclipse中运行做)。当安装这种方式,该应用保持其从系统图像上的原始版本已请求任何signatureOrSystem权限,但不能获得任何新这样的权限。

Once you have done that, you can use the normal process to install further updates on the data partition ("adb install -r /path/to/My.apk" which is what the developer tools do when you run from Eclipse). When installing this way, the app retains any signatureOrSystem permissions it had requested from the original version on the system image, but can not gain any new such permissions.

如果您需要纯粹的签名权限,则需要使用相同的证书作为无论是宣布这些权限签署您的应用程序(通常为核心框架,但媒体系统是一个独立的证书等)。如果您要求签名的权限,你不需要在系统映像上安装,你可以安装它作为一个正常的应用程序,它仍然可以得到,因为签约的权限。

If you need pure signature permissions, you need to sign your app with the same cert as whatever is declaring those permissions (typically the core framework, but the media system is a separate cert etc). If you are requesting signature permissions you don't need to be installed on the system image, you can just install it as a normal app and it can still get the permissions because of the signing.

这篇关于授予系统权限的应用程序在Android模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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