安全警报
您的应用程序包含一个SQL注入漏洞。有关详细信息,请参阅此Google帮助中心文章。
弱势阶层:
provider / FormsProvider;->查询
影响APK版本6。
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder) {
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(FORMS_TABLE_NAME);
switch (sUriMatcher.match(uri)) {
case FORMS:
qb.setProjectionMap(sFormsProjectionMap);
break;
case FORM_ID:
qb.setProjectionMap(sFormsProjectionMap);
qb.appendWhere(FormsColumns._ID + "=" + uri.getPathSegments().get(1));
break;
default:
throw new IllegalArgumentException("Unknown URI " + uri);
}
// Get the database and run the query
SQLiteDatabase db = mDbHelper.getReadableDatabase();
Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, sortOrder);
// Tell the cursor what uri to watch, so it knows when its source data changes
c.setNotificationUri(getContext().getContentResolver(), uri);
return c;
}
请帮助我。如何防止来自Google Play控制台的SQL注入安全警报。