"allowClearUserData" = "false" 在 AndroidManifest.xml 文件中

"allowClearUserData" = "false" in the AndroidManifest.xml file

android 清单文件中的 allowClearUserData 属性有什么作用?

根据该字段的 source code

Option to let applications specify that user data can/cannot be cleared. This flag is turned on by default. This attribute is usable only by applications included in the system image. Third-party apps cannot use it.

<attr name="allowClearUserData" format="boolean" />

allowClearUserData 是一个让应用程序指定是否删除用户数据 can/cannot 的选项。默认情况下,此标志设置为 true。但是它可以更改为 false。可以为您的应用程序设置该属性。但是,任何其他应用程序都不能使用此属性来清除您应用程序的用户 data.he 属性允许布尔值,即 "true" 或 "false"。 如果设置为true,应用程序管理员有权清除数据。

示例:

<application>
<application android:allowClearUserData=["true" | "false"] 
</application>

这必须放在 android 清单文件中。