|
@@ -713,6 +713,35 @@ public class UglyDbHelper extends SQLiteOpenHelper {
|
|
return recordList;
|
|
return recordList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Returns the Conversation of a specific attack id
|
|
|
|
+ * @param attack_id
|
|
|
|
+ * Tha attack id to match the query against.
|
|
|
|
+ *
|
|
|
|
+ * @return A arraylist with all {@link Record Records}s for an attack id.
|
|
|
|
+ *
|
|
|
|
+ * */
|
|
|
|
+ public ArrayList<Record> getConversationForAttackID(long attack_id) {
|
|
|
|
+ ArrayList<Record> recordList = new ArrayList<Record>();
|
|
|
|
+ String selectQuery = "SELECT * FROM " + TABLE_RECORDS
|
|
|
|
+ + " NATURAL JOIN " + TABLE_ATTACK_INFO + " JOIN "
|
|
|
|
+ + TABLE_BSSIDS + " USING " + "(" + KEY_BSSID + ")" + " WHERE " + TABLE_RECORDS+"."+KEY_ATTACK_ID + " > " + attack_id;
|
|
|
|
+
|
|
|
|
+ SQLiteDatabase db = this.getReadableDatabase();
|
|
|
|
+ Cursor cursor = db.rawQuery(selectQuery, null);
|
|
|
|
+
|
|
|
|
+ if (cursor.moveToFirst()) {
|
|
|
|
+ do {
|
|
|
|
+ Record record = createRecord(cursor);
|
|
|
|
+ recordList.add(record);
|
|
|
|
+ } while (cursor.moveToNext());
|
|
|
|
+ }
|
|
|
|
+ cursor.close();
|
|
|
|
+
|
|
|
|
+ db.close();
|
|
|
|
+ return recordList;
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* Gets a representative {@link Record} for every attack with a higher
|
|
* Gets a representative {@link Record} for every attack with a higher
|
|
* attack id than the specified.
|
|
* attack id than the specified.
|