|
@@ -1,5 +1,7 @@
|
|
|
package de.tudarmstadt.informatik.hostage.ui;
|
|
|
|
|
|
+import java.net.InetAddress;
|
|
|
+import java.net.UnknownHostException;
|
|
|
import java.text.DateFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
@@ -12,7 +14,6 @@ import android.content.Context;
|
|
|
import android.content.SharedPreferences;
|
|
|
import android.os.Bundle;
|
|
|
import android.view.Menu;
|
|
|
-import android.view.MenuInflater;
|
|
|
import android.view.MenuItem;
|
|
|
import android.view.View;
|
|
|
import android.widget.AdapterView;
|
|
@@ -23,6 +24,7 @@ import android.widget.Toast;
|
|
|
import de.tudarmstadt.informatik.hostage.R;
|
|
|
import de.tudarmstadt.informatik.hostage.logging.DatabaseHandler;
|
|
|
import de.tudarmstadt.informatik.hostage.logging.Record;
|
|
|
+import de.tudarmstadt.informatik.hostage.logging.Record.TYPE;
|
|
|
|
|
|
/**
|
|
|
* Creates a simple log view. Shows the Information for every attack. The format ist defined in {@link Record#toString(int)}.
|
|
@@ -57,12 +59,31 @@ public class ViewLogTable extends Activity{
|
|
|
// text.setText(log);
|
|
|
// text.setTextAppearance(this, android.R.style.TextAppearance_Medium);
|
|
|
// scroll.addView(text);
|
|
|
+ this.addRecordToDB();
|
|
|
|
|
|
populateListViewFromDB();
|
|
|
registerListClickCallback();
|
|
|
}
|
|
|
|
|
|
|
|
|
+ private void addRecordToDB(){
|
|
|
+ Record record = new Record();
|
|
|
+ record.setBSSID("BSSID wwwww");
|
|
|
+ record.setSSID("SSID wowy");
|
|
|
+ record.setTimestamp(0);
|
|
|
+ record.setProtocol("HTTP");
|
|
|
+ try {
|
|
|
+ InetAddress localIP = InetAddress.getByAddress("Digga",new byte[]{127, 0, 0, 1}); //.getByName("192.168.2.1");
|
|
|
+ record.setLocalIP(localIP);
|
|
|
+ record.setRemoteIP(InetAddress.getByAddress("Digga",new byte[]{127, 1, 1, 1}));
|
|
|
+ record.setType(TYPE.SEND);
|
|
|
+ } catch (UnknownHostException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ dbh.addRecord(record);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
private void populateListViewFromDB() {
|