|
@@ -42,6 +42,7 @@ import de.tudarmstadt.informatik.hostage.R;
|
|
|
import de.tudarmstadt.informatik.hostage.commons.HelperUtils;
|
|
|
import de.tudarmstadt.informatik.hostage.logging.AttackRecord;
|
|
|
import de.tudarmstadt.informatik.hostage.logging.MessageRecord;
|
|
|
+import de.tudarmstadt.informatik.hostage.logging.NetworkRecord;
|
|
|
import de.tudarmstadt.informatik.hostage.logging.Record;
|
|
|
import de.tudarmstadt.informatik.hostage.logging.formatter.TraCINgFormatter;
|
|
|
import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
|
|
@@ -1143,29 +1144,39 @@ public class RecordOverviewFragment extends UpNavigatibleFragment implements Che
|
|
|
|
|
|
int numOfAttackPerNetwork = (Math.abs(random.nextInt()) % attacksPerNetwork) + 1;
|
|
|
|
|
|
- // ATTACKS PER NETWORK
|
|
|
- for (int attack = 0; attack < numOfAttackPerNetwork; attack++) {
|
|
|
- LatLng ssidLocation = new LatLng(tudarmstadtLoc.latitude - ssidRadius + 2.0 * ssidRadius * Math.random(), tudarmstadtLoc.longitude - ssidRadius + 2.0 * ssidRadius * Math.random());
|
|
|
+ NetworkRecord network = new NetworkRecord();
|
|
|
+ network.setBssid(bssidName);
|
|
|
+ network.setSsid(ssidName);
|
|
|
|
|
|
- int numRecordsPerAttack = (Math.abs(random.nextInt()) % 5) + 1;
|
|
|
+ LatLng ssidLocation = new LatLng(tudarmstadtLoc.latitude - ssidRadius + 2.0 * ssidRadius * Math.random(), tudarmstadtLoc.longitude - ssidRadius + 2.0 * ssidRadius * Math.random());
|
|
|
+ double latitude = ssidLocation.latitude - bssidRadius + 2.0 * bssidRadius * Math.random();
|
|
|
+ double longitude = ssidLocation.longitude - bssidRadius + 2.0 * bssidRadius * Math.random();
|
|
|
|
|
|
- double latitude = ssidLocation.latitude - bssidRadius + 2.0 * bssidRadius * Math.random();
|
|
|
- double longitude = ssidLocation.longitude - bssidRadius + 2.0 * bssidRadius * Math.random();
|
|
|
+ long timestamp = cal.getTimeInMillis();
|
|
|
+ network.setTimestampLocation(timestamp);
|
|
|
+ network.setLongitude(longitude);
|
|
|
+ network.setLatitude(latitude);
|
|
|
+ network.setAccuracy(0.f);
|
|
|
|
|
|
+ dbh.updateNetworkInformation(network);
|
|
|
|
|
|
+ // ATTACKS PER NETWORK
|
|
|
+ for (int attackNumber = 0; attackNumber < numOfAttackPerNetwork; attackNumber++) {
|
|
|
+
|
|
|
+ int numRecordsPerAttack = (Math.abs(random.nextInt()) % 5) + 1;
|
|
|
/*
|
|
|
* ADD A ATTACK*/
|
|
|
|
|
|
- AttackRecord record = new AttackRecord();
|
|
|
- record.setAttack_id(attackId);
|
|
|
+ AttackRecord attack = new AttackRecord();
|
|
|
+ attack.setAttack_id(attackId);
|
|
|
|
|
|
- record.setBssid(bssidName);
|
|
|
+ attack.setBssid(bssidName);
|
|
|
|
|
|
- record.setProtocol(protocolName);
|
|
|
- record.setLocalIP(bssidName);
|
|
|
+ attack.setProtocol(protocolName);
|
|
|
+ attack.setLocalIP(bssidName);
|
|
|
|
|
|
|
|
|
- dbh.addAttackRecord(record);
|
|
|
+ dbh.addAttackRecord(attack);
|
|
|
|
|
|
// RECORDS PER ATTACK
|
|
|
for (int messageID = attackId; messageID < attackId + numRecordsPerAttack; messageID++) {
|