有没有办法让元数据在Android清单私有的包? [英] Is there a way to keep meta-data in the Android manifest private to the package?

查看:148
本文介绍了有没有办法让元数据在Android清单私有的包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用的元数据在Android清单定制服务的行为。

 <服务
    机器人:名字=。SampleService
    机器人:出口=假>
    &所述;元数据
        机器人:名字=sampleName
        机器人:资源=@字符串/ sampleValue/>
< /服务>

我的服务是图书馆的一部分,有可能有些人可能把敏感数据到这些属性时,他们使用我的服务。都可以通过软件包管理系统,这些元数据属性设置为向其他已安装的软件包在手机上,即使没有出口业务?


解决方案

  

都可以通过软件包管理系统,这些元数据属性设置为向其他已安装的软件包在手机上,即使没有出口业务?


是的。一切都在清单中,一切都在你的资源和资产,是设备上的所有应用程序访问。

I want to use meta-data in the Android manifest to customize the behavior of a service.

<service
    android:name=".SampleService"
    android:exported="false">
    <meta-data
        android:name="sampleName"
        android:resource="@string/sampleValue" />
</service>

My service is part of a library, and it is possible some may put sensitive data into these attributes when they use my service. Are these meta-data attributes visible to other installed packages on the phone via the PackageManager even if the service is not exported?

解决方案

Are these meta-data attributes visible to other installed packages on the phone via the PackageManager even if the service is not exported?

Yes. Everything in the manifest, and everything in your resources and assets, is accessible to all applications on the device.

这篇关于有没有办法让元数据在Android清单私有的包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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