对于此lint警告以及所有其他lint警告,请注意您可以获得更全面的解释,而不仅仅是单行错误消息中的内容; 您无需在网上搜索更多信息。
如果您通过Eclipse使用lint,请打开lint警告视图,在那里您可以选择lint错误并查看更长的解释,或者在错误行上调用quickfix(Ctrl-1),其中一个建议是“Explain” 这个问题“,这也将提供更全面的解释。 如果您不使用Eclipse,则可以从lint生成HTML报告(lint --html ),其中包含警告旁边的完整说明,或者您可以要求lint解释特定问题。 例如,与allowBackup相关的问题具有id“AllowBackup”(显示在错误消息的末尾),因此更全面的解释是:
$ ./lint --show AllowBackup
AllowBackup
-----------
Summary: Ensure that allowBackup is explicitly set in the application's
manifest
Priority: 3 / 10
Severity: Warning
Category: Security
allowBackup属性确定是否可以备份应用程序的数据并恢复。 这里记录在案。
By default, this flag is set to true. When this flag is set to true,
application data can be backed up and restored by the user using adb backup
and adb restore.
This may have security consequences for an application. adb backup allows
users who have enabled USB debugging to copy application data off of the
device. Once backed up, all application data can be read by the user. adb
restore allows creation of application data from a source specified by the
user. Following a restore, applications should not assume that the data, file
permissions, and directory permissions were created by the application
itself.
Setting `allowBackup="false"` opts an application out of both backup and
restore.
To fix this warning, decide whether your application should support backup,
and explicitly set `android:allowBackup=(true|false)`"
点击这里查看更多信息