如何设置我的应用程序默认情况下,植根设备 [英] How do I set my application to default on a rooted device

查看:128
本文介绍了如何设置我的应用程序默认情况下,植根设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个平板电脑应用程序,我们正在部署零售网点。目前,它自晚更新在夜间,但它确实后它不再是默认的家的应用和向用户给出选择再次开始我们的应用程序或缺省启动程序。我们希望始终有我们的应用程序是,即使更新默认主页的应用程序。有没有办法做到这一点有根的设备上?

这是一种基于ICS的设备所以加preferredActivity似乎不工作,我不能让即使该设备是植根于android.permission.SET_ preFERRED_APPLICATIONS许可。如果有办法解决,我想我可以完成这件事。

解决方案
  

有没有办法做到这一点有根的设备上?

最简单的办法是从注释拒绝一:删除股票发​​射器,使你是唯一的启动

  

这是一种基于ICS的设备所以加preferredActivity似乎不工作,我不能让即使该设备是植根于android.permission.SET_ preFERRED_APPLICATIONS权限。

根,其本身无关,与权限。在这种情况下, SET_ preFERRED_APPLICATIONS 是签名级别的权限,这意味着您的应用程序必须由同一个签名密钥的固件签署,这将不除非你滚你自己改装成光盘成为可能。

如果我读<一href="http://androidxref.com/source/xref/frameworks/base/services/java/com/android/server/pm/Settings.java">the Android源$ C ​​$ C 正确,的结果添加preferredActivity()风在 /数据/系统/包的.xml ,在&LT; preferred-活动&GT; 元素。玩弄修改该文件的非常仔细地,然后看看是否你想要什么就会得到你。

We have a tablet app that we're deploying at retail outlets. It currently self updates late at night but after it does it is no longer the default "home" application and the user is given the choice to start our app or the default launcher again. We'd like to always have our app be the default home application even after updates. Is there a way to do this on a rooted device?

This is an ICS based device so the addPreferredActivity doesn't seem to work as I cannot get the android.permission.SET_PREFERRED_APPLICATIONS permission even though the device is rooted. If there is a way around that, I think I could get this done..

解决方案

Is there a way to do this on a rooted device?

The simplest solution is the one you rejected from the comment: remove the stock launcher and make yours be the only launcher.

This is an ICS based device so the addPreferredActivity doesn't seem to work as I cannot get the android.permission.SET_PREFERRED_APPLICATIONS permission even though the device is rooted.

Root, by itself, has nothing to do with permissions. In this case, SET_PREFERRED_APPLICATIONS is a signature-level permission, meaning that your app would have to be signed by the same signing key as the firmware, which will not be possible unless you roll your own modded ROM.

If I am reading the Android source code correctly, the results of addPreferredActivity() wind up in /data/system/packages.xml, in a <preferred-activities> element. Play around with modifying that file very carefully and see if that will get you what you want.

这篇关于如何设置我的应用程序默认情况下,植根设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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