有没有办法让元数据在Android清单私有的包?没有办法、清单、数据、Android

2023-09-08 00:13:38 作者:小姐,你身上带有胸器

我想使用的元数据在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>
Android的清单文件添加百度地图SDK

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.