build议如何使用contentResolver的delete方法来注入安全?

您可以通过URI或通过将某些parameter passing给where参数来删除内容parsing器。

你如何使参数成为SQL注入安全?
ContentResolver是否可以使用Prepared Statements?

act.getContentResolver().delete(myuriwithid,null,null); act.getContentResolver().delete(mybaseuri," name = '"+this.name"'",null); 

Solutions Collecting From Web of "build议如何使用contentResolver的delete方法来注入安全?"

使用位置参数。

 public final int delete (Uri url, String where, String[] selectionArgs) 

例如

 ContentResolver cr = ...; String where = "nameid=?"; String[] args = new String[] { "george" }; cr.delete( Stuff.CONTENT_URI, where, args );