Browse Source

Merge branch 'master' of https://git.tk.informatik.tu-darmstadt.de/scm-ssi-student-hostagev2

Julien Clauter 10 years ago
parent
commit
cb05f342b1
71 changed files with 1180 additions and 2426 deletions
  1. 3 30
      AndroidManifest.xml
  2. 111 0
      build-types/debug/AndroidManifest.xml
  3. 111 0
      build-types/release/AndroidManifest.xml
  4. 20 7
      build.gradle
  5. BIN
      res/drawable-hdpi/ic_menu_help.png
  6. BIN
      res/drawable-mdpi/ic_menu_help.png
  7. BIN
      res/drawable-xhdpi/ic_menu_help.png
  8. BIN
      res/drawable-xxhdpi/ic_menu_help.png
  9. 0 3
      res/layout-land/fragment_statistics.xml
  10. 0 94
      res/layout/activity_about.xml
  11. 0 15
      res/layout/activity_loglist.xml
  12. 0 189
      res/layout/activity_main.xml
  13. 0 52
      res/layout/activity_playground.xml
  14. 0 17
      res/layout/activity_sync_central.xml
  15. 0 127
      res/layout/activity_viewlog.xml
  16. 0 4
      res/layout/fragment_connectioninfo_dialog.xml
  17. 0 3
      res/layout/fragment_home.xml
  18. 119 169
      res/layout/fragment_record_detail.xml
  19. 0 154
      res/layout/fragment_record_overview.xml
  20. 0 3
      res/layout/fragment_services.xml
  21. 0 3
      res/layout/fragment_statistics.xml
  22. 0 1
      res/layout/fragment_threatmap_infowindow.xml
  23. 0 45
      res/layout/list_view_protocols_row.xml
  24. 0 25
      res/layout/loglist_row.xml
  25. 0 3
      res/layout/plot_list_item.xml
  26. 2 0
      res/layout/preference_warning.xml
  27. 0 12
      res/layout/preferences_image_widget.xml
  28. 0 35
      res/layout/profile_manager_list_item.xml
  29. 0 4
      res/layout/record_list_item.xml
  30. 0 1
      res/layout/services_list_item.xml
  31. 0 1
      res/layout/simple_popup_item.xml
  32. 0 1
      res/layout/simple_popup_table.xml
  33. 0 4
      res/layout/split_popup_item.xml
  34. 0 15
      res/menu/main.xml
  35. 1 0
      res/values-de/strings.xml
  36. 33 0
      res/values-de/strings_disclaimer.xml
  37. 7 0
      res/values-de/strings_gui.xml
  38. 2 0
      res/values-de/strings_preferences.xml
  39. 1 0
      res/values/api_keys.xml
  40. 0 0
      res/values/broadcast.xml
  41. 0 0
      res/values/connection_info.xml
  42. 1 0
      res/values/strings.xml
  43. 0 14
      res/values/strings_about.xml
  44. 33 0
      res/values/strings_disclaimer.xml
  45. 0 28
      res/values/strings_gui.xml
  46. 3 3
      src/de/tudarmstadt/informatik/hostage/persistence/ProfileManager.java
  47. 0 35
      src/de/tudarmstadt/informatik/hostage/ui/AboutActivity.java
  48. 0 66
      src/de/tudarmstadt/informatik/hostage/ui/ListViewAdapter.java
  49. 0 610
      src/de/tudarmstadt/informatik/hostage/ui/MainActivity.java
  50. 0 107
      src/de/tudarmstadt/informatik/hostage/ui/PlayGroundActivity.java
  51. 0 194
      src/de/tudarmstadt/informatik/hostage/ui/SettingsActivity.java
  52. 0 37
      src/de/tudarmstadt/informatik/hostage/ui/ViewLogTable.java
  53. 233 95
      src/de/tudarmstadt/informatik/hostage/ui2/activity/MainActivity.java
  54. 7 0
      src/de/tudarmstadt/informatik/hostage/ui2/activity/ProfileEditActivity.java
  55. 19 0
      src/de/tudarmstadt/informatik/hostage/ui2/adapter/DrawerListAdapter.java
  56. 87 57
      src/de/tudarmstadt/informatik/hostage/ui2/adapter/ProfileManagerListAdapter.java
  57. 4 1
      src/de/tudarmstadt/informatik/hostage/ui2/adapter/ServicesListAdapter.java
  58. 2 0
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/AboutFragment.java
  59. 102 14
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/HomeFragment.java
  60. 34 10
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/PreferenceHostageFrament.java
  61. 54 31
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/ProfileEditFragment.java
  62. 33 2
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/ProfileManagerFragment.java
  63. 86 71
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/RecordDetailFragment.java
  64. 11 0
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/SettingsFragment.java
  65. 1 1
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/ThreatMapFragment.java
  66. 28 0
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/UpNavigatibleFragment.java
  67. 1 1
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/AnimatedMesh.java
  68. 5 0
      src/de/tudarmstadt/informatik/hostage/ui2/layouts/FlowLayout.java
  69. 10 0
      src/de/tudarmstadt/informatik/hostage/ui2/model/DrawerListItem.java
  70. 0 31
      src/de/tudarmstadt/informatik/hostage/ui2/model/ProfileListItem.java
  71. 16 1
      src/de/tudarmstadt/informatik/hostage/ui2/swipelist/SwipeListView.java

+ 3 - 30
AndroidManifest.xml

@@ -39,9 +39,9 @@
         <meta-data
             android:name="com.google.android.gms.version"
             android:value="@integer/google_play_services_lib_version" />
-        <meta-data
-            android:name="com.google.android.maps.v2.API_KEY"
-            android:value="@string/google_maps_api_key_debug" />
+		<meta-data
+			android:name="com.google.android.maps.v2.API_KEY"
+			android:value="@string/google_maps_api_key_debug" />
 
         <activity
             android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"
@@ -55,37 +55,10 @@
   
         </activity>
 
-        <activity
-            android:name="de.tudarmstadt.informatik.hostage.ui.MainActivity"
-            android:configChanges="keyboardHidden|orientation|screenSize"
-            android:label="@string/app_name" >
- 
-       
-        </activity>
-        <activity
-            android:name="de.tudarmstadt.informatik.hostage.ui.ViewLog"
-            android:label="@string/statistics" >
-        </activity>
-        <activity
-            android:name="de.tudarmstadt.informatik.hostage.ui.ViewLogTable"
-            android:label="@string/database" >
-        </activity>
         <activity
             android:name=".ui2.activity.ProfileEditActivity"
             android:label="Edit Profile" >
         </activity>
-        <activity
-            android:name="de.tudarmstadt.informatik.hostage.ui.SettingsActivity"
-            android:label="@string/settings" >
-        </activity>
-        <activity
-            android:name="de.tudarmstadt.informatik.hostage.ui.AboutActivity"
-            android:label="@string/gui_action_about" >
-        </activity>
-        <activity
-            android:name="de.tudarmstadt.informatik.hostage.ui.PlayGroundActivity"
-            android:label="@string/gui_playground" >
-        </activity>
 
         <activity
             android:name="de.tudarmstadt.informatik.hostage.sync.tracing.TracingSyncActivity"

+ 111 - 0
build-types/debug/AndroidManifest.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="de.tudarmstadt.informatik.hostage"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk
+        android:minSdkVersion="14"
+        android:targetSdkVersion="19" />
+
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+    <uses-permission android:name="android.permission.NFC" />
+    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
+	<uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+
+	<uses-feature
+        android:name="android.hardware.nfc"
+        android:required="false" />
+
+    <application
+		android:name=".HostageApplication"
+        android:allowBackup="true"
+        android:allowClearUserData="true"
+        android:hardwareAccelerated="true"
+        android:icon="@drawable/ic_launcher"
+        android:installLocation="preferExternal"
+        android:label="@string/app_name"
+        android:theme="@style/AppTheme"
+        android:vmSafeMode="true" >
+        <meta-data
+            android:name="com.google.android.gms.version"
+            android:value="@integer/google_play_services_lib_version" />
+        <meta-data
+            android:name="com.google.android.maps.v2.API_KEY"
+            android:value="@string/google_maps_api_key_debug" />
+
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"
+            android:configChanges="keyboardHidden|orientation|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait" >
+           	<intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+
+        </activity>
+
+        <activity
+            android:name=".ui2.activity.ProfileEditActivity"
+            android:label="Edit Profile" >
+        </activity>
+
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.sync.tracing.TracingSyncActivity"
+            android:label="@string/gui_tracing"
+            android:theme="@android:style/Theme.Dialog" >
+        </activity>
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.sync.bluetooth.BluetoothSyncActivity"
+            android:label="@string/gui_bluetooth"
+            android:theme="@android:style/Theme.Dialog" >
+        </activity>
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.sync.nfc.NFCSync"
+            android:label="@string/gui_nfc"
+            android:theme="@android:style/Theme.Dialog" >
+            <intent-filter>
+                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+
+                <data android:mimeType="application/de.tudarmstadt.informatik.hostage" />
+            </intent-filter>
+        </activity>
+
+        <service
+            android:name="de.tudarmstadt.informatik.hostage.Hostage"
+            android:exported="false" >
+        </service>
+        <service
+            android:name="de.tudarmstadt.informatik.hostage.logging.Logger"
+            android:exported="false" >
+        </service>
+        <service
+            android:name="de.tudarmstadt.informatik.hostage.sync.tracing.TracingSyncService"
+            android:exported="false" >
+        </service>
+
+	    <service
+		    android:name="de.tudarmstadt.informatik.hostage.logging.LogExport"
+	        android:exported="false">
+	    </service>
+
+	    <provider
+            android:name="de.tudarmstadt.informatik.hostage.provider.HostageContentProvider"
+            android:authorities="de.tudarmstadt.informatik.hostage.provider"
+            android:exported="false" >
+        </provider>
+    </application>
+
+</manifest>

+ 111 - 0
build-types/release/AndroidManifest.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="de.tudarmstadt.informatik.hostage"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk
+        android:minSdkVersion="14"
+        android:targetSdkVersion="19" />
+
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
+    <uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+    <uses-permission android:name="android.permission.NFC" />
+    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
+	<uses-permission android:name="android.permission.BLUETOOTH" />
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
+
+	<uses-feature
+        android:name="android.hardware.nfc"
+        android:required="false" />
+
+    <application
+		android:name=".HostageApplication"
+        android:allowBackup="true"
+        android:allowClearUserData="true"
+        android:hardwareAccelerated="true"
+        android:icon="@drawable/ic_launcher"
+        android:installLocation="preferExternal"
+        android:label="@string/app_name"
+        android:theme="@style/AppTheme"
+        android:vmSafeMode="true" >
+        <meta-data
+            android:name="com.google.android.gms.version"
+            android:value="@integer/google_play_services_lib_version" />
+        <meta-data
+            android:name="com.google.android.maps.v2.API_KEY"
+            android:value="@string/google_maps_api_key_release" />
+
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"
+            android:configChanges="keyboardHidden|orientation|screenSize"
+            android:label="@string/app_name"
+            android:screenOrientation="portrait" > 
+           	<intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>  
+  
+        </activity>
+
+        <activity
+            android:name=".ui2.activity.ProfileEditActivity"
+            android:label="Edit Profile" >
+        </activity>
+
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.sync.tracing.TracingSyncActivity"
+            android:label="@string/gui_tracing"
+            android:theme="@android:style/Theme.Dialog" >
+        </activity>
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.sync.bluetooth.BluetoothSyncActivity"
+            android:label="@string/gui_bluetooth"
+            android:theme="@android:style/Theme.Dialog" >
+        </activity>
+        <activity
+            android:name="de.tudarmstadt.informatik.hostage.sync.nfc.NFCSync"
+            android:label="@string/gui_nfc"
+            android:theme="@android:style/Theme.Dialog" >
+            <intent-filter>
+                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+
+                <data android:mimeType="application/de.tudarmstadt.informatik.hostage" />
+            </intent-filter>
+        </activity>
+
+        <service
+            android:name="de.tudarmstadt.informatik.hostage.Hostage"
+            android:exported="false" >
+        </service>
+        <service
+            android:name="de.tudarmstadt.informatik.hostage.logging.Logger"
+            android:exported="false" >
+        </service>
+        <service
+            android:name="de.tudarmstadt.informatik.hostage.sync.tracing.TracingSyncService"
+            android:exported="false" >
+        </service>
+
+	    <service
+		    android:name="de.tudarmstadt.informatik.hostage.logging.LogExport"
+	        android:exported="false">
+	    </service>
+
+	    <provider
+            android:name="de.tudarmstadt.informatik.hostage.provider.HostageContentProvider"
+            android:authorities="de.tudarmstadt.informatik.hostage.provider"
+            android:exported="false" >
+        </provider>
+    </application>
+
+</manifest>

+ 20 - 7
build.gradle

@@ -54,9 +54,16 @@ android {
         release.setRoot('build-types/release')
     }
 
-    signingConfigs {
-        release {
-            storeFile file("release.keystore")
+    // signing for release only works in the console
+    boolean doSigningForRelease = System.console() != null
+    if (doSigningForRelease) {
+        signingConfigs {
+            release {
+                storeFile file(System.console().readLine("\n\$ Enter keystore path: "))
+                storePassword System.console().readLine("\n\$ Enter keystore password: ")
+                keyAlias System.console().readLine("\n\$ Enter key alias: ")
+                keyPassword System.console().readLine("\n\$ Enter key password: ")
+            }
         }
     }
 
@@ -66,10 +73,16 @@ android {
             jniDebugBuild true
         }
 
-        release {
-            debuggable false
-            jniDebugBuild false
-            signingConfig signingConfigs.release
+        if (doSigningForRelease) {
+            release {
+                debuggable false
+                jniDebugBuild false
+                signingConfig signingConfigs.release
+            }
         }
     }
+
+    lintOptions {
+        abortOnError false
+    }
 }

BIN
res/drawable-hdpi/ic_menu_help.png


BIN
res/drawable-mdpi/ic_menu_help.png


BIN
res/drawable-xhdpi/ic_menu_help.png


BIN
res/drawable-xxhdpi/ic_menu_help.png


+ 0 - 3
res/layout-land/fragment_statistics.xml

@@ -48,7 +48,6 @@
                     android:layout_width="match_parent"
                     android:layout_height="match_parent"
                     android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="Title"
                     android:textAlignment="center"
                     android:id="@+id/title_text_view" />
             </LinearLayout>
@@ -88,7 +87,6 @@
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent"
                     android:textAppearance="?android:attr/textAppearanceSmall"
-                    android:text="table header title"
                     android:id="@+id/table_header_title_textview"
                     android:gravity="bottom|left"
                     android:textAlignment="viewStart"
@@ -99,7 +97,6 @@
                     android:layout_width="fill_parent"
                     android:layout_height="fill_parent"
                     android:textAppearance="?android:attr/textAppearanceSmall"
-                    android:text="value"
                     android:id="@+id/table_header_value_textview"
                     android:textAlignment="viewEnd"
                     android:layout_weight="0.6"

+ 0 - 94
res/layout/activity_about.xml

@@ -1,94 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin" >
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical" >
-        
-        <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal" >
-
-        <TextView
-            android:id="@+id/text_version"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="@string/text_version" />
-        
-        <TextView
-            android:id="@+id/version"
-            android:paddingLeft="2dp"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-            android:text="" />
-        
-        </LinearLayout>
-
-        <TextView
-            android:id="@+id/text_description"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:paddingTop="@dimen/activity_vertical_margin"
-            android:text="@string/description" />
-        
-        <TextView
-            android:id="@+id/link_website"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:paddingTop="@dimen/activity_vertical_margin"
-            android:text="@string/link_website" />
-        
-        <TextView
-            android:id="@+id/link_github"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:paddingTop="@dimen/activity_vertical_margin"
-            android:text="@string/link_github" />
-        
-		<TextView
-            android:id="@+id/link_tracing"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:paddingTop="@dimen/activity_vertical_margin"
-            android:text="@string/link_tracing" />
-
-        <TextView
-            android:id="@+id/text_authors"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
-	 		android:paddingTop="@dimen/activity_vertical_margin"
-            android:text="@string/authors" />
-
-        <TextView
-            android:id="@+id/text_author_1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/authors_m" />
-               
-        <TextView
-            android:id="@+id/text_author_2"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/authors_w" />
-                
-         <TextView
-            android:id="@+id/text_author_3"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/authors_l" />
-
-    </LinearLayout>
-    
-</LinearLayout>

+ 0 - 15
res/layout/activity_loglist.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent" >
-
-    <ListView
-        android:id="@+id/loglistview"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_alignParentLeft="true"
-        android:layout_alignParentTop="true" >
-
-    </ListView>
-
-</RelativeLayout>

+ 0 - 189
res/layout/activity_main.xml

@@ -1,189 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin"
-    tools:context=".MainActivity" >
-
-    <ViewAnimator
-        android:id="@+id/viewAnimator"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent" >
-
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" >
-
-            <TextView
-                android:id="@+id/textViewStatus"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_above="@+id/imageViewLight"
-                android:layout_centerHorizontal="true"
-                android:text="@string/gui_status"
-                android:textAppearance="?android:attr/textAppearanceLarge" />
-
-            <ImageView
-                android:id="@+id/imageViewLight"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_centerHorizontal="true"
-                android:layout_centerVertical="true"
-                android:src="@drawable/light_grey_large" />
-
-            <CheckBox
-                android:id="@+id/checkBoxParanoid"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentBottom="true"
-                android:layout_alignParentLeft="true"
-                android:text="@string/gui_paranoid" />
-
-            <ToggleButton
-                android:id="@+id/toggleButtonOnOff"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentBottom="true"
-                android:layout_alignParentRight="true"
-                android:onClick="buttonOnOffClick"
-                android:textOff="@string/gui_capital_off"
-                android:textOn="@string/gui_capital_on" />
-
-            <Button
-                android:id="@+id/buttonShowLog"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentTop="true"
-                android:onClick="showLog"
-                android:text="Show Log" />
-
-            <Button
-                android:id="@+id/buttonPlayGround"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentTop="true"
-                android:layout_toRightOf="@+id/buttonShowLog"
-                android:onClick="startPlayGround"
-                android:text="PlayGround" />
-
-        </RelativeLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:orientation="vertical" >
-
-            <TextView
-                android:id="@+id/textViewDetails"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/gui_details"
-                android:textAppearance="?android:attr/textAppearanceLarge" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" >
-
-                <TextView
-                    android:id="@+id/textViewSSID"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="20dp"
-                    android:text="@string/gui_ssid"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-
-                <TextView
-                    android:id="@+id/textViewSSIDValue"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="5dp"
-                    android:text="-"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-            </LinearLayout>
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" >
-
-                <TextView
-                    android:id="@+id/textViewBSSID"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="20dp"
-                    android:text="@string/gui_bssid"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-
-                <TextView
-                    android:id="@+id/textViewBSSIDValue"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="5dp"
-                    android:text="-"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-            </LinearLayout>
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" >
-
-                <TextView
-                    android:id="@+id/textViewInternalIP"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="20dp"
-                    android:text="@string/gui_internal_ip"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-
-                <TextView
-                    android:id="@+id/textViewInternalIPValue"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="5dp"
-                    android:text="-"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-            </LinearLayout>
-            
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content" >
-
-                <TextView
-                    android:id="@+id/textViewExternalIP"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="20dp"
-                    android:text="@string/gui_external_ip"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-
-                <TextView
-                    android:id="@+id/textViewExternalIPValue"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:paddingLeft="5dp"
-                    android:text="-"
-                    android:textAppearance="?android:attr/textAppearanceMedium" />
-            </LinearLayout>
-
-            <TextView
-                android:id="@+id/TextViewServices"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/gui_services"
-                android:textAppearance="?android:attr/textAppearanceLarge" />
-
-            <ListView
-                android:id="@+id/listViewProtocols"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:divider="#b5b5b5"
-                android:dividerHeight="1dp"
-                android:entries="@array/protocols" >
-            </ListView>
-        </LinearLayout>
-    </ViewAnimator>
-
-</RelativeLayout>

+ 0 - 52
res/layout/activity_playground.xml

@@ -1,52 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin" >
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="horizontal" >
-
-        <Button
-            android:id="@+id/buttonSyncServer"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:onClick="syncData"
-            android:text="Sync Data" />
-        
-        <Button
-            android:id="@+id/buttonStartNFC"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:onClick="startNFC"
-            android:text="start NFC" />
-
-    </LinearLayout>
-
-    <Button
-        android:id="@+id/buttonCreateNetwork"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:onClick="createNetworkData"
-        android:text="Create Network Data" />
-
-    <ScrollView
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        >
-
-        <TextView
-            android:id="@+id/textView1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="TextView" />
-         
-    </ScrollView>
-
-</LinearLayout>

+ 0 - 17
res/layout/activity_sync_central.xml

@@ -1,17 +0,0 @@
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:orientation="vertical"
-    android:paddingBottom="@dimen/activity_vertical_margin"
-    android:paddingLeft="@dimen/activity_horizontal_margin"
-    android:paddingRight="@dimen/activity_horizontal_margin"
-    android:paddingTop="@dimen/activity_vertical_margin" >
-
-    <TextView
-        android:id="@+id/sync_central_text_view"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:text="Uploading Records to" />
-
-</LinearLayout>

+ 0 - 127
res/layout/activity_viewlog.xml

@@ -1,127 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-	android:scrollbars="none">
-
-   <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        android:paddingBottom="@dimen/activity_vertical_margin"
-    	android:paddingLeft="@dimen/activity_horizontal_margin"
-    	android:paddingRight="@dimen/activity_horizontal_margin"
-    	android:paddingTop="@dimen/activity_vertical_margin" >
-
-        <TextView
-            android:id="@+id/textStatistics"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/gui_statistics"
-            android:textAppearance="?android:attr/textAppearanceLarge" />
-
-        <TableLayout
-            android:id="@+id/layoutContainer"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:orientation="vertical" >
-        </TableLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal" >
-
-            <TextView
-                android:id="@+id/textFirstAttack"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/gui_firstAttack"
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-
-            <TextView
-                android:id="@+id/textFirstAttackValue"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:paddingLeft="2dp"
-                android:text=""
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal" >
-
-            <TextView
-                android:id="@+id/textLastAttack"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/gui_lastAttack"
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-
-            <TextView
-                android:id="@+id/textLastAttackValue"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:paddingLeft="2dp"
-                android:text=""
-                android:textAppearance="?android:attr/textAppearanceMedium" />
-        </LinearLayout>
-
-        <TextView
-            android:id="@+id/textLogFile"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:text="@string/gui_log_actions"
-            android:textAppearance="?android:attr/textAppearanceLarge" />
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal" >
-
-            <Button
-                android:id="@+id/buttonShowLog"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:onClick="showLog"
-                android:text="Show Log" />
-
-            <Button
-                android:id="@+id/buttonExportDatabase"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:onClick="exportDatabase"
-                android:text="Export Database" />
-        </LinearLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal" >
-
-            <Button
-                android:id="@+id/buttonUploadLog"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:onClick="uploadDatabase"
-                android:text="Upload Log" />
-
-            <Button
-                android:id="@+id/buttonDeleteLog"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:onClick="deleteLog"
-                android:text="Delete Log" />
-        </LinearLayout>
-    </LinearLayout>
-
-        <TableLayout
-            android:id="@+id/attack_info"
-            android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
-            android:orientation="vertical" >
-        </TableLayout>
-
-</RelativeLayout>

+ 0 - 4
res/layout/fragment_connectioninfo_dialog.xml

@@ -24,7 +24,6 @@
 					android:layout_width="fill_parent"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
 					android:id="@+id/connectioninfo_ssid_value" android:layout_column="1"
 					android:layout_margin="4dp" android:gravity="right"/>
 		</TableRow>
@@ -43,7 +42,6 @@
 					android:layout_width="fill_parent"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
 					android:id="@+id/connectioninfo_bssid_value" android:layout_column="1"
 					android:layout_margin="4dp" android:gravity="right"/>
 		</TableRow>
@@ -62,7 +60,6 @@
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
 					android:id="@+id/connectioninfo_internalip_value" android:layout_column="1"
 					android:layout_margin="4dp" android:gravity="right"/>
 		</TableRow>
@@ -81,7 +78,6 @@
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
 					android:id="@+id/connectioninfo_externalip_value" android:layout_column="1"
 					android:layout_margin="4dp" android:gravity="right"/>
 		</TableRow>

+ 0 - 3
res/layout/fragment_home.xml

@@ -83,7 +83,6 @@
                 android:layout_centerHorizontal="true"
                 android:layout_gravity="center_horizontal"
                 android:layout_marginTop="21dp"
-                android:text="Eduroam"
                 android:textAppearance="?android:attr/textAppearanceLarge"
                 android:textSize="26sp" />
 
@@ -113,7 +112,6 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_gravity="center_horizontal"
-            android:text="125 attacks recorded"
             android:textColor="@color/holo_red"
             android:textSize="11sp" />
 
@@ -139,7 +137,6 @@
                 android:layout_height="wrap_content"
                 android:layout_below="@+id/home_text_profile_header"
                 android:layout_centerHorizontal="true"
-                android:text="Windows 7"
                 android:textSize="11sp" />
 	        <ImageView
 			        android:layout_width="wrap_content"

+ 119 - 169
res/layout/fragment_record_detail.xml

@@ -1,200 +1,150 @@
 <?xml version="1.0" encoding="utf-8"?>
 
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-			  android:layout_width="match_parent"
-			  android:layout_height="match_parent"
-			  android:orientation="vertical"
-			  android:padding="16dp" android:background="@android:color/transparent">
-
-	<TableLayout
-			android:layout_width="match_parent"
-			android:layout_height="wrap_content" android:stretchColumns="*">
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/ssid"
-					android:id="@+id/textView2"/>
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_ssid_value" android:layout_column="1"
-					/>
-		</TableRow>
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/bssid"
-					android:id="@+id/record_details_text_ssid" android:layout_column="0"/>
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_bssid_value"
-					/>
-		</TableRow>
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/protocol"
-					android:id="@+id/textView3" android:layout_column="0"/>
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_protocol_value"
-					/>
-		</TableRow>
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/timestamp"
-					android:id="@+id/record_details_text_bssid" android:layout_column="0"/>
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_timestamp_value"
-					/>
-		</TableRow>
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/location"
-					android:id="@+id/textView5" android:layout_column="0"/>
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_location_value"
-					/>
-		</TableRow>
-		<TableRow
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:id="@+id/scrollView"
+            android:fillViewport="true">
+
+	<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+				  android:orientation="vertical"
+				  android:layout_width="match_parent"
+				  android:layout_height="wrap_content"
+				  android:measureWithLargestChild="false"
+				  android:baselineAligned="true"
+				  android:id="@+id/linearLayout3">
+
+		<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+					  android:orientation="vertical"
+					  android:layout_width="match_parent"
+					  android:layout_height="wrap_content"
+					  android:measureWithLargestChild="false"
+					  android:baselineAligned="true"
+					  android:id="@+id/record_overview_conversation">
+
+		<RelativeLayout
 				android:layout_width="match_parent"
-				android:layout_height="match_parent">
+				android:layout_height="wrap_content"
+				android:background="@drawable/panel_bg_selector"
+				android:layout_margin="5dp"
+				android:paddingBottom="10dp"
+				android:paddingLeft="10dp"
+				android:paddingTop="5dp"
+				android:paddingRight="10dp"
+				>
+
 			<TextView
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/internal_ip"
-					android:id="@+id/textView7" android:layout_column="0"/>
+					android:id="@+id/record_details_text_ssid"
+					android:layout_toRightOf="@+id/textView7"
+					android:layout_marginLeft="27dp"/>
+
 			<TextView
 					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_internalip_value"
-					/>
-		</TableRow>
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
+					android:layout_height="match_parent"
+					android:textAppearance="?android:attr/textAppearanceSmall"
+					android:text="@string/RecordSSID"
+					android:textAllCaps="true"
+					android:id="@+id/textView2"
+					android:gravity="center"
+					android:layout_alignParentTop="true"
+					android:layout_alignParentLeft="true"
+					android:layout_alignParentStart="true"
+					android:layout_alignBottom="@+id/record_details_text_ssid"/>
+
 			<TextView
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/external_ip"
-					android:id="@+id/record_details_text_protocol" android:layout_column="0"/>
+					android:textAppearance="?android:attr/textAppearanceSmall"
+					android:text="@string/RecordBSSID"
+					android:textAllCaps="true"
+					android:id="@+id/textView3"
+					android:layout_alignTop="@+id/record_details_text_bssid"
+					android:layout_alignParentLeft="true"
+					android:layout_alignParentStart="true"
+					android:layout_alignBottom="@+id/record_details_text_bssid"
+					android:gravity="center"/>
+
 			<TextView
+					android:id="@+id/record_details_text_bssid"
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_externalip_value"
-					/>
-		</TableRow>
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
+					android:layout_below="@+id/record_details_text_ssid"
+					android:layout_alignLeft="@+id/record_details_text_ssid"
+					android:layout_alignStart="@+id/record_details_text_ssid"/>
+
 			<TextView
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/remote_ip"
-					android:id="@+id/record_details_text_protocol" android:layout_column="0"/>
+					android:textAppearance="?android:attr/textAppearanceSmall"
+					android:text="@string/record_details_remote_ip"
+					android:textAllCaps="true"
+					android:id="@+id/textView7"
+					android:gravity="center"
+					android:layout_alignTop="@+id/record_details_text_remoteip"
+					android:layout_alignBottom="@+id/record_details_text_remoteip"/>
+
 			<TextView
+					android:id="@+id/record_details_text_remoteip"
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_remoteip_value"
-					/>
-		</TableRow>
-		<TableRow
-				android:layout_width="match_parent"
-				android:layout_height="match_parent">
+					android:layout_alignLeft="@+id/record_details_text_bssid"
+					android:layout_alignStart="@+id/record_details_text_bssid"
+					android:layout_below="@+id/record_details_text_bssid"
+					android:layout_alignParentRight="true"
+					android:layout_alignParentEnd="true"/>
+
 			<TextView
 					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="@string/packet_type"
-					android:id="@+id/record_details_text_remoteip" android:layout_column="0"/>
+					android:layout_height="match_parent"
+					android:textAppearance="?android:attr/textAppearanceSmall"
+					android:text="@string/RecordProtocol"
+					android:id="@+id/textView5"
+					android:textAllCaps="true"
+					android:layout_gravity="right|center"
+					android:textAlignment="gravity"
+					android:gravity="center_vertical"
+					android:layout_alignTop="@+id/record_details_text_protocol"
+					android:layout_alignParentLeft="true"
+					android:layout_alignParentStart="true"
+					android:layout_alignBottom="@+id/record_details_text_protocol"/>
+
 			<TextView
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="undefined"
-					android:id="@+id/record_detail_packettype_value"
-					/>
-		</TableRow>
-	</TableLayout>
-	<TextView
-			android:layout_width="wrap_content"
-			android:layout_height="wrap_content"
-			android:textAppearance="?android:attr/textAppearanceMedium"
-			android:text="@string/packet_content"
-			android:id="@+id/textView9"/>
-	<ScrollView
-			android:layout_width="match_parent"
-			android:layout_height="wrap_content"
-			android:id="@+id/scrollView"
-			android:layout_weight="1" android:fillViewport="true"
-			android:background="@drawable/panel_bg">
+					android:textAllCaps="true"
+					android:id="@+id/record_details_text_protocol"
+					android:gravity="center_horizontal"
+					android:layout_below="@+id/record_details_text_remoteip"
+					android:layout_alignLeft="@+id/record_details_text_remoteip"
+					android:layout_alignStart="@+id/record_details_text_remoteip"/>
+
+		</RelativeLayout>
+
 		<TextView
-				android:layout_width="match_parent"
+				android:layout_width="wrap_content"
 				android:layout_height="wrap_content"
-				android:padding="8dp"
-				android:textAppearance="?android:attr/textAppearanceMedium"
-				android:text="undefined"
-				android:id="@+id/record_conversation_content" android:autoText="false"
-				android:typeface="monospace"
-				android:singleLine="false"
-				android:textIsSelectable="true"
-				/>
-	</ScrollView>
-
-	<Button
-			android:layout_width="wrap_content"
-			android:layout_height="wrap_content"
-			android:text="@string/delete"
-			android:id="@+id/button"
-			android:layout_gravity="center_horizontal|bottom"
-			android:layout_weight="0" android:layout_marginTop="8dp"
-			android:background="@color/holo_red"
-			android:textColor="@android:color/white"/>
-</LinearLayout>
+				android:textAppearance="?android:attr/textAppearanceSmall"
+				android:text="@string/record_details_conversation"
+				android:textAllCaps="true"
+				android:id="@+id/textView9"
+				android:layout_marginLeft="10dp"
+				android:layout_marginTop="10dp"
+				android:layout_marginBottom="20dp"/>
+
+	</LinearLayout>
+
+
+		<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
+				android:text="@string/delete" android:id="@+id/record_delete_button"
+				android:layout_gravity="center_horizontal" android:layout_weight="0"
+				android:layout_margin="8dp" android:background="@color/holo_red"
+				android:textColor="@android:color/white"/>
+
+	</LinearLayout>
+</ScrollView>

+ 0 - 154
res/layout/fragment_record_overview.xml

@@ -1,154 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            android:id="@+id/scrollView"
-            android:fillViewport="true">
-
-	<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-				  android:orientation="vertical"
-				  android:layout_width="match_parent"
-				  android:layout_height="wrap_content"
-				  android:measureWithLargestChild="false"
-				  android:baselineAligned="true"
-				  android:id="@+id/linearLayout3">
-
-		<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-					  android:orientation="vertical"
-					  android:layout_width="match_parent"
-					  android:layout_height="wrap_content"
-					  android:measureWithLargestChild="false"
-					  android:baselineAligned="true"
-					  android:id="@+id/record_overview_conversation">
-
-		<RelativeLayout
-				android:layout_width="match_parent"
-				android:layout_height="wrap_content"
-				android:background="@drawable/panel_bg_selector"
-				android:layout_margin="5dp"
-				android:paddingBottom="10dp"
-				android:paddingLeft="10dp"
-				android:paddingTop="5dp"
-				android:paddingRight="10dp"
-				>
-
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="-"
-					android:id="@+id/record_details_text_ssid"
-					android:layout_toRightOf="@+id/textView7"
-					android:layout_marginLeft="27dp"/>
-
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="match_parent"
-					android:textAppearance="?android:attr/textAppearanceSmall"
-					android:text="@string/RecordSSID"
-					android:textAllCaps="true"
-					android:id="@+id/textView2"
-					android:gravity="center"
-					android:layout_alignParentTop="true"
-					android:layout_alignParentLeft="true"
-					android:layout_alignParentStart="true"
-					android:layout_alignBottom="@+id/record_details_text_ssid"/>
-
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceSmall"
-					android:text="@string/RecordBSSID"
-					android:textAllCaps="true"
-					android:id="@+id/textView3"
-					android:layout_alignTop="@+id/record_details_text_bssid"
-					android:layout_alignParentLeft="true"
-					android:layout_alignParentStart="true"
-					android:layout_alignBottom="@+id/record_details_text_bssid"
-					android:gravity="center"/>
-
-			<TextView
-					android:id="@+id/record_details_text_bssid"
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="-"
-					android:layout_below="@+id/record_details_text_ssid"
-					android:layout_alignLeft="@+id/record_details_text_ssid"
-					android:layout_alignStart="@+id/record_details_text_ssid"/>
-
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceSmall"
-					android:text="@string/record_details_remote_ip"
-					android:textAllCaps="true"
-					android:id="@+id/textView7"
-					android:gravity="center"
-					android:layout_alignTop="@+id/record_details_text_remoteip"
-					android:layout_alignBottom="@+id/record_details_text_remoteip"/>
-
-			<TextView
-					android:id="@+id/record_details_text_remoteip"
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="-"
-					android:layout_alignLeft="@+id/record_details_text_bssid"
-					android:layout_alignStart="@+id/record_details_text_bssid"
-					android:layout_below="@+id/record_details_text_bssid"
-					android:layout_alignParentRight="true"
-					android:layout_alignParentEnd="true"/>
-
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="match_parent"
-					android:textAppearance="?android:attr/textAppearanceSmall"
-					android:text="@string/RecordProtocol"
-					android:id="@+id/textView5"
-					android:textAllCaps="true"
-					android:layout_gravity="right|center"
-					android:textAlignment="gravity"
-					android:gravity="center_vertical"
-					android:layout_alignTop="@+id/record_details_text_protocol"
-					android:layout_alignParentLeft="true"
-					android:layout_alignParentStart="true"
-					android:layout_alignBottom="@+id/record_details_text_protocol"/>
-
-			<TextView
-					android:layout_width="wrap_content"
-					android:layout_height="wrap_content"
-					android:textAppearance="?android:attr/textAppearanceMedium"
-					android:text="-"
-					android:textAllCaps="true"
-					android:id="@+id/record_details_text_protocol"
-					android:gravity="center_horizontal"
-					android:layout_below="@+id/record_details_text_remoteip"
-					android:layout_alignLeft="@+id/record_details_text_remoteip"
-					android:layout_alignStart="@+id/record_details_text_remoteip"/>
-
-		</RelativeLayout>
-
-		<TextView
-				android:layout_width="wrap_content"
-				android:layout_height="wrap_content"
-				android:textAppearance="?android:attr/textAppearanceSmall"
-				android:text="@string/record_details_conversation"
-				android:textAllCaps="true"
-				android:id="@+id/textView9"
-				android:layout_marginLeft="10dp"
-				android:layout_marginTop="10dp"
-				android:layout_marginBottom="20dp"/>
-
-	</LinearLayout>
-
-
-		<Button android:layout_width="wrap_content" android:layout_height="wrap_content"
-				android:text="@string/delete" android:id="@+id/record_delete_button"
-				android:layout_gravity="center_horizontal" android:layout_weight="0"
-				android:layout_margin="8dp" android:background="@color/holo_red"
-				android:textColor="@android:color/white"/>
-
-	</LinearLayout>
-</ScrollView>

+ 0 - 3
res/layout/fragment_services.xml

@@ -9,7 +9,6 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
         <TextView
-                android:id="@+id/record_details_text_ssid"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentEnd="true"
@@ -52,7 +51,6 @@
                 android:layout_centerHorizontal="true"
                 android:layout_gravity="center_horizontal"
                 android:layout_marginTop="21dp"
-                android:text="Eduroam"
                 android:textAppearance="?android:attr/textAppearanceLarge"
                 android:textSize="26sp" />
 
@@ -66,7 +64,6 @@
             android:weightSum="1" >
 
         <TextView
-                android:id="@+id/record_details_text_ssid"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentEnd="true"

+ 0 - 3
res/layout/fragment_statistics.xml

@@ -45,7 +45,6 @@
                         android:layout_width="match_parent"
                         android:layout_height="match_parent"
                         android:textAppearance="?android:attr/textAppearanceMedium"
-                        android:text="Title"
                         android:textAlignment="center"
                         android:id="@+id/title_text_view" />
                 </LinearLayout>
@@ -85,7 +84,6 @@
                         android:layout_width="fill_parent"
                         android:layout_height="fill_parent"
                         android:textAppearance="?android:attr/textAppearanceSmall"
-                        android:text="table header title"
                         android:id="@+id/table_header_title_textview"
                         android:gravity="bottom|left"
                         android:textAlignment="viewStart"
@@ -96,7 +94,6 @@
                         android:layout_width="fill_parent"
                         android:layout_height="fill_parent"
                         android:textAppearance="?android:attr/textAppearanceSmall"
-                        android:text="value"
                         android:id="@+id/table_header_value_textview"
                         android:textAlignment="viewEnd"
                         android:layout_weight="0.6"

+ 0 - 1
res/layout/fragment_threatmap_infowindow.xml

@@ -9,7 +9,6 @@
 			android:layout_width="wrap_content"
 			android:layout_height="wrap_content"
 			android:textAppearance="?android:attr/textAppearanceMedium"
-			android:text="undefined"
 			android:id="@+id/threatmap_infowindow_title" android:layout_gravity="center_horizontal"/>
 	<TextView
 			android:layout_width="wrap_content"

+ 0 - 45
res/layout/list_view_protocols_row.xml

@@ -1,45 +0,0 @@
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:padding="5dp" >
-
-    <ImageView
-        android:id="@+id/imageViewLight"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_centerVertical="true"
-        android:layout_toRightOf="@+id/imageViewLight"
-        android:orientation="vertical" >
-
-        <TextView
-            android:id="@+id/textViewProtocol"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceLarge" />
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:orientation="horizontal" >
-
-            <TextView
-                android:id="@+id/textViewConnections"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/gui_connections"
-                android:textAppearance="?android:attr/textAppearanceSmall" />
-
-            <TextView
-                android:id="@+id/textViewConnectionsValue"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:paddingLeft="5dp"
-                android:textAppearance="?android:attr/textAppearanceSmall" />
-        </LinearLayout>
-    </LinearLayout>
-
-</RelativeLayout>

+ 0 - 25
res/layout/loglist_row.xml

@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<RelativeLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:id="@+id/profile_manager_root_view">
-
-    <ListView
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@+id/profile_manager_listview"
-        android:choiceMode="singleChoice"
-        android:background="#F2F2F2"
-        android:dividerHeight="10dp"
-        android:divider="@android:color/transparent"
-        android:padding="5dp"
-        android:layout_alignParentLeft="true"
-        android:layout_marginLeft="0dp"
-        android:layout_alignParentTop="true"
-        android:layout_marginTop="0dp" />
-
-</RelativeLayout>

+ 0 - 3
res/layout/plot_list_item.xml

@@ -16,7 +16,6 @@
         android:layout_width="fill_parent"
         android:layout_height="match_parent"
         android:textAppearance="?android:attr/textAppearanceSmall"
-        android:text=" "
         android:id="@+id/color_view"
         android:layout_weight="4"
         />
@@ -25,7 +24,6 @@
         android:layout_width="fill_parent"
         android:layout_height="match_parent"
         android:textAppearance="?android:attr/textAppearanceMedium"
-        android:text="title"
         android:id="@+id/title_text_view"
         android:layout_weight="3"
         android:paddingLeft="5dp"
@@ -36,7 +34,6 @@
         android:layout_width="fill_parent"
         android:layout_height="match_parent"
         android:textAppearance="?android:attr/textAppearanceMedium"
-        android:text="value"
         android:id="@+id/value_text_view"
         android:textAlignment="textEnd"
         android:gravity="right"

+ 2 - 0
res/layout/preference_warning.xml

@@ -21,6 +21,7 @@
 			android:layout_marginBottom="6dip"
 			android:layout_weight="1">
 
+		<!--suppress AndroidDomInspection -->
 		<TextView android:id="@+android:id/title"
 		          android:layout_width="wrap_content"
 		          android:layout_height="wrap_content"
@@ -29,6 +30,7 @@
 		          android:ellipsize="marquee"
 		          android:fadingEdge="horizontal" />
 
+		<!--suppress AndroidDomInspection -->
 		<TextView android:id="@+android:id/summary"
 		          android:layout_width="wrap_content"
 		          android:layout_height="wrap_content"

+ 0 - 12
res/layout/preferences_image_widget.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
-              android:layout_width="match_parent"
-              android:layout_height="match_parent">
-
-	<ImageView
-			android:layout_width="fill_parent"
-			android:layout_height="fill_parent"
-			android:id="@+id/preference_image" android:layout_gravity="center_horizontal"/>
-</LinearLayout>

+ 0 - 35
res/layout/profile_manager_list_item.xml

@@ -26,7 +26,6 @@
             <ImageButton
                 android:layout_width="0dp"
                 android:layout_height="match_parent"
-                android:text="Edit"
                 android:id="@+id/profile_manager_item_button_edit"
                 android:layout_weight="1"
                 style="@android:style/DeviceDefault.Light.ButtonBar"
@@ -45,7 +44,6 @@
             <ImageButton
                 android:layout_width="0dp"
                 android:layout_height="match_parent"
-                android:text="Delete"
                 android:id="@+id/profile_manager_item_button_delete"
                 android:layout_alignParentTop="true"
                 android:layout_alignParentRight="true"
@@ -76,14 +74,12 @@
 	        android:paddingRight="16dp"
 	        android:textColor="?android:attr/colorForeground"
 	        android:minHeight="?android:attr/listPreferredItemHeightSmall"
-	        android:text="Sample title"
 	        android:layout_alignParentTop="true"
 	        android:layout_toRightOf="@+id/profile_manager_item_image" />
 
 	    <TextView
 	        android:layout_width="match_parent"
 	        android:layout_height="wrap_content"
-	        android:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."
 	        android:id="@+id/profile_manager_item_text"
 	        android:paddingLeft="16dp"
 	        android:paddingRight="16dp"
@@ -134,39 +130,8 @@
 					android:layout_width="wrap_content"
 					android:layout_height="wrap_content"
 					android:textAppearance="?android:attr/textAppearanceSmall"
-					android:text="HTTP"
 					style="@style/ProfileManagerListBadge"
 					android:id="@+id/record_details_text_ssid" android:layout_gravity="center_vertical" android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/textView2" android:layout_gravity="center_vertical"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/record_conversation_info" android:layout_gravity="bottom"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/textView3" android:layout_gravity="center_vertical"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/record_conversation_type" android:layout_gravity="bottom"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/record_details_text_bssid" android:layout_gravity="center_vertical"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/textView5" android:layout_gravity="center_vertical"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/textView9" android:layout_gravity="center_vertical"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/record_details_text_remoteip" android:layout_gravity="bottom"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/record_details_text_protocol" android:layout_gravity="center_vertical"
-			          android:layout_marginLeft="10dp"/>
-			<TextView style="@style/ProfileManagerListBadge" android:layout_width="wrap_content" android:layout_height="wrap_content"
-			          android:textAppearance="?android:attr/textAppearanceSmall" android:text="HTTP" android:id="@+id/textView7" android:layout_gravity="center_vertical"
-			          android:layout_marginLeft="10dp"/>
 		</de.tudarmstadt.informatik.hostage.ui2.layouts.FlowLayout>
 
 	</RelativeLayout>

+ 0 - 4
res/layout/record_list_item.xml

@@ -13,7 +13,6 @@
         android:layout_height="wrap_content"
         android:layout_alignParentLeft="true"
         android:layout_alignParentTop="true"
-        android:text="BSSID"
         android:textAppearance="?android:attr/textAppearanceLarge"
         android:textColor="#000000" />
 
@@ -24,7 +23,6 @@
         android:layout_alignLeft="@+id/RecordTextFieldBSSID"
         android:layout_below="@+id/RecordTextFieldBSSID"
         android:layout_marginTop="24dp"
-        android:text="ESSID"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <TextView
@@ -35,7 +33,6 @@
         android:layout_alignBottom="@+id/RecordTextFieldSSID"
         android:layout_alignParentRight="true"
         android:layout_marginRight="5dp"
-        android:text="00:00:00"
         android:textAppearance="?android:attr/textAppearanceSmall" />
 
     <TextView
@@ -45,7 +42,6 @@
         android:layout_alignBaseline="@+id/RecordTextFieldBSSID"
         android:layout_alignBottom="@+id/RecordTextFieldBSSID"
         android:layout_alignRight="@+id/RecordTextFieldTimestamp"
-        android:text="Protocol"
         android:textAppearance="?android:attr/textAppearanceMedium"
         android:textColor="#000000" />
 

+ 0 - 1
res/layout/services_list_item.xml

@@ -25,7 +25,6 @@
                 android:layout_marginLeft="50dp"
                 android:layout_marginTop="5dp"
                 android:layout_weight="1"
-                android:text="SSH"
                 android:textStyle="bold"
                 android:textSize="16dp"/>
         <TextView

+ 0 - 1
res/layout/simple_popup_item.xml

@@ -17,7 +17,6 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:textAppearance="?android:attr/textAppearanceMedium"
-        android:text="Title"
         android:id="@+id/title_text_view"
         android:textColor="#ffffff"
         android:textAlignment="textStart"

+ 0 - 1
res/layout/simple_popup_table.xml

@@ -11,7 +11,6 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:textAppearance="?android:attr/textAppearanceLarge"
-        android:text="Title"
         android:gravity="top"
         android:id="@+id/title_text_view"
         android:textColor="@android:color/holo_blue_bright"

+ 0 - 4
res/layout/split_popup_item.xml

@@ -27,7 +27,6 @@
 		            android:layout_width="wrap_content"
 		            android:layout_height="wrap_content"
 		            android:textAppearance="?android:attr/textAppearanceMedium"
-		            android:text="Earliest"
 		            android:id="@+id/left_title_text_view"
 		            android:textColor="#ffffff"
 		            android:layout_alignParentStart="true"
@@ -37,7 +36,6 @@
 		            android:layout_width="wrap_content"
 		            android:layout_height="wrap_content"
 		            android:textAppearance="?android:attr/textAppearanceSmall"
-		            android:text="Subtitle"
 		            android:id="@+id/left_subtitle_text_view"
 		            android:textColor="@color/light_grey"
 		            android:layout_alignParentStart="true"
@@ -70,7 +68,6 @@
 	            android:layout_width="wrap_content"
 	            android:layout_height="wrap_content"
 	            android:textAppearance="?android:attr/textAppearanceMedium"
-	            android:text="Title"
 	            android:id="@+id/right_title_text_view"
 	            android:textColor="#ffffff"
 	            android:layout_alignParentStart="true"
@@ -80,7 +77,6 @@
 	            android:layout_width="wrap_content"
 	            android:layout_height="wrap_content"
 	            android:textAppearance="?android:attr/textAppearanceSmall"
-	            android:text="Subtitle"
 	            android:id="@+id/right_subtitle_text_view"
 	            android:textColor="@color/light_grey"
 	            android:layout_alignParentStart="true"

+ 0 - 15
res/menu/main.xml

@@ -1,15 +0,0 @@
-<menu xmlns:android="http://schemas.android.com/apk/res/android" >
-
-    <item
-        android:id="@+id/action_settings"
-        android:orderInCategory="100"
-        android:showAsAction="never"
-        android:title="@string/gui_action_settings"/>
-    
-    <item
-        android:id="@+id/action_about"
-        android:orderInCategory="100"
-        android:showAsAction="never"
-        android:title="@string/gui_action_about"/>
-
-</menu>

+ 1 - 0
res/values-de/strings.xml

@@ -72,6 +72,7 @@
     <string name="drawer_profile_manager">Profile</string>
     <string name="drawer_app_info">&#220;ber diese App</string>
     <string name="drawer_statistics">Statistiken</string>
+	<string name="drawer_help">Hilfe videos</string>
 
     <string name="hostage_with_url"><a href="http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage">HosTaGe</a></string>
 

+ 33 - 0
res/values-de/strings_disclaimer.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+	<string name="hostage_disclaimer">
+		<![CDATA[
+		<p>
+		The product is protected by Federal Copyright Law. [COMPANY NAME] retains the title to and ownership of the Product. You are licensed to use this Product on the following terms and conditions:
+		</p>
+		<p>
+		<b>LICENSE</b> - The licensee is defined as the individual or company utilizing the Software Product. [COMPANY NAME] hereby grants the licensee a nonexclusive license authorizing the licensee to use the enclosed Product on one computer at a time. The licensee is also permitted to distribute this product to one, and only one web server to host the Program. Please contact [COMPANY NAME] if you require additional licenses. Use of this product by more than one individual or by anyone other than the licensee terminates, without notification, this license and the right to use this product.
+		</p>
+		<p>
+	    <b>YOU MAY NOT:</b> Distribute, rent, sub-license or otherwise make available to others the software or documentation or copies thereof, except as expressly permitted in this License without prior written consent from [COMPANY NAME]. In the case of an authorized transfer, the transferee must agree to be bound by the terms and conditions of this License Agreement.
+		</p>
+		<p>
+	    <b>RESTRICTIONS:</b> - You may use this Product in your business as long as:
+	    <br>The software serial number and user must be registered with [COMPANY NAME] in order to receive support or distribution rights.
+	    <br>You may not remove any proprietary notices, labels, trademarks on the software or documentation.
+	    <br>You may not modify, de-compile, disassemble, reverse engineer or translate the software.
+		</p>
+		<p>
+	    <b>US GOVERNMENT RESTRICTED RIGHTS</b> - Use, duplication or disclosure by the United States Government is subject to restrictions as set forth under DFARS 252.227-7013 or in FARS 52.227-19 Commercial Computer Software - Restricted Rights.
+		</p>
+		<p>
+	    <b>TERM</b> - You may terminate your License and this Agreement at anytime by destroying all copies of the Product and Product Documentation. They will also terminate automatically if you fail to comply with any term or condition in this Agreement.
+		</p>
+		<p>
+	    <b>LIMITED WARRANTY</b> - This software and documentation are sold "as is" without any warranty as to their performance, merchantability or fitness for any particular purpose. The licensee assumes the entire risk as to the quality and performance of the software. [COMPANY NAME] warrants that the diskettes on which the Program is furnished will be free from any defects in materials. Exclusive remedy in the event of a defect is expressly limited to the replacement of diskettes. In no event shall [COMPANY NAME] or anyone else who has been involved in the creation, development, production, or delivery of this software be liable for any direct, incidental or consequential damages, such as, but not limited to, loss of anticipated profits, benefits, use, or data resulting from the use of this software, or arising out of any breach of warranty.
+		</p>
+		]]>
+	</string>
+	<string name="agree">Agree</string>
+	<string name="disagree">Disagree</string>
+</resources>

+ 7 - 0
res/values-de/strings_gui.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="gui_choose_device">Gerät auswählen</string>
+    <string name="gui_nfc">NFC</string>
+    <string name="gui_bluetooth">Bluetooth</string>
+    <string name="gui_tracing">Tracing</string>
+</resources>

+ 2 - 0
res/values-de/strings_preferences.xml

@@ -30,5 +30,7 @@
     <string name="pref_location_time_default">60000</string>
     <string name="pref_location_retries">Retries</string>
     <string name="pref_location_retries_default">3</string>
+	<string name="pref_auto_synchronize_title">Autosynchronisation</string>
+	<string name="pref_auto_synchronize_summ">Autosynchronisation von Logdaten aktivieren</string>
 
 </resources>

+ 1 - 0
res/values/api_keys.xml

@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
 	<string name="google_maps_api_key_debug">AIzaSyCqh4bb4aMzvDcpDfiqHyXoAWFTQ6iNxe8</string>
+	<string name="google_maps_api_key_release">AIzaSyCxYbHYCoA0Mc_uZ_RwxqfJFZC1HBzzTR8</string>
 </resources>

+ 0 - 0
res/values/strings_broadcast.xml → res/values/broadcast.xml


+ 0 - 0
res/values/strings_connection_info.xml → res/values/connection_info.xml


+ 1 - 0
res/values/strings.xml

@@ -74,6 +74,7 @@
     <string name="drawer_profile_manager">Profiles</string>
     <string name="drawer_app_info">Application info</string>
 	<string name="drawer_statistics">Statistics</string>
+	<string name="drawer_help">Help videos</string>
 
     <string name="button_title_apply">Apply</string>
     <string name="button_title_cancel">Cancel</string>

+ 0 - 14
res/values/strings_about.xml

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
-	<string name="text_version">Version:</string>
-	<string name="description">HosTaGe is an open source low interaction honeypot, designed by a group of students at TU Darmstadt under the supervision of Shankar Karuppayah (CASED). The logs produced during usage can be uploaded to another project called \'TraCINg\'</string>
-	<string name="link_website">http://www.tk.informatik.tu-darmstadt.de/de/research/secure-smart-infrastructures/hostage</string>
-	<string name="link_github">https://github.com/hostage-org/hostage</string>
-	<string name="link_tracing">http://ssi.cased.de</string>
-	<string name="authors">Authors</string>
-	<string name="authors_m">Mihai Plasoianu</string>
-	<string name="authors_l">Lars Pandikow</string>
-	<string name="authors_w">Wulf Pfeiffer</string>
-	
-</resources>

+ 33 - 0
res/values/strings_disclaimer.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+	<string name="hostage_disclaimer">
+		<![CDATA[
+		<p>
+		The product is protected by Federal Copyright Law. [COMPANY NAME] retains the title to and ownership of the Product. You are licensed to use this Product on the following terms and conditions:
+		</p>
+		<p>
+		<b>LICENSE</b> - The licensee is defined as the individual or company utilizing the Software Product. [COMPANY NAME] hereby grants the licensee a nonexclusive license authorizing the licensee to use the enclosed Product on one computer at a time. The licensee is also permitted to distribute this product to one, and only one web server to host the Program. Please contact [COMPANY NAME] if you require additional licenses. Use of this product by more than one individual or by anyone other than the licensee terminates, without notification, this license and the right to use this product.
+		</p>
+		<p>
+	    <b>YOU MAY NOT:</b> Distribute, rent, sub-license or otherwise make available to others the software or documentation or copies thereof, except as expressly permitted in this License without prior written consent from [COMPANY NAME]. In the case of an authorized transfer, the transferee must agree to be bound by the terms and conditions of this License Agreement.
+		</p>
+		<p>
+	    <b>RESTRICTIONS:</b> - You may use this Product in your business as long as:
+	    <br>The software serial number and user must be registered with [COMPANY NAME] in order to receive support or distribution rights.
+	    <br>You may not remove any proprietary notices, labels, trademarks on the software or documentation.
+	    <br>You may not modify, de-compile, disassemble, reverse engineer or translate the software.
+		</p>
+		<p>
+	    <b>US GOVERNMENT RESTRICTED RIGHTS</b> - Use, duplication or disclosure by the United States Government is subject to restrictions as set forth under DFARS 252.227-7013 or in FARS 52.227-19 Commercial Computer Software - Restricted Rights.
+		</p>
+		<p>
+	    <b>TERM</b> - You may terminate your License and this Agreement at anytime by destroying all copies of the Product and Product Documentation. They will also terminate automatically if you fail to comply with any term or condition in this Agreement.
+		</p>
+		<p>
+	    <b>LIMITED WARRANTY</b> - This software and documentation are sold "as is" without any warranty as to their performance, merchantability or fitness for any particular purpose. The licensee assumes the entire risk as to the quality and performance of the software. [COMPANY NAME] warrants that the diskettes on which the Program is furnished will be free from any defects in materials. Exclusive remedy in the event of a defect is expressly limited to the replacement of diskettes. In no event shall [COMPANY NAME] or anyone else who has been involved in the creation, development, production, or delivery of this software be liable for any direct, incidental or consequential damages, such as, but not limited to, loss of anticipated profits, benefits, use, or data resulting from the use of this software, or arising out of any breach of warranty.
+		</p>
+		]]>
+	</string>
+	<string name="agree">Agree</string>
+	<string name="disagree">Disagree</string>
+</resources>

+ 0 - 28
res/values/strings_gui.xml

@@ -1,35 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <resources>
-
-    <string name="gui_action_about">About</string>
-    <string name="gui_action_settings">Settings</string>
-    <string name="gui_bssid">BSSID:</string>
-    <string name="gui_cancel">Cancel</string>
-    <string name="gui_capital_off">ON</string>
-    <string name="gui_capital_on">OFF</string>
-    <string name="gui_clear">Clear</string>
-    <string name="gui_connections">Recorded connections:</string>
-    <string name="gui_database">Database</string>
-    <string name="gui_delete">Delete</string>
-    <string name="gui_delete_dialog_title">Delete data sets by:</string>
-    <string name="gui_details">Connection info</string>
-    <string name="gui_dialog_clear_database">Clear all data?</string>
-    <string name="gui_dialog_clear_database_date">Delete all data before:</string>
-    <string name="gui_export_dialog_title">Choose Export Format</string>
-    <string name="gui_external_ip">External IP:</string>
-    <string name="gui_firstAttack">First Attack:</string>
-    <string name="gui_internal_ip">Internal IP:</string>
-    <string name="gui_lastAttack">Last Attack:</string>
-    <string name="gui_log_actions">Actions</string>
-    <string name="gui_paranoid">Paranoid Mode</string>
-    <string name="gui_playground">Playground</string>
-    <string name="gui_services">Services</string>
-    <string name="gui_ssid">SSID:</string>
-    <string name="gui_statistics">Statistics</string>
-    <string name="gui_status">Status</string>
     <string name="gui_choose_device">Choose Device</string>
     <string name="gui_nfc">NFC</string>
     <string name="gui_bluetooth">Bluetooth</string>
     <string name="gui_tracing">Tracing</string>
-    
 </resources>

+ 3 - 3
src/de/tudarmstadt/informatik/hostage/persistence/ProfileManager.java

@@ -401,7 +401,7 @@ public class ProfileManager {
 	 * @param persist indicates if the profile should be persisted after activating
 	 */
 	public void activateProfile(Profile profile, boolean persist){
-		if(profile.equals(this.mCurrentActivatedProfile)) return;
+		if(profile.equals(this.mCurrentActivatedProfile) || (mCurrentActivatedProfile != null && profile.mId == mCurrentActivatedProfile.mId)) return;
 
 		if(this.mCurrentActivatedProfile != null){
 			this.mCurrentActivatedProfile.mActivated = false;
@@ -569,7 +569,7 @@ public class ProfileManager {
 
 		serverHTTP.mActiveProtocols.put("HTTP", true);
 		serverHTTP.mActiveProtocols.put("HTTPS", true);
-		serverHTTP.mActiveProtocols.put("MYSQL", true);
+		serverHTTP.mActiveProtocols.put("MySQL", true);
 
 		this.addProfile(serverHTTP, false);
 
@@ -611,7 +611,7 @@ public class ProfileManager {
 		linuxMachine.mActiveProtocols.put("TELNET", true);
 		linuxMachine.mActiveProtocols.put("HTTP", true);
 		linuxMachine.mActiveProtocols.put("HTTPS", true);
-		linuxMachine.mActiveProtocols.put("MYSQL", true);
+		linuxMachine.mActiveProtocols.put("MySQL", true);
 
 		this.addProfile(linuxMachine, false);
 

+ 0 - 35
src/de/tudarmstadt/informatik/hostage/ui/AboutActivity.java

@@ -1,35 +0,0 @@
-package de.tudarmstadt.informatik.hostage.ui;
-
-import android.app.Activity;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.os.Bundle;
-import android.widget.TextView;
-import de.tudarmstadt.informatik.hostage.R;
-
-/**
- * Shows a simple About View with application version, a small discription and
- * authors of the project.
- * 
- * @author Lars Pandikow
- * 
- */
-public class AboutActivity extends Activity {
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.activity_about);
-		// Set Version Number
-		PackageInfo pInfo;
-		try {
-			pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
-			String version = pInfo.versionName;
-			TextView versionTextView = (TextView) findViewById(R.id.version);
-			versionTextView.setText(version);
-		} catch (NameNotFoundException e) {
-			e.printStackTrace();
-		}
-
-	}
-}

+ 0 - 66
src/de/tudarmstadt/informatik/hostage/ui/ListViewAdapter.java

@@ -1,66 +0,0 @@
-package de.tudarmstadt.informatik.hostage.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-import android.widget.ImageView;
-import android.widget.TextView;
-import de.tudarmstadt.informatik.hostage.R;
-
-/**
- * Custom ListViewAdapter to dynamically create a list of protocols.
- * 
- * @author Mihai Plasoianu
- */
-public class ListViewAdapter extends BaseAdapter {
-
-	private LayoutInflater inflater;
-	private ArrayList<HashMap<String, String>> data;
-
-	public ListViewAdapter(LayoutInflater inflater,
-			ArrayList<HashMap<String, String>> data) {
-		this.inflater = inflater;
-		this.data = data;
-	}
-
-	@Override
-	public int getCount() {
-		return data.size();
-	}
-
-	@Override
-	public Object getItem(int position) {
-		return data.get(position);
-	}
-
-	@Override
-	public long getItemId(int position) {
-		return position;
-	}
-
-	@Override
-	public View getView(int position, View convertView, ViewGroup parent) {
-		View v = convertView;
-		if (v == null) {
-			v = inflater.inflate(R.layout.list_view_protocols_row, null);
-		}
-
-		ImageView light = (ImageView) v.findViewById(R.id.imageViewLight);
-		TextView protocol = (TextView) v.findViewById(R.id.textViewProtocol);
-		TextView connections = (TextView) v
-				.findViewById(R.id.textViewConnectionsValue);
-
-		HashMap<String, String> d = new HashMap<String, String>();
-		d = data.get(position);
-
-		light.setImageResource(Integer.valueOf(d.get("light")).intValue());
-		protocol.setText(d.get("protocol"));
-		connections.setText(d.get("connections"));
-
-		return v;
-	}
-}

+ 0 - 610
src/de/tudarmstadt/informatik/hostage/ui/MainActivity.java

@@ -1,610 +0,0 @@
-package de.tudarmstadt.informatik.hostage.ui;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import android.app.ActivityManager;
-import android.app.ActivityManager.RunningServiceInfo;
-import android.content.BroadcastReceiver;
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.ServiceConnection;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.os.IBinder;
-import android.support.v4.app.FragmentActivity;
-import android.support.v4.content.LocalBroadcastManager;
-import android.view.GestureDetector;
-import android.view.GestureDetector.SimpleOnGestureListener;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.OnTouchListener;
-import android.view.animation.Animation;
-import android.view.animation.AnimationUtils;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.CheckBox;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.TextView;
-import android.widget.ToggleButton;
-import android.widget.ViewAnimator;
-import de.tudarmstadt.informatik.hostage.Hostage;
-import de.tudarmstadt.informatik.hostage.Hostage.LocalBinder;
-import de.tudarmstadt.informatik.hostage.R;
-import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
-
-/**
- * MainActivity is the central activity for the GUI of the application.
- * MainActivity is launched when the application is first started. It shows the
- * user: <br>
- * - information about the network<br>
- * - light indicators for recorded attacks on each protocol<br>
- * - amount of attacks on each protocols<br>
- * The user can start and stop services.
- * 
- * @author Mihai Plasoianu
- * @author Lars Pandikow
- * @author Wulf Pfeiffer
- */
-public class MainActivity extends FragmentActivity {
-
-	/**
-	 * Integer representing a grey light.
-	 */
-	public static final int LIGHT_GREY = 0x01;
-	/**
-	 * Integer representing a green light.
-	 */
-	public static final int LIGHT_GREEN = 0x02;
-	/**
-	 * Integer representing a red light.
-	 */
-	public static final int LIGHT_RED = 0x03;
-	/**
-	 * Integer representing a yellow light.
-	 */
-	public static final int LIGHT_YELLOW = 0x04;
-
-	private SharedPreferences connectionInfo;
-
-	private Hostage mService;
-	private boolean serviceBound;
-
-	// variables for the swipe animation
-	private ViewAnimator viewAnimator;
-	private GestureDetector gestureDetector;
-	private Animation animFlipInLR;
-	private Animation animFlipOutLR;
-	private Animation animFlipInRL;
-	private Animation animFlipOutRL;
-
-	private ListView listView;
-	private ListViewAdapter adapter;
-
-	/**
-	 * Connection to bind the background service
-	 * 
-	 * @see Hostage
-	 */
-	private ServiceConnection mConnection = new ServiceConnection() {
-		/**
-		 * After the service is bound, check which has been clicked and start
-		 * it.
-		 * 
-		 * @see android.content.ServiceConnection#onServiceConnected(android.content.ComponentName)
-		 */
-		@Override
-		public void onServiceConnected(ComponentName name, IBinder service) {
-			mService = ((LocalBinder) service).getService();
-			serviceBound = true;
-			updateUI();
-		}
-
-		/**
-		 * After the service is unbound, delete reference.
-		 * 
-		 * @see android.content.ServiceConnection#onServiceDisconnected(android.content.ComponentName)
-		 */
-		@Override
-		public void onServiceDisconnected(ComponentName name) {
-			mService = null;
-			serviceBound = false;
-		}
-
-	};
-
-	/**
-	 * Receiver for custom broadcast.
-	 * 
-	 * @see #BROADCAST
-	 */
-	private BroadcastReceiver mReceiver = new BroadcastReceiver() {
-		@Override
-		public void onReceive(Context context, Intent intent) {
-			// Update user interface.
-			updateUI();
-			updateConnectionInfText();
-		}
-	};
-
-	SimpleOnGestureListener simpleOnGestureListener = new SimpleOnGestureListener() {
-		@Override
-		public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
-			float sensitvity = 50;
-			if ((e1.getX() - e2.getX()) > sensitvity) {
-				swipeRightToLeft();
-			} else if ((e2.getX() - e1.getX()) > sensitvity) {
-				swipeLeftToRight();
-			}
-
-			return true;
-		}
-	};
-
-	/**
-	 * Called when User presses on/off button.
-	 * 
-	 * @param view
-	 */
-	public void buttonOnOffClick(View view) {
-		if (((ToggleButton) view).isChecked()) {
-			if (isParanoid()) {
-				String[] protocols = getResources().getStringArray(R.array.protocols);
-				for (String protocol : protocols) {
-					mService.startListener(protocol);
-				}
-			} else {
-				if (mService.isRunning("SMB")) {
-					mService.stopListener("SMB");
-				} else {
-					mService.startListener("SMB");
-				}
-			}
-		} else {
-			mService.stopListeners();
-			stopAndUnbind();
-		}
-	}
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		getMenuInflater().inflate(R.menu.main, menu);
-		return true;
-	}
-
-	@Override
-	public boolean onOptionsItemSelected(MenuItem item) {
-		// Handle item selection
-		switch (item.getItemId()) {
-		case R.id.action_settings:
-			startActivity(new Intent(this, SettingsActivity.class));
-			break;
-		case R.id.action_about:
-			startActivity(new Intent(this, AboutActivity.class));
-			break;
-		default:
-		}
-		return super.onOptionsItemSelected(item);
-	}
-
-	@Override
-	public boolean onTouchEvent(MotionEvent event) {
-		return gestureDetector.onTouchEvent(event);
-	}
-
-	/**
-	 * Starts the ViewLog activity, when the Button is pressed.
-	 * 
-	 * @see ViewLog
-	 * @param view
-	 *            View elements which triggers the method call.
-	 */
-	public void showLog(View view) {
-		// startActivity(new Intent(this, ViewLog.class));
-	}
-
-	public void startPlayGround(View view) {
-		startActivity(new Intent(this, PlayGroundActivity.class));
-	}
-
-	/**
-	 * Binds service to Activity
-	 * 
-	 * @see Hostage
-	 */
-	private void bindService() {
-		bindService(getServiceIntent(), mConnection, BIND_AUTO_CREATE);
-	}
-
-	/**
-	 * Returns an intent to start HoneyService.
-	 * 
-	 * @return An Intent to start HoneyService
-	 */
-	private Intent getServiceIntent() {
-		return new Intent(this, Hostage.class);
-	}
-
-	/**
-	 * Initializes the ListView. Creating its contents dynamic from protocol
-	 * res/values/protocols.xml
-	 */
-	private void initListView() {
-		ArrayList<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
-		for (String protocol : getResources().getStringArray(R.array.protocols)) {
-			HashMap<String, String> d = new HashMap<String, String>();
-			d.put("light", String.valueOf(R.drawable.light_grey));
-			d.put("protocol", protocol);
-			d.put("connections", "-");
-			data.add(d);
-		}
-		listView = (ListView) findViewById(R.id.listViewProtocols);
-		adapter = new ListViewAdapter(getLayoutInflater(), data);
-		listView.setAdapter(adapter);
-		listView.setOnTouchListener(new OnTouchListener() {
-
-			@Override
-			public boolean onTouch(View v, MotionEvent event) {
-				return gestureDetector.onTouchEvent(event);
-			}
-
-		});
-		listView.setOnItemClickListener(new OnItemClickListener() {
-
-			@Override
-			public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
-				String protocolName = (String) ((HashMap<?, ?>) adapter.getItem(position)).get("protocol");
-				if (mService.isRunning(protocolName)) {
-					mService.stopListener(protocolName);
-				} else {
-					mService.startListener(protocolName);
-				}
-			}
-		});
-	}
-
-	/**
-	 * Initializes variables for screen animation
-	 */
-	private void initViewAnimator() {
-		viewAnimator = (ViewAnimator) findViewById(R.id.viewAnimator);
-		gestureDetector = new GestureDetector(this, simpleOnGestureListener);
-
-		animFlipInLR = AnimationUtils.loadAnimation(this, R.anim.in_left_to_right);
-		animFlipOutLR = AnimationUtils.loadAnimation(this, R.anim.out_left_to_right);
-		animFlipInRL = AnimationUtils.loadAnimation(this, R.anim.in_right_to_left);
-		animFlipOutRL = AnimationUtils.loadAnimation(this, R.anim.out_right_to_left);
-	}
-
-	/**
-	 * Checks if user selected paranoid mode.
-	 * 
-	 * @return True when paranoid mode is selected, else returns false.
-	 */
-	private boolean isParanoid() {
-		return ((CheckBox) findViewById(R.id.checkBoxParanoid)).isChecked();
-	}
-
-	/**
-	 * Checks if a {@link Hostage} instance is running.
-	 * 
-	 * @return True if {@link Hostage} is running, else false.
-	 */
-	private boolean isServiceBound() {
-		return serviceBound;
-	}
-
-	/**
-	 * Checks if a {@link Hostage} instance is running.
-	 * 
-	 * @return True if {@link Hostage} is running, else false.
-	 */
-	private boolean isServiceRunning() {
-		ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
-		for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
-			if (service.service.getClassName().equals(Hostage.class.getName())) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * Register broadcast receiver for custom broadcast.
-	 * 
-	 * @see #BROADCAST
-	 */
-	private void registerReceiver() {
-		LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(getString(R.string.broadcast)));
-	}
-
-	/**
-	 * If mobile phone is connected to a wireless network starts the background
-	 * service ands binds itself to it. Else notifies the user that service
-	 * could not be started.
-	 */
-	private void startAndBind() {
-		startService(getServiceIntent());
-		bindService();
-	}
-
-	/**
-	 * Stops service and unbinds it.
-	 * 
-	 * @see Hostage
-	 */
-	private void stopAndUnbind() {
-		unbindService();
-		stopService(getServiceIntent());
-	}
-
-	/**
-	 * Called when a swipe to the Right is registered.
-	 */
-	private void swipeLeftToRight() {
-		if (viewAnimator.getDisplayedChild() == 1) {
-			viewAnimator.setInAnimation(animFlipInLR);
-			viewAnimator.setOutAnimation(animFlipOutLR);
-			viewAnimator.setDisplayedChild(0);
-		}
-	}
-
-	/**
-	 * Called when a swipe to the Left is registered.
-	 */
-	private void swipeRightToLeft() {
-		if (viewAnimator.getDisplayedChild() == 0) {
-			viewAnimator.setInAnimation(animFlipInRL);
-			viewAnimator.setOutAnimation(animFlipOutRL);
-			viewAnimator.setDisplayedChild(1);
-		}
-	}
-
-	/**
-	 * Unbinds service.
-	 * 
-	 * @see Hostage
-	 */
-	private void unbindService() {
-		unbindService(mConnection);
-	}
-
-	/**
-	 * Unregisters broadcast receiver for custom broadcast.
-	 * 
-	 * @see #BROADCAST
-	 */
-	private void unregisterReceiver() {
-		LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver);
-	}
-
-	/**
-	 * Gets Information about connection state and updates the GUI.
-	 */
-	private void updateConnectionInfText() {
-		TextView ssidView = (TextView) findViewById(R.id.textViewSSIDValue);
-		TextView bssidView = (TextView) findViewById(R.id.textViewBSSIDValue);
-		TextView internalIPView = (TextView) findViewById(R.id.textViewInternalIPValue);
-		TextView externalIPView = (TextView) findViewById(R.id.textViewExternalIPValue);
-
-		// externalIPView.setText("Loading...");
-
-		// Get connection information
-		String ssid = connectionInfo.getString(getString(R.string.connection_info_ssid), null);
-		String bssid = connectionInfo.getString(getString(R.string.connection_info_bssid), null);
-		String internalIP = connectionInfo.getString(getString(R.string.connection_info_internal_ip), null);
-		String externalIP = connectionInfo.getString(getString(R.string.connection_info_external_ip), null);
-
-		// Set text fields
-		if (ssid != null)
-			ssidView.setText(ssid);
-		else
-			ssidView.setText("-");
-
-		if (bssid != null)
-			bssidView.setText(bssid);
-		else
-			bssidView.setText("-");
-
-		if (internalIP != null)
-			internalIPView.setText(internalIP);
-		else
-			internalIPView.setText("-");
-
-		if (externalIP != null)
-			externalIPView.setText(externalIP);
-		else
-			externalIPView.setText("-");
-	}
-
-	/**
-	 * Sets the connections count for a given protocol.
-	 * 
-	 * @param connections
-	 *            New value for recorded connections.
-	 * @param protocolName
-	 *            Name of the protocol which should be updated.
-	 */
-	private void updateProtocolConnections(int connections, String protocolName) {
-		for (int i = 0; i < adapter.getCount(); ++i) {
-			HashMap<String, String> d = (HashMap<String, String>) adapter.getItem(i);
-			if (d.get("protocol").equals(protocolName)) {
-				d.put("connections", String.valueOf(connections));
-			}
-		}
-		adapter.notifyDataSetChanged();
-	}
-
-	/**
-	 * Sets the light indicator for a given protocol.
-	 * 
-	 * @param light
-	 *            Integer code to set the light color.
-	 * @param protocolName
-	 *            Name of the protocol which should be updated.
-	 */
-	private void updateProtocolLight(int light, String protocolName) {
-		for (int i = 0; i < adapter.getCount(); ++i) {
-			HashMap<String, String> d = (HashMap<String, String>) adapter.getItem(i);
-			if (d.get("protocol").equals(protocolName)) {
-				switch (light) {
-				case LIGHT_GREY:
-					d.put("light", String.valueOf(R.drawable.light_grey));
-					d.put("connections", "-");
-					break;
-				case LIGHT_GREEN:
-					d.put("light", String.valueOf(R.drawable.light_green));
-					break;
-				case LIGHT_RED:
-					d.put("light", String.valueOf(R.drawable.light_red));
-					break;
-				case LIGHT_YELLOW:
-					d.put("light", String.valueOf(R.drawable.light_yellow));
-					break;
-				}
-			}
-		}
-		adapter.notifyDataSetChanged();
-	}
-
-	/**
-	 * Sets the big light indicator.
-	 * 
-	 * @param light
-	 *            Integer code to set the light color.
-	 * @see #LIGHT_GREY
-	 * @see #LIGHT_GREEN
-	 * @see #LIGHT_RED
-	 * @see #LIGHT_YELLOW
-	 */
-	private void updateStatusLight(int light) {
-		switch (light) {
-		case LIGHT_GREY:
-			((ImageView) findViewById(R.id.imageViewLight)).setImageResource(R.drawable.light_grey_large);
-			break;
-		case LIGHT_GREEN:
-			((ImageView) findViewById(R.id.imageViewLight)).setImageResource(R.drawable.light_green_large);
-			break;
-		case LIGHT_RED:
-			((ImageView) findViewById(R.id.imageViewLight)).setImageResource(R.drawable.light_red_large);
-			break;
-		case LIGHT_YELLOW:
-			((ImageView) findViewById(R.id.imageViewLight)).setImageResource(R.drawable.light_yellow_large);
-			break;
-		}
-	}
-
-	/* ############# Help functions for animation ################## */
-
-	/**
-	 * Updates Information shown by the GUI.
-	 */
-	private void updateUI() {
-		boolean activeListeners = false;
-		boolean activeHandlers = false;
-		boolean yellowLight = false;
-
-		// Check for all protocols if listeners are active and attacks have been
-		// recorded
-		// Update protocol lights and connection information.
-		for (String protocol : getResources().getStringArray(R.array.protocols)) {
-			if (isServiceBound()) {
-				// Check if protocol is active
-				if (mService.isRunning(protocol)) {
-					activeListeners = true;
-					int handlerCount = mService.getNumberOfActiveConnections(protocol);
-					// Check if attacks have been recorded in this session.
-					if (handlerCount > 0) {
-						activeHandlers = true;
-						updateProtocolLight(LIGHT_RED, protocol);
-						updateProtocolConnections(handlerCount, protocol);
-					} else {
-						// Check if the bssid of the wireless network has
-						// already
-						// been recorded as infected.
-						HostageDBOpenHelper dbh = new HostageDBOpenHelper(this);
-						if (dbh.bssidSeen(protocol, connectionInfo.getString(getString(R.string.connection_info_bssid), null))) {
-							updateProtocolLight(LIGHT_YELLOW, protocol);
-							yellowLight = true;
-						} else {
-							updateProtocolLight(LIGHT_GREEN, protocol);
-						}
-						updateProtocolConnections(0, protocol);
-					}
-				} else {
-					updateProtocolLight(LIGHT_GREY, protocol);
-				}
-			} else {
-				updateProtocolLight(LIGHT_GREY, protocol);
-			}
-		}
-
-		// Update the big attack indicator.
-		if (activeListeners) {
-			if (activeHandlers) {
-				updateStatusLight(LIGHT_RED);
-			} else {
-				if (yellowLight) {
-					updateStatusLight(LIGHT_YELLOW);
-				} else {
-					updateStatusLight(LIGHT_GREEN);
-				}
-			}
-			((ToggleButton) findViewById(R.id.toggleButtonOnOff)).setChecked(true);
-			findViewById(R.id.checkBoxParanoid).setEnabled(false);
-		} else {
-			updateStatusLight(LIGHT_GREY);
-			((ToggleButton) findViewById(R.id.toggleButtonOnOff)).setChecked(false);
-			findViewById(R.id.checkBoxParanoid).setEnabled(true);
-		}
-	}
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.activity_main);
-		connectionInfo = getSharedPreferences(getString(R.string.connection_info), Context.MODE_PRIVATE);
-
-		// Create dynamic view elements
-		initViewAnimator();
-		initListView();
-		// Initialize Class variables
-		startAndBind();
-	}
-
-	@Override
-	protected void onDestroy() {
-		// Unbind running service
-		if (!mService.hasRunningListeners()) {
-			stopAndUnbind();
-		}
-		super.onDestroy();
-	}
-
-	@Override
-	protected void onStart() {
-		super.onStart();
-		// Register Broadcast Receiver
-		registerReceiver();
-		// Bind service if running, else check for connection change and delete
-		// sessionData
-		if (isServiceRunning()) {
-			bindService(getServiceIntent(), mConnection, BIND_AUTO_CREATE);
-		}
-		// Update UI
-		updateConnectionInfText();
-	}
-
-	@Override
-	protected void onStop() {
-		// Unregister Broadcast Receiver
-		unregisterReceiver();
-		super.onStop();
-	}
-
-}

+ 0 - 107
src/de/tudarmstadt/informatik/hostage/ui/PlayGroundActivity.java

@@ -1,107 +0,0 @@
-package de.tudarmstadt.informatik.hostage.ui;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Random;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.util.Log;
-import android.view.Menu;
-import android.view.View;
-import android.widget.TextView;
-import de.tudarmstadt.informatik.hostage.R;
-import de.tudarmstadt.informatik.hostage.commons.HelperUtils;
-import de.tudarmstadt.informatik.hostage.logging.NetworkRecord;
-import de.tudarmstadt.informatik.hostage.logging.SyncInfoRecord;
-import de.tudarmstadt.informatik.hostage.persistence.HostageDBContract;
-import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
-import de.tudarmstadt.informatik.hostage.sync.bluetooth.BluetoothSyncActivity;
-import de.tudarmstadt.informatik.hostage.sync.nfc.NFCSync;
-import de.tudarmstadt.informatik.hostage.sync.tracing.TracingSyncActivity;
-
-public class PlayGroundActivity extends Activity {
-
-
-	public void createNetworkData(View view) {
-		Random rnd = new Random();
-		ArrayList<NetworkRecord> fakeNetInfo = new ArrayList<NetworkRecord>();
-		for (int i = 0; i < 25; i++) {
-			NetworkRecord record = new NetworkRecord();
-			record.setBssid(createRandomBSSID());
-			record.setSsid(new BigInteger(130, rnd).toString(32));
-			record.setLatitude(rnd.nextDouble() * 360);
-			record.setLongitude(rnd.nextDouble() * 360);
-			record.setAccuracy(rnd.nextFloat());
-			record.setTimestampLocation(System.currentTimeMillis());
-			fakeNetInfo.add(record);
-		}
-
-		setNetworkInfoText();
-		new HostageDBOpenHelper(this).updateNetworkInformation(fakeNetInfo);
-	}
-
-	@Override
-	public boolean onCreateOptionsMenu(Menu menu) {
-		getMenuInflater().inflate(R.menu.main, menu);
-		return true;
-	}
-
-	public void startNFC(View view) {
-		startActivity(new Intent(this, TracingSyncActivity.class));
-	}
-
-	public void syncData(View view) {
-		startActivity(new Intent(this, BluetoothSyncActivity.class));
-	}
-
-	private String createRandomBSSID() {
-		Random rnd = new Random();
-		char[] symbols = new char[16];
-		for (int idx = 0; idx < 10; ++idx)
-			symbols[idx] = (char) ('0' + idx);
-		for (int idx = 10; idx < 16; ++idx)
-			symbols[idx] = (char) ('a' + idx - 10);
-
-		char[] buf = new char[17];
-		for (int i = 0; i < 18; i += 3) {
-			buf[i] = symbols[rnd.nextInt(symbols.length)];
-			buf[i + 1] = symbols[rnd.nextInt(symbols.length)];
-			if (i < 15) {
-				buf[i + 2] = ':';
-			}
-		}
-		return new String(buf);
-	}
-
-	private void setNetworkInfoText() {
-		HostageDBOpenHelper dbh = new HostageDBOpenHelper(this);
-		TextView text_view = (TextView) findViewById(R.id.textView1);
-		String text = "";
-		ArrayList<SyncInfoRecord> syncInfo = dbh.getSyncInfo();
-		HashMap<String, Long> syncDevices = dbh.getSyncDevices();
-
-		for (SyncInfoRecord info: syncInfo) {
-			text = text + info.getBSSID() + "\n"
-					+ info.getDeviceID() + "\n" +
-					+ info.getNumber_of_attacks() + "\n"
-					+ info.getNumber_of_portscans() + "\n\n";
-		}
-		
-		for(String device: syncDevices.keySet()){
-			text = text + device + "\n"
-					+ syncDevices.get(device) + "\n\n";
-		}
-		text_view.setText(text);
-	}
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		setContentView(R.layout.activity_playground);
-		setNetworkInfoText();
-	}
-}

+ 0 - 194
src/de/tudarmstadt/informatik/hostage/ui/SettingsActivity.java

@@ -1,194 +0,0 @@
-package de.tudarmstadt.informatik.hostage.ui;
-
-import android.content.SharedPreferences;
-import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
-import android.os.Bundle;
-import android.preference.EditTextPreference;
-import android.preference.Preference;
-import android.preference.PreferenceActivity;
-import android.preference.PreferenceManager;
-import android.widget.Toast;
-import de.tudarmstadt.informatik.hostage.R;
-
-/**
- * SettingsActivity creates the settings defined in /res/xml/preferences.xml.
- * 
- * @author Lars Pandikow.
- */
-public class SettingsActivity extends PreferenceActivity implements
-		OnSharedPreferenceChangeListener {
-	@Override
-	public void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		addPreferencesFromResource(R.xml.preferences);
-		// Set the value of the preference as the summary for the preference
-		Preference pref = findPreference("pref_external_location");
-		EditTextPreference etp = (EditTextPreference) pref;
-		pref.setSummary(etp.getText());
-
-		// Set the value of the preference as the summary for the preference
-		pref = findPreference("pref_upload_server");
-		etp = (EditTextPreference) pref;
-		pref.setSummary(etp.getText());
-
-		SharedPreferences defaultPref = PreferenceManager
-				.getDefaultSharedPreferences(this);
-		// Set the value of the preference as the summary for the preference
-		pref = findPreference("pref_max_connections");
-		etp = (EditTextPreference) pref;
-		defaultPref
-				.edit()
-				.putInt("max_connections",
-						Integer.valueOf(etp.getText()).intValue()).commit();
-		pref.setSummary(etp.getText());
-
-		// Set the value of the preference as the summary for the preference
-		pref = findPreference("pref_timeout");
-		etp = (EditTextPreference) pref;
-		defaultPref.edit()
-				.putInt("timeout", Integer.valueOf(etp.getText()).intValue())
-				.commit();
-		pref.setSummary(etp.getText());
-
-		// Set the value of the preference as the summary for the preference
-		pref = findPreference("pref_sleeptime");
-		etp = (EditTextPreference) pref;
-		defaultPref.edit()
-				.putInt("sleeptime", Integer.valueOf(etp.getText()).intValue())
-				.commit();
-		pref.setSummary(etp.getText());
-
-		// Set the value of the preference as the summary for the preference
-		pref = findPreference("pref_location_time");
-		etp = (EditTextPreference) pref;
-		defaultPref
-				.edit()
-				.putInt("location_time",
-						Integer.valueOf(etp.getText()).intValue()).commit();
-		pref.setSummary(etp.getText());
-
-		// Set the value of the preference as the summary for the preference
-		pref = findPreference("pref_location_retries");
-		etp = (EditTextPreference) pref;
-		defaultPref
-				.edit()
-				.putInt("location_retries",
-						Integer.valueOf(etp.getText()).intValue()).commit();
-		pref.setSummary(etp.getText());
-	}
-
-	@Override
-	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
-			String key) {
-		// Check which preference has been changed
-		if (key.equals("pref_external_location")) {
-			Preference pref = findPreference(key);
-			EditTextPreference etp = (EditTextPreference) pref;
-			String path = etp.getText();
-			// Check if the Path is valid
-			if (!path.startsWith("/"))
-				path = new String("/").concat(path);
-			if (!path.endsWith("/"))
-				path = path.concat(new String("/"));
-			if (!path.matches("/(([a-zA-Z_0-9])+/)*")) {
-				Toast.makeText(this,
-						"Path not valid. Must only contain a-zA-Z_0-9",
-						Toast.LENGTH_SHORT).show();
-				path = "/";
-				sharedPreferences.edit().putString(key, path).commit();
-			}
-			pref.setSummary(path);
-		} else if (key.equals("pref_upload_server")) {
-			Preference pref = findPreference(key);
-			EditTextPreference etp = (EditTextPreference) pref;
-			pref.setSummary(etp.getText());
-		} else if (key.equals("pref_max_connections")) {
-			Preference pref = findPreference(key);
-			EditTextPreference etp = (EditTextPreference) pref;
-			String value = etp.getText();
-			if (!value.matches("([0-9])+")) {
-				Toast.makeText(getApplicationContext(),
-						"Enter a valid number.", Toast.LENGTH_SHORT).show();
-				value = getResources().getString(
-						R.string.pref_max_connections_default);
-			}
-			sharedPreferences
-					.edit()
-					.putInt("max_connections",
-							Integer.valueOf(value).intValue()).commit();
-			pref.setSummary(value);
-		} else if (key.equals("pref_timeout")) {
-			Preference pref = findPreference(key);
-			EditTextPreference etp = (EditTextPreference) pref;
-			String value = etp.getText();
-			if (!value.matches("([0-9])+")) {
-				Toast.makeText(getApplicationContext(),
-						"Enter a valid number.", Toast.LENGTH_SHORT).show();
-				value = getResources().getString(R.string.pref_timeout_default);
-			}
-			sharedPreferences.edit()
-					.putInt("timeout", Integer.valueOf(value).intValue())
-					.commit();
-			pref.setSummary(value);
-		} else if (key.equals("pref_sleeptime")) {
-			Preference pref = findPreference(key);
-			EditTextPreference etp = (EditTextPreference) pref;
-			String value = etp.getText();
-			if (!value.matches("([0-9])+")) {
-				Toast.makeText(getApplicationContext(),
-						"Enter a valid number.", Toast.LENGTH_SHORT).show();
-				value = getResources().getString(
-						R.string.pref_sleeptime_default);
-			}
-			sharedPreferences.edit()
-					.putInt("sleeptime", Integer.valueOf(value).intValue())
-					.commit();
-			pref.setSummary(value);
-		} else if (key.equals("pref_location_time")) {
-			Preference pref = findPreference(key);
-			EditTextPreference etp = (EditTextPreference) pref;
-			String value = etp.getText();
-			if (!value.matches("([0-9])+")) {
-				Toast.makeText(getApplicationContext(),
-						"Enter a valid number.", Toast.LENGTH_SHORT).show();
-				value = getResources().getString(
-						R.string.pref_location_time_default);
-			}
-			sharedPreferences.edit()
-					.putInt("location_time", Integer.valueOf(value).intValue())
-					.commit();
-			pref.setSummary(value);
-		} else if (key.equals("pref_location_retries")) {
-			Preference pref = findPreference(key);
-			EditTextPreference etp = (EditTextPreference) pref;
-			String value = etp.getText();
-			if (!value.matches("([0-9])+")) {
-				Toast.makeText(getApplicationContext(),
-						"Enter a valid number.", Toast.LENGTH_SHORT).show();
-				value = getResources().getString(
-						R.string.pref_location_retries_default);
-			}
-			sharedPreferences
-					.edit()
-					.putInt("location_retries",
-							Integer.valueOf(value).intValue()).commit();
-			pref.setSummary(value);
-		}
-
-	}
-
-	@Override
-	protected void onPause() {
-		super.onPause();
-		getPreferenceScreen().getSharedPreferences()
-				.unregisterOnSharedPreferenceChangeListener(this);
-	}
-
-	@Override
-	protected void onResume() {
-		// register a listener to catch preference changes
-		super.onResume();
-		getPreferenceScreen().getSharedPreferences()
-				.registerOnSharedPreferenceChangeListener(this);
-	}
-}

+ 0 - 37
src/de/tudarmstadt/informatik/hostage/ui/ViewLogTable.java

@@ -1,37 +0,0 @@
-package de.tudarmstadt.informatik.hostage.ui;
-
-import android.app.Activity;
-import android.os.Bundle;
-import android.widget.ScrollView;
-import android.widget.TextView;
-import de.tudarmstadt.informatik.hostage.logging.Record;
-import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
-
-/**
- * Creates a simple log view. Shows the Information for every attack. The format
- * ist defined in {@link Record#toString(int)}.
- * 
- * @author Lars Pandikow
- * 
- */
-public class ViewLogTable extends Activity {
-
-	@Override
-	protected void onCreate(Bundle savedInstanceState) {
-		super.onCreate(savedInstanceState);
-		HostageDBOpenHelper dbh = new HostageDBOpenHelper(getBaseContext());
-		StringBuffer log = new StringBuffer();
-		// Create a log entry for every attack in the Database
-		for (Record record : dbh.getAllRecords()) {
-			log.append(record.toString());
-		}
-
-		ScrollView scroll = new ScrollView(this);
-		TextView text = new TextView(getApplicationContext());
-		text.setText(log);
-		text.setTextAppearance(this, android.R.style.TextAppearance_Medium);
-		scroll.addView(text);
-		setContentView(scroll);
-	}
-
-}

+ 233 - 95
src/de/tudarmstadt/informatik/hostage/ui2/activity/MainActivity.java

@@ -7,23 +7,28 @@ import java.util.List;
 import android.app.ActionBar;
 import android.app.Activity;
 import android.app.ActivityManager;
+import android.app.AlertDialog;
 import android.app.Fragment;
 import android.app.FragmentManager;
 import android.app.FragmentTransaction;
 import android.content.BroadcastReceiver;
 import android.content.ComponentName;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
+import android.content.SharedPreferences;
 import android.content.pm.ActivityInfo;
 import android.content.res.Configuration;
 import android.content.res.TypedArray;
+import android.net.Uri;
 import android.os.Bundle;
 import android.os.IBinder;
 import android.support.v4.app.ActionBarDrawerToggle;
 import android.support.v4.content.LocalBroadcastManager;
 import android.support.v4.widget.DrawerLayout;
+import android.text.Html;
 import android.util.Log;
 import android.view.Gravity;
 import android.view.KeyEvent;
@@ -52,6 +57,8 @@ import de.tudarmstadt.informatik.hostage.ui2.fragment.opengl.ThreatIndicatorGLRe
 import de.tudarmstadt.informatik.hostage.ui2.model.DrawerListItem;
 
 /**
+ * Manages the whole application, and should act like an singleton.
+ *
  * @author Alexander Brakowski
  * @created 12.01.14 23:24
  */
@@ -61,40 +68,61 @@ public class MainActivity extends Activity {
 	/** singleton instance of the MainActivity **/
 	private static MainActivity sInstance = null;
 
+	/**
+	 * The currently displayed fragment
+	 */
 	public Fragment mDisplayedFragment;
 
+	/**
+	 * Holds the Hostage Service
+	 */
 	public Hostage mHoneyService;
 
+	/**
+	 * Manages the navigation drawer
+	 */
 	private DrawerLayout mDrawerLayout;
 
+	/**
+	 * Contains the listview to be displayed in the navigation drawer
+	 */
 	private ListView mDrawerList;
 
+	/**
+	 * Holds the toggler for the navigation drawer in the action bar
+	 */
 	private ActionBarDrawerToggle mDrawerToggle;
 
+	/**
+	 * The text that should be displayed in the drawer toggle
+	 */
 	private CharSequence mDrawerTitle;
 
+	/**
+	 * The text that should be displayed in the action bar
+	 */
 	private CharSequence mTitle;
 
-	private MainMenuItem mSelectedMenuItem = null;
-
+	/**
+	 * Holds the list, that should be displayed in the listview of the navigation drawer
+	 */
 	private ArrayList<DrawerListItem> mDrawerItems;
 
+	/**
+	 * Hold the state of the Hostage service
+	 */
 	private boolean mServiceBound = false;
 
-	private ProfileManager mProfileManager;
-
-	private Fragment rootFragment;
-
 	/**
 	 * Connection to bind the background service
-	 * 
+	 *
 	 * @see de.tudarmstadt.informatik.hostage.Hostage
 	 */
 	private ServiceConnection mConnection = new ServiceConnection() {
 		/**
 		 * After the service is bound, check which has been clicked and start
 		 * it.
-		 * 
+		 *
 		 * @see android.content.ServiceConnection#onServiceConnected(android.content.ComponentName,
 		 *      android.os.IBinder)
 		 */
@@ -106,7 +134,7 @@ public class MainActivity extends Activity {
 
 		/**
 		 * After the service is unbound, delete reference.
-		 * 
+		 *
 		 * @see android.content.ServiceConnection#onServiceDisconnected(android.content.ComponentName)
 		 */
 		@Override
@@ -117,66 +145,103 @@ public class MainActivity extends Activity {
 
 	};
 
-	private HashMap<String, Boolean> mAttacksOnProtocol = new HashMap<String, Boolean>();
+	/**
+	 * Holds an profile manager instance
+	 */
+	private ProfileManager mProfileManager;
 
+	/**
+	 * Holds the root fragment for our hierarchical fragment navigation
+	 */
+	private Fragment rootFragment;
+
+	/**
+	 * Indicates if the warning, that the application will be closed, when pressing back again
+	 */
 	private boolean mCloseWarning = false;
 
+	/**
+	 * Hold the shared preferences for the app
+	 */
+	private SharedPreferences mSharedPreferences;
+
 	/**
 	 * Retrieve the singleton latest instance of the activity
-	 * 
+	 *
 	 * @return MainActivity - the singleton instance
 	 */
 	public static MainActivity getInstance() {
-		assert (sInstance != null);
 		return sInstance;
 	}
 
+	/**
+	 * Retrieves the context of the application
+	 *
+	 * @return the context
+	 */
 	public static Context getContext() {
 		return MainActivity.context;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onStart() {
 		super.onStart();
 
-		registerReceiver();
-
 		if (isServiceRunning()) {
 			this.bindService();
 		}
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onStop() {
 		this.unbindService();
 		super.onStop();
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 
+		// make the main activity an singleton
 		sInstance = this;
+
+		// sets the static context reference to the application context
 		MainActivity.context = getApplicationContext();
 
 		setContentView(R.layout.activity_drawer_main);
-
 		mProfileManager = ProfileManager.getInstance();
 
+		// init threat indicator animation
 		ThreatIndicatorGLRenderer.assets = getAssets();
 		ThreatIndicatorGLRenderer.setThreatLevel(ThreatIndicatorGLRenderer.ThreatLevel.NOT_MONITORING);
+
 		// set background color
 		TypedArray arr = getTheme().obtainStyledAttributes(new int[] { android.R.color.background_light });
 		ThreatIndicatorGLRenderer.setBackgroundColor(arr.getColor(0, 0xFFFFFF));
 		arr.recycle();
 
+		// configures the action bar
 		ActionBar actionBar = getActionBar();
 		actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP);
+		actionBar.setDisplayHomeAsUpEnabled(true);
+		actionBar.setHomeButtonEnabled(true);
+		actionBar.setDisplayShowHomeEnabled(true);
 
+		// sets the drawer and action title to the application title
 		mTitle = mDrawerTitle = getTitle();
 		mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
 		mDrawerList = (ListView) findViewById(R.id.left_drawer);
 
+		// propagates the navigation drawer with items
 		mDrawerItems = new ArrayList<DrawerListItem>();
 		mDrawerItems.add(new DrawerListItem(R.string.drawer_overview, R.drawable.ic_menu_home));
 		mDrawerItems.add(new DrawerListItem(R.string.drawer_threat_map, R.drawable.ic_menu_mapmode));
@@ -185,6 +250,7 @@ public class MainActivity extends Activity {
 		mDrawerItems.add(new DrawerListItem(R.string.drawer_services, R.drawable.ic_menu_set_as));
 		mDrawerItems.add(new DrawerListItem(R.string.drawer_profile_manager, R.drawable.ic_menu_allfriends));
 		mDrawerItems.add(new DrawerListItem(R.string.drawer_settings, R.drawable.ic_menu_preferences));
+		mDrawerItems.add(new DrawerListItem(R.string.drawer_help, R.drawable.ic_menu_help));
 		mDrawerItems.add(new DrawerListItem(R.string.drawer_app_info, R.drawable.ic_menu_info_details));
 
 		DrawerListAdapter listAdapter = new DrawerListAdapter(this, mDrawerItems);
@@ -192,18 +258,15 @@ public class MainActivity extends Activity {
 		mDrawerList.setAdapter(listAdapter);
 		mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
 
-		getActionBar().setDisplayHomeAsUpEnabled(true);
-		getActionBar().setHomeButtonEnabled(true);
-		getActionBar().setDisplayShowHomeEnabled(true);
-
+		// configures the navigation drawer
 		mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
-		mDrawerLayout, /* DrawerLayout object */
-		R.drawable.ic_navigation_drawer, /*
-										 * nav drawer image to replace 'Up'
-										 * caret
-										 */
-		R.string.drawer_open, /* "open drawer" description for accessibility */
-		R.string.drawer_close /* "close drawer" description for accessibility */
+			mDrawerLayout, /* DrawerLayout object */
+			R.drawable.ic_navigation_drawer, /*
+											 * nav drawer image to replace 'Up'
+											 * caret
+											 */
+			R.string.drawer_open, /* "open drawer" description for accessibility */
+			R.string.drawer_close /* "close drawer" description for accessibility */
 		) {
 			public void onDrawerClosed(View view) {
 				getActionBar().setTitle(mTitle);
@@ -217,45 +280,66 @@ public class MainActivity extends Activity {
 											// onPrepareOptionsMenu()
 			}
 		};
+
 		mDrawerLayout.setDrawerListener(mDrawerToggle);
 
+		// start the hostage service
 		startAndBind();
 
-		if (savedInstanceState == null) {
-			// on first time display view for first nav item
-			displayView(0);
-		}
-	}
+		mSharedPreferences = getSharedPreferences(getString(R.string.shared_preference_path), Hostage.MODE_PRIVATE);
 
-	private void registerReceiver() {
-		LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, new IntentFilter(getString(R.string.broadcast)));
-	}
+		if(mSharedPreferences.getBoolean("isFirstRun", true)){
 
-	private void unregisterReceiver() {
-		LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver);
-	}
+			// opens navigation drawer if first run
+			mDrawerLayout.postDelayed(new Runnable() {
+				@Override
+				public void run() {
+					mDrawerLayout.openDrawer(Gravity.LEFT);
+				}
+			}, 1000);
 
-	private BroadcastReceiver mReceiver = new BroadcastReceiver() {
-		@Override
-		public void onReceive(Context context, Intent intent) {
-			Bundle extras = intent.getExtras();
+			onFirstRun();
+		}
 
-			String sender = extras.getString("SENDER");
-			String[] values = extras.getStringArray("VALUES");
 
-			if (sender.equals(Hostage.class.getName()) && values[0].equals(getString(R.string.broadcast_started))) {
-				mAttacksOnProtocol.put(values[1], true);
-			}
+		if (savedInstanceState == null) {
+			// on first time display view for first nav item
+			displayView(0);
 		}
-	};
-
-	public boolean hasProtocolAttacks(String protocol) {
-		if (!mAttacksOnProtocol.containsKey(protocol))
-			return false;
+	}
 
-		return mAttacksOnProtocol.get(protocol);
+	/**
+	 * Displays the disclaimer on first run of the application
+	 */
+	private void onFirstRun(){
+		AlertDialog.Builder builder = new AlertDialog.Builder(this);
+		builder.setMessage(Html.fromHtml(getString(R.string.hostage_disclaimer)))
+				.setCancelable(false)
+				.setPositiveButton(getString(R.string.agree), new DialogInterface.OnClickListener() {
+					public void onClick(DialogInterface dialog, int id) {
+						// and, if the user accept, you can execute something like this:
+						// We need an Editor object to make preference changes.
+						// All objects are from android.context.Context
+						SharedPreferences.Editor editor = mSharedPreferences.edit();
+						editor.putBoolean("isFirstRun", false);
+						// Commit the edits!
+						editor.commit();
+					}
+				})
+				.setNegativeButton(getString(R.string.disagree), new DialogInterface.OnClickListener() {
+					public void onClick(DialogInterface dialog, int id) {
+						getHostageService().stopListeners();
+						stopAndUnbind();
+						finish();
+					}
+				});
+		AlertDialog alert = builder.create();
+		alert.show();
 	}
 
+	/**
+	 * Starts the hostage service and binds this activity to the service
+	 */
 	public void startAndBind() {
 		if (!isServiceRunning()) {
 			startService(getServiceIntent());
@@ -264,6 +348,9 @@ public class MainActivity extends Activity {
 		bindService();
 	}
 
+	/**
+	 * Stops the hostage service and unbinds from the service
+	 */
 	public void stopAndUnbind() {
 		if (mHoneyService != null) {
 			unbindService();
@@ -272,6 +359,9 @@ public class MainActivity extends Activity {
 		stopService(getServiceIntent());
 	}
 
+	/**
+	 * Unbindes the activity from the service
+	 */
 	public void unbindService() {
 		try {
 			unbindService(mConnection);
@@ -280,17 +370,20 @@ public class MainActivity extends Activity {
 		}
 	}
 
+	/**
+	 * Binds the activity to the service
+	 */
 	public void bindService() {
-		mAttacksOnProtocol.clear();
 		bindService(getServiceIntent(), mConnection, BIND_AUTO_CREATE);
 		// mServiceBound = true;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	protected void onDestroy() {
 		super.onDestroy();
-		// Unregister Broadcast Receiver
-		unregisterReceiver();
 
 		// Unbind running service
 		if (!mHoneyService.hasRunningListeners()) {
@@ -298,22 +391,9 @@ public class MainActivity extends Activity {
 		}
 	}
 
-	@Override
-	protected void onResume() {
-		super.onResume();
-
-		String action = getIntent().getAction();
-
-		if (action != null && action.equals("SHOW_HOME")) {
-			/*if (this.mDisplayedFragment != null && !this.mDisplayedFragment.getClass().equals(HomeFragment.class)) {
-				getFragmentManager().popBackStackImmediate(HomeFragment.class.getName(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
-				displayView(MainMenuItem.HOME.getValue());
-
-				getIntent().setAction(null);
-			}*/
-		}
-	}
-
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public boolean onOptionsItemSelected(MenuItem item) {
 		// toggle nav drawer on selecting action bar app icon/title
@@ -330,6 +410,9 @@ public class MainActivity extends Activity {
 		return super.onOptionsItemSelected(item);
 	}
 
+	/**
+	 * Navigates up to the parent fragment of the current fragment
+	 */
 	public void navigateBack(){
 		if (!(this.mDisplayedFragment instanceof UpNavigatibleFragment)) {
 			mDrawerToggle.setDrawerIndicatorEnabled(true);
@@ -349,6 +432,9 @@ public class MainActivity extends Activity {
 		}
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void setTitle(CharSequence title) {
 		mTitle = title;
@@ -359,7 +445,6 @@ public class MainActivity extends Activity {
 	 * When using the ActionBarDrawerToggle, you must call it during
 	 * onPostCreate() and onConfigurationChanged()...
 	 */
-
 	@Override
 	protected void onPostCreate(Bundle savedInstanceState) {
 		super.onPostCreate(savedInstanceState);
@@ -367,6 +452,9 @@ public class MainActivity extends Activity {
 		mDrawerToggle.syncState();
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onConfigurationChanged(Configuration newConfig) {
 		super.onConfigurationChanged(newConfig);
@@ -374,22 +462,29 @@ public class MainActivity extends Activity {
 		mDrawerToggle.onConfigurationChanged(newConfig);
 	}
 
-	public Fragment getCurrentFragment() {
-		return this.mDisplayedFragment;
-	}
-
-	public void setDrawerIndicatorEnabled(boolean val) {
-		mDrawerToggle.setDrawerIndicatorEnabled(val);
-	}
-
+	/**
+	 * Displays the view for the given navigation index
+	 *
+	 * @param position the index of the navigation item
+	 */
 	public void displayView(int position) {
 		MainMenuItem menuItemPosition = MainMenuItem.create(position);
 
+		// close the drawer if the to be displayed fragment is already being displayed
 		if (this.mDisplayedFragment != null && this.mDisplayedFragment.getClass() == menuItemPosition.getKlass()) {
 			mDrawerLayout.closeDrawer(mDrawerList);
 			return;
 		}
 
+		// open help video list when pressing help navigation item
+		if(menuItemPosition == MainMenuItem.HELP){
+			Intent intent = new Intent(Intent.ACTION_VIEW);
+			intent.setData(Uri.parse("https://www.youtube.com/playlist?list=PLJyUmtMldh3s1XtRfE4YFaQ8ME7xjf7Gx"));
+			startActivity(intent);
+
+			return;
+		}
+
 		Fragment fragment = null;
 
 		try {
@@ -405,15 +500,7 @@ public class MainActivity extends Activity {
 				rootFragment = fragment;
 			}
 
-			boolean isFirst = getFragmentManager().getBackStackEntryCount() == 0;
-
-			//getFragmentManager().popBackStackImmediate(HomeFragment.class.getName(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
-			// update selected item and title, then close the drawer if needed
-			//if(!(fragment instanceof HomeFragment) || isFirst) {
-				injectFragment(fragment);// , false, menuItemPosition);
-			//} else {
-			//	injectFragment(rootFragment);
-			//}
+			injectFragment(fragment);
 
 			mDrawerList.setItemChecked(position, true);
 			mDrawerList.setSelection(position);
@@ -423,14 +510,15 @@ public class MainActivity extends Activity {
 		mDrawerLayout.closeDrawer(mDrawerList);
 	}
 
-	public void injectFragment(Fragment fragment, boolean enableBack) {
-		injectFragment(fragment);
-	}
-
+	/**
+	 * Injects an given fragment into the application content view
+	 *
+	 * @param fragment the fragment to inject
+	 */
 	public void injectFragment(Fragment fragment) {
 		this.mCloseWarning = false;
 
-		// set orientation fixed to portrait in home fragment
+		// set the action bar up navigation according to the nature of the given fragment
 		if (fragment instanceof UpNavigatibleFragment) {
 			UpNavigatibleFragment upFrag = (UpNavigatibleFragment) fragment;
 			if (upFrag.getUpFragment() == null) {
@@ -443,6 +531,7 @@ public class MainActivity extends Activity {
 
 		configureFragment(fragment);
 
+		// exchange the existing fragment with the given one
 		FragmentManager fragmentManager = getFragmentManager();
 		FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
 		fragmentTransaction.replace(R.id.content_frame, fragment, fragment.getClass().getName());
@@ -454,10 +543,16 @@ public class MainActivity extends Activity {
 		this.mDisplayedFragment = fragment;
 	}
 
+
 	private void configureFragment() {
 		configureFragment(this.mDisplayedFragment);
 	}
 
+	/**
+	 * Configures the given fragment, e.g. fixing the screen orientation
+	 *
+	 * @param fragment the fragment to configure
+	 */
 	private void configureFragment(Fragment fragment) {
 		if (fragment == null)
 			return;
@@ -475,6 +570,9 @@ public class MainActivity extends Activity {
 		}
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onBackPressed() {
 		if (mDisplayedFragment instanceof HomeFragment) {
@@ -502,6 +600,9 @@ public class MainActivity extends Activity {
 		}
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public boolean onKeyDown(int keycode, KeyEvent e) {
 		switch (keycode) {
@@ -519,22 +620,46 @@ public class MainActivity extends Activity {
 		return super.onKeyDown(keycode, e);
 	}
 
+	/**
+	 * Create a new intent intented for binding the hostage service to the activity
+	 *
+	 * @return the new service intent
+	 */
 	public Intent getServiceIntent() {
 		return new Intent(this, Hostage.class);
 	}
 
+	/**
+	 * Retrieves the currently displayed fragment
+	 *
+	 * @return the current fragment
+	 */
 	public Fragment getDisplayedFragment() {
 		return this.mDisplayedFragment;
 	}
 
+	/**
+	 * Retrieves the Hostage service instance
+	 * @return hostage service
+	 */
 	public Hostage getHostageService() {
 		return this.mHoneyService;
 	}
 
+	/**
+	 * Checks if the hostage service is bound to the activity
+	 * @return true,  if bound
+	 *         false, otherwise
+	 */
 	public boolean isServiceBound() {
 		return this.mServiceBound;
 	}
 
+	/**
+	 * Checks whether the hostage service is running
+	 * @return true,  if running
+	 *         false, otherwise
+	 */
 	public boolean isServiceRunning() {
 		ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
 		for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
@@ -545,8 +670,14 @@ public class MainActivity extends Activity {
 		return false;
 	}
 
+	/**
+	 * Start the monitoring of the given protocols in the hostage service
+	 *
+	 * @param protocols the protocols to start
+	 */
 	public void startMonitorServices(List<String> protocols){
 		for(String protocol: protocols){
+			// if the given protocol is ghost start a listener for every defined port for ghost
 			if(protocol.equals("GHOST")){
 				if(mProfileManager.getCurrentActivatedProfile() != null){
 					Profile profile = mProfileManager.getCurrentActivatedProfile();
@@ -562,6 +693,9 @@ public class MainActivity extends Activity {
 		}
 	}
 
+	/**
+	 * Holds the index of the navigation items in an enum and also a reference to an Fragment class for each item
+	 */
 	public enum MainMenuItem {
 		HOME(0, HomeFragment.class),
 		THREAT_MAP(1, ThreatMapFragment.class),
@@ -570,7 +704,8 @@ public class MainActivity extends Activity {
 		SERVICES(4, ServicesFragment.class),
 		PROFILE_MANAGER(5, ProfileManagerFragment.class),
 		SETTINGS(6, SettingsFragment.class),
-		APPLICATION_INFO(7, AboutFragment.class);
+		HELP(7, Class.class),
+		APPLICATION_INFO(8, AboutFragment.class);
 
 		private int value;
 		private Class<?> klass;
@@ -603,6 +738,9 @@ public class MainActivity extends Activity {
 		}
 	}
 
+	/**
+	 * The listener for the navigation drawer items.
+	 */
 	private class DrawerItemClickListener implements ListView.OnItemClickListener {
 		public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
 			displayView(position);

+ 7 - 0
src/de/tudarmstadt/informatik/hostage/ui2/activity/ProfileEditActivity.java

@@ -14,18 +14,25 @@ import android.provider.MediaStore;
 import de.tudarmstadt.informatik.hostage.ui2.fragment.ProfileEditFragment;
 
 /**
+ * This activity manages an fragment for editing and creating a profile
+ *
  * @author Alexander Brakowski
  * @created 08.02.14 23:36
  */
 public class ProfileEditActivity extends PreferenceActivity {
 	ProfileEditFragment editFragment;
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onCreate(Bundle savedInstanceState){
 		super.onCreate(savedInstanceState);
 
+		// initializes the profile edit fragment
 		editFragment = new ProfileEditFragment();
 
+		// injects the fragment into the view
 		getFragmentManager().beginTransaction()
 				.replace(android.R.id.content, editFragment)
 				.commit();

+ 19 - 0
src/de/tudarmstadt/informatik/hostage/ui2/adapter/DrawerListAdapter.java

@@ -14,19 +14,38 @@ import de.tudarmstadt.informatik.hostage.R;
 import de.tudarmstadt.informatik.hostage.ui2.model.DrawerListItem;
 
 /**
+ * Creates the item view for the navigation drawer listview
+ *
  * @author Alexander Brakowski
  * @created 13.01.14 16:35
  */
 public class DrawerListAdapter extends ArrayAdapter<DrawerListItem> {
+
+	/**
+	 * The context the adapter needs to retrieve resources
+	 */
     private final Context mContext;
+
+	/**
+	 * The list items
+	 */
     private final List<DrawerListItem> mValues;
 
+	/**
+	 * Create the list adapter
+	 *
+	 * @param context the context needed for resource retieval
+	 * @param objects all the items that should be displayed in the list
+	 */
     public DrawerListAdapter(Context context, List<DrawerListItem> objects) {
         super(context, R.layout.drawer_list_item, objects);
         this.mContext = context;
         this.mValues  = objects;
     }
 
+	/**
+	 * {@inheritDoc}
+	 */
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
         LayoutInflater inflater = (LayoutInflater) mContext

+ 87 - 57
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ProfileManagerListAdapter.java

@@ -28,43 +28,71 @@ import de.tudarmstadt.informatik.hostage.ui2.layouts.FlowLayout;
 import de.tudarmstadt.informatik.hostage.ui2.swipelist.SwipeListView;
 
 /**
+ * This adapter creates the item views for the profile manager by making use the viewholder pattern
+ *
  * @author Alexander Brakowski
  * @created 14.01.14 18:00
  */
 public class ProfileManagerListAdapter extends ArrayAdapter<Profile> {
+
+	/**
+	 * Holds our views, to reduce the number of view lookups immensly
+	 */
 	private class ViewHolder {
-		public TextView labelView;
-		public TextView textView;
-		public ImageView imageSelected;
-		public ImageView itemIcon;
-		public ImageButton buttonEdit;
-		public ImageButton buttonDelete;
-		public View seperator;
-		public FlowLayout badgesContainer;
+		public TextView mLabelView;
+		public TextView mTextView;
+		public ImageView mImageSelected;
+		public ImageView mItemIcon;
+		public ImageButton mButtonEdit;
+		public ImageButton mButtonDelete;
+		public View mSeperator;
+		public FlowLayout mBadgesContainer;
 	}
 
-    private final Context context;
-    private final List<Profile> values;
-	private SwipeListView list;
-
+	/**
+	 * The context nedded for resource lookups
+	 */
+    private final Context mContext;
+
+	/**
+	 * The profiles to display in the list
+	 */
+    private final List<Profile> mValues;
+
+	/**
+	 * A reference to the list view itself
+	 */
+	private SwipeListView mList;
+
+	/**
+	 * A simple constructor to propagate this object with neccessary references to needed objects
+	 *
+	 * @param context needed for resource lookups
+	 * @param objects the profiles to display
+	 * @param list a reference to the list view
+	 */
     public ProfileManagerListAdapter(Context context, List<Profile> objects, SwipeListView list) {
         super(context, R.layout.profile_manager_list_item, objects);
-        this.context = context;
-        this.values  = objects;
-	    this.list    = list;
+        this.mContext = context;
+        this.mValues = objects;
+	    this.mList = list;
     }
 
 
+	/**
+	 * {@inheritDoc}
+	 */
     @Override
     public View getView(final int position, View convertView, ViewGroup parent) {
-	    LayoutInflater inflater = (LayoutInflater) context
+	    LayoutInflater inflater = (LayoutInflater) mContext
 			    .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
         View rowView = convertView;
 	    ViewHolder holder = null;
 
-	    final Profile item = values.get(position);
+	    final Profile item = mValues.get(position);
 
+	    // if the current item has the show tooltip flag set, render this item as an tooltip view
 	    if(item.mShowTooltip){
 		    rowView = inflater.inflate(R.layout.profile_manager_list_item_help, parent, false);
 		    rowView.findViewById(R.id.profile_manager_help_dismiss).setOnClickListener(new View.OnClickListener() {
@@ -72,59 +100,66 @@ public class ProfileManagerListAdapter extends ArrayAdapter<Profile> {
 			    public void onClick(View v) {
 				    ProfileManagerListAdapter.this.remove(item);
 				    ProfileManagerListAdapter.this.notifyDataSetChanged();
-				    list.dismiss(position);
+				    mList.dismiss(position);
 
+				    // just show the tooltip as long as it was not dismissed
 				    MainActivity.getContext().getSharedPreferences(
 						    MainActivity.getContext().getString(R.string.shared_preference_path), Hostage.MODE_PRIVATE
 				    ).edit().putBoolean("dismissedProfileSwipeHelp", true).commit();
 			    }
 		    });
 	    } else {
+		    // put our views into an view holder, if it is new
 		    if (rowView == null || rowView.getTag() == null) {
 			    rowView = inflater.inflate(R.layout.profile_manager_list_item, parent, false);
 
 			    holder = new ViewHolder();
-			    holder.labelView = (TextView) rowView.findViewById(R.id.profile_manager_item_label);
-			    holder.textView = (TextView) rowView.findViewById(R.id.profile_manager_item_text);
-			    holder.imageSelected = (ImageView) rowView.findViewById(R.id.profile_manager_item_activated);
-			    holder.itemIcon = (ImageView) rowView.findViewById(R.id.profile_manager_item_image);
-			    holder.buttonEdit = (ImageButton) rowView.findViewById(R.id.profile_manager_item_button_edit);
-			    holder.buttonDelete = (ImageButton) rowView.findViewById(R.id.profile_manager_item_button_delete);
-			    holder.seperator = rowView.findViewById(R.id.profile_manager_item_seperator);
-			    holder.badgesContainer = (FlowLayout) rowView.findViewById(R.id.badges_container);
+			    holder.mLabelView = (TextView) rowView.findViewById(R.id.profile_manager_item_label);
+			    holder.mTextView = (TextView) rowView.findViewById(R.id.profile_manager_item_text);
+			    holder.mImageSelected = (ImageView) rowView.findViewById(R.id.profile_manager_item_activated);
+			    holder.mItemIcon = (ImageView) rowView.findViewById(R.id.profile_manager_item_image);
+			    holder.mButtonEdit = (ImageButton) rowView.findViewById(R.id.profile_manager_item_button_edit);
+			    holder.mButtonDelete = (ImageButton) rowView.findViewById(R.id.profile_manager_item_button_delete);
+			    holder.mSeperator = rowView.findViewById(R.id.profile_manager_item_seperator);
+			    holder.mBadgesContainer = (FlowLayout) rowView.findViewById(R.id.badges_container);
 
 			    rowView.setTag(holder);
 		    } else {
+			    // save the viewholder to the tag of the view, so we can reuse it later
 			    holder = (ViewHolder) rowView.getTag();
 		    }
 
+		    // swipe listview needs some cleanup
 		    ((SwipeListView) parent).recycle(rowView, position);
 
-		    holder.textView.setText(item.mText);
-		    holder.labelView.setText(item.mLabel);
+		    // fill the item view with the correct data
+		    holder.mTextView.setText(item.mText);
+		    holder.mLabelView.setText(item.mLabel);
 
 		    if (item.getIconBitmap() != null) {
 			    //Bitmap bitmap = Bitmap.createScaledBitmap(item.getIconBitmap(), 32, 32, true);
-			    holder.itemIcon.setImageBitmap(item.getIconBitmap());
+			    holder.mItemIcon.setImageBitmap(item.getIconBitmap());
 		    } else {
-			    holder.itemIcon.setImageBitmap(BitmapFactory.decodeResource(MainActivity.context.getResources(), R.drawable.ic_launcher));
+			    holder.mItemIcon.setImageBitmap(BitmapFactory.decodeResource(MainActivity.context.getResources(), R.drawable.ic_launcher));
 		    }
 
-		    holder.buttonEdit.setOnClickListener(new View.OnClickListener() {
+		    // open the profile edit activity, if the edit button was pressed
+		    holder.mButtonEdit.setOnClickListener(new View.OnClickListener() {
 			    @Override
 			    public void onClick(View v) {
-				    Intent intent = new Intent(context, ProfileEditActivity.class);
+				    Intent intent = new Intent(mContext, ProfileEditActivity.class);
 				    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
 				    intent.putExtra("profile_id", item.mId);
-				    //intent.putExtra("profile", item);
-				    context.startActivity(intent);
+
+				    mContext.startActivity(intent);
 			    }
 		    });
 
-		    holder.buttonDelete.setOnClickListener(new View.OnClickListener() {
+		    // delete the profile, if the delete button was pressed. But shows an confirm dialog first.
+		    holder.mButtonDelete.setOnClickListener(new View.OnClickListener() {
 			    @Override
 			    public void onClick(View v) {
-				    new AlertDialog.Builder(context)
+				    new AlertDialog.Builder(mContext)
 						    .setTitle(R.string.delete_profile)
 						    .setMessage(R.string.really_want_delete_profiel)
 						    .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@@ -139,7 +174,7 @@ public class ProfileManagerListAdapter extends ArrayAdapter<Profile> {
 
 								    profileManager.deleteProfile(item);
 								    profileManager.getProfileListAdapter().notifyDataSetChanged();
-								    list.closeOpenedItems();
+								    mList.closeOpenedItems();
 							    }
 						    })
 						    .setIcon(android.R.drawable.ic_dialog_alert)
@@ -147,7 +182,8 @@ public class ProfileManagerListAdapter extends ArrayAdapter<Profile> {
 			    }
 		    });
 
-		    holder.badgesContainer.removeAllViews();
+		    // show all the active protocols of an profile in form of badges at the bottom of an profile list item
+		    holder.mBadgesContainer.removeAllViews();
 		    boolean hasProtocols = false;
 
 		    List<String> profiles = new LinkedList<String>(item.getActiveProtocols());
@@ -158,42 +194,36 @@ public class ProfileManagerListAdapter extends ArrayAdapter<Profile> {
 
 		    for (String protocol : profiles) {
 			    hasProtocols = true;
-			    TextView textView = new TextView(new ContextThemeWrapper(context, R.style.ProfileManagerListBadge));
+			    TextView textView = new TextView(new ContextThemeWrapper(mContext, R.style.ProfileManagerListBadge));
 			    textView.setText(protocol);
-			    holder.badgesContainer.addView(textView);
+			    holder.mBadgesContainer.addView(textView);
 		    }
 
 		    if (!hasProtocols) {
-			    holder.badgesContainer.setVisibility(View.INVISIBLE);
+			    holder.mBadgesContainer.setVisibility(View.INVISIBLE);
 		    } else {
-			    holder.badgesContainer.setVisibility(View.VISIBLE);
+			    holder.mBadgesContainer.setVisibility(View.VISIBLE);
 		    }
 
-		    RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) holder.textView.getLayoutParams();
+		    // do some styling when an profile is flagged as active
+		    RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) holder.mTextView.getLayoutParams();
 
 		    if (!item.mActivated) {
 			    lp.setMargins(0, 0, 0, 0);
 
-			    holder.textView.setLayoutParams(lp);
+			    holder.mTextView.setLayoutParams(lp);
 
-			    holder.imageSelected.setVisibility(View.GONE);
+			    holder.mImageSelected.setVisibility(View.GONE);
 		    } else {
-				/*float d = context.getResources().getDisplayMetrics().density;
-				int dm = (int)(20 * d);
-
-				lp.setMargins(0,0,dm,0);
-
-				holder.textView.setLayoutParams(lp);*/
-
-			    holder.imageSelected.setVisibility(View.VISIBLE);
+			    holder.mImageSelected.setVisibility(View.VISIBLE);
 		    }
 
 		    if (!item.isEditable()) {
-			    holder.buttonDelete.setVisibility(View.GONE);
-			    holder.seperator.setVisibility(View.GONE);
+			    holder.mButtonDelete.setVisibility(View.GONE);
+			    holder.mSeperator.setVisibility(View.GONE);
 		    } else {
-			    holder.buttonDelete.setVisibility(View.VISIBLE);
-			    holder.seperator.setVisibility(View.VISIBLE);
+			    holder.mButtonDelete.setVisibility(View.VISIBLE);
+			    holder.mSeperator.setVisibility(View.VISIBLE);
 		    }
 
 	    }

+ 4 - 1
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ServicesListAdapter.java

@@ -2,6 +2,8 @@ package de.tudarmstadt.informatik.hostage.ui2.adapter;
 
 import java.util.List;
 
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -285,7 +287,8 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
      * @param holder   ViewHolder which represents the item in the View
      * @param drawable int which represents the ID of the drawable we want to display, e.g. on a present attack it should be R.drawable.services_circle_red
      */
-    private void setBackground(ViewHolder holder, int drawable) {
+	@SuppressLint("NewApi")
+	private void setBackground(ViewHolder holder, int drawable) {
         if (sdk < Build.VERSION_CODES.JELLY_BEAN) {
             holder.circle.setBackgroundDrawable(MainActivity.getInstance().getResources().getDrawable(drawable));
         } else {

+ 2 - 0
src/de/tudarmstadt/informatik/hostage/ui2/fragment/AboutFragment.java

@@ -12,6 +12,8 @@ import android.widget.TextView;
 import de.tudarmstadt.informatik.hostage.R;
 
 /**
+ * Shows informations about the developers of the app
+ *
  * Created by Fabio Arnold on 25.02.14.
  * displays credits for the app
  */

+ 102 - 14
src/de/tudarmstadt/informatik/hostage/ui2/fragment/HomeFragment.java

@@ -39,49 +39,76 @@ import de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity;
 import de.tudarmstadt.informatik.hostage.ui2.fragment.opengl.ThreatIndicatorGLRenderer;
 
 /**
+ * This fragments displays the current hostage state and attacks on the device in form of an animation and simple view components
+ *
  * @author Alexander Brakowski
  * @created 13.01.14 19:06
  */
 
 public class HomeFragment extends Fragment {
 
+	/**
+	 * View objects from the layout
+	 */
 	private Switch mHomeSwitchConnection;
-
 	private TextView mHomeTextName;
-
 	private TextView mHomeTextSecurity;
-
 	private TextView mHomeTextAttacks;
-
 	private TextView mHomeTextProfile;
-
 	private TextView mHomeTextProfileHeader;
-
 	private ImageView mHomeProfileImage;
-
 	private ImageView mHomeConnectionInfoButton;
-
 	private View mRootView;
 
+	/**
+	 * This handles all the broadcasts from the Hostage service
+	 */
 	private BroadcastReceiver mReceiver;
 
+	/**
+	 * A change listener for the monitor switch
+	 */
 	private CompoundButton.OnCheckedChangeListener mSwitchChangeListener = null;
 
+
 	private int mDefaultTextColor;
 
+	/**
+	 * A reference to the profile manager
+	 */
 	private ProfileManager mProfileManager;
 
+	/**
+	 * A shared preference that holds all the connection info of the current network connection
+	 */
 	private SharedPreferences mConnectionInfo;
 
+	/**
+	 * An Helper to access the sqllite database with all the records
+	 */
 	private HostageDBOpenHelper mDbHelper;
 
+	/**
+	 * Holds a state if the broadcast receiver is registered to the hostage service
+ 	 */
 	private boolean mReceiverRegistered;
 
-	private boolean mRestoredFromSaved = false;
-
+	/**
+	 * Holds a state if the hostage service is active
+	 */
 	private boolean isActive = false;
+
+	/**
+	 * Holds a state if the device is currently connected to a network
+	 */
 	private boolean isConnected = false;
 
+	public HomeFragment() {
+	}
+
+	/**
+	 * Looks up all the neccessary views in the layout
+	 */
 	private void assignViews() {
 		mHomeSwitchConnection = (Switch) mRootView.findViewById(R.id.home_switch_connection);
 		mHomeTextName = (TextView) mRootView.findViewById(R.id.home_text_name);
@@ -93,6 +120,9 @@ public class HomeFragment extends Fragment {
 		mHomeConnectionInfoButton = (ImageView) mRootView.findViewById(R.id.home_button_connection_info);
 	}
 
+	/**
+	 * Registers the broadcast receiver with the hostage service
+	 */
 	private void registerBroadcastReceiver() {
 		if (!mReceiverRegistered) {
 			LocalBroadcastManager.getInstance(getActivity()).registerReceiver(mReceiver, new IntentFilter(getString(R.string.broadcast)));
@@ -100,6 +130,9 @@ public class HomeFragment extends Fragment {
 		}
 	}
 
+	/**
+	 * Unregisters the broadcast receiver
+	 */
 	private void unregisterBroadcastReceiver() {
 		if (mReceiverRegistered) {
 			LocalBroadcastManager.getInstance(getActivity()).unregisterReceiver(mReceiver);
@@ -107,9 +140,12 @@ public class HomeFragment extends Fragment {
 		}
 	}
 
-	public HomeFragment() {
-	}
-
+	/**
+	 * Sets the view state to not active.
+	 * This means hiding and graying out all the informations in the view, that are not important, if the service is not active.
+	 *
+	 * @param initial indicates that the method was called on creation of view
+	 */
 	public void setStateNotActive(boolean initial) {
 		mHomeTextName.setTextColor(getResources().getColor(R.color.light_grey));
 		mHomeTextSecurity.setTextColor(getResources().getColor(R.color.light_grey));
@@ -125,14 +161,26 @@ public class HomeFragment extends Fragment {
 		isActive = false;
 	}
 
+	/**
+	 * Alias for calling setStateNotActive with the initial value being false
+	 */
 	public void setStateNotActive() {
 		setStateNotActive(false);
 	}
 
+	/**
+	 * Alias for calling setStateActive with the initial value being false
+	 */
 	public void setStateActive() {
 		setStateActive(false);
 	}
 
+	/**
+	 * Sets the state of the view to active.
+	 * That means that all the information showing the active state of the hostage service is being displayed.
+	 *
+	 * @param initial indicates that the method was called on creation of view
+	 */
 	public void setStateActive(boolean initial) {
 		mHomeTextAttacks.setVisibility(View.VISIBLE);
 		mHomeTextSecurity.setVisibility(View.VISIBLE);
@@ -149,6 +197,9 @@ public class HomeFragment extends Fragment {
 		isActive = true;
 	}
 
+	/**
+	 * Sets the state of the view to not connected by hiding information about the attacks.
+	 */
 	public void setStateNotConnected() {
 		mHomeTextSecurity.setVisibility(View.INVISIBLE);
 		mHomeTextAttacks.setVisibility(View.INVISIBLE);
@@ -161,6 +212,9 @@ public class HomeFragment extends Fragment {
 		isConnected = false;
 	}
 
+	/**
+	 * Sets the state of the view to connected by showing informations about attacks
+	 */
 	public void setStateConnected() {
 		mHomeTextProfile.setVisibility(View.VISIBLE);
 		mHomeTextProfileHeader.setVisibility(View.VISIBLE);
@@ -169,6 +223,14 @@ public class HomeFragment extends Fragment {
 		isConnected = true;
 	}
 
+	/**
+	 * Updates the view.
+	 *
+	 * That means: updating the number of attacks on the view,
+	 *             updating the threat level,
+	 *             updating the connection state,
+	 *             updating the monitoring state
+	 */
 	public void updateUI() {
 		Profile profile = mProfileManager.getCurrentActivatedProfile();
 		if (profile != null) {
@@ -176,6 +238,7 @@ public class HomeFragment extends Fragment {
 			mHomeProfileImage.setImageBitmap(profile.getIconBitmap());
 		}
 
+		// if the device is connected to an network display the network name
 		if (HelperUtils.isNetworkAvailable(getActivity())) {
 			setStateConnected();
 			String ssid = mConnectionInfo.getString(getString(R.string.connection_info_ssid), "\"\"");
@@ -188,6 +251,7 @@ public class HomeFragment extends Fragment {
 		int totalAttacks = mDbHelper.numBssidSeen(mConnectionInfo.getString(getString(R.string.connection_info_bssid), null));
 		ThreatIndicatorGLRenderer.ThreatLevel threatLevel = ThreatIndicatorGLRenderer.ThreatLevel.NOT_MONITORING;
 
+		// decides which threat level to display
 		if (MainActivity.getInstance().getHostageService() != null) {
 			if (MainActivity.getInstance().getHostageService().hasRunningListeners()) {
 				hasActiveListeners = true;
@@ -202,6 +266,7 @@ public class HomeFragment extends Fragment {
 			}
 		}
 
+		// if the monitoring is running show the information
 		if (hasActiveListeners) {
 			setStateActive(true);
 
@@ -242,6 +307,9 @@ public class HomeFragment extends Fragment {
 		}
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 		super.onCreateView(inflater, container, savedInstanceState);
@@ -278,9 +346,11 @@ public class HomeFragment extends Fragment {
 
 		mDefaultTextColor = mHomeTextName.getCurrentTextColor();
 
+		// sets state and connection initially to off
 		setStateNotActive(true);
 		setStateNotConnected();
 
+		// register the broadcast receiver
 		mReceiver = new BroadcastReceiver() {
 			@SuppressLint("NewApi")
 			@Override
@@ -293,12 +363,14 @@ public class HomeFragment extends Fragment {
 
 		updateUI();
 
+		// connects the switch listener to the switch button
 		mHomeSwitchConnection = (Switch) mRootView.findViewById(R.id.home_switch_connection);
 		mHomeSwitchConnection.setSaveEnabled(false);
 
 		if (mSwitchChangeListener == null) {
 			mSwitchChangeListener = new CompoundButton.OnCheckedChangeListener() {
 				public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+					// displays a alert dialog if no network is available
 					if (!HelperUtils.isNetworkAvailable(getActivity())) {
 						new AlertDialog.Builder(getActivity()).setTitle(R.string.information).setMessage(R.string.network_not_connected_msg)
 								.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@@ -311,10 +383,13 @@ public class HomeFragment extends Fragment {
 						setStateNotConnected();
 					} else {
 						if (isChecked) {
+
 							boolean protocolActivated = false;
 							if (ProfileManager.getInstance().getCurrentActivatedProfile() == null) {
+								// starts all services
 								MainActivity.getInstance().startMonitorServices(Arrays.asList(getResources().getStringArray(R.array.protocols)));
 							} else {
+								// starts the services that are actived in the current profile
 								ProfileManager profileManager = ProfileManager.getInstance();
 
 								if (profileManager.isRandomActive()) {
@@ -334,6 +409,7 @@ public class HomeFragment extends Fragment {
 							if (protocolActivated) {
 								setStateActive();
 							} else {
+								// no protocol was started, so show alert dialog
 								new AlertDialog.Builder(getActivity()).setTitle(R.string.information).setMessage(R.string.profile_no_services_msg)
 										.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
 											public void onClick(DialogInterface dialog, int which) {
@@ -344,6 +420,7 @@ public class HomeFragment extends Fragment {
 								setStateNotActive();
 							}
 						} else {
+							// stop hostage service and all listeners
 							if (MainActivity.getInstance().getHostageService() != null) {
 								MainActivity.getInstance().getHostageService().stopListeners();
 								MainActivity.getInstance().stopAndUnbind();
@@ -356,14 +433,16 @@ public class HomeFragment extends Fragment {
 		}
 		mHomeSwitchConnection.setOnCheckedChangeListener(mSwitchChangeListener);
 
+		// connects the profile text an click listener
 		mRootView.findViewById(R.id.home_profile_details).setOnClickListener(new View.OnClickListener() {
 			@Override
 			public void onClick(View v) {
 				Fragment fragment = new ProfileManagerFragment();
-				MainActivity.getInstance().injectFragment(fragment, false);
+				MainActivity.getInstance().injectFragment(fragment);
 			}
 		});
 
+		// connect the attacks text to an click listener
 		View.OnClickListener attackClickListener = new View.OnClickListener() {
 			@Override
 			public void onClick(View v) {
@@ -390,12 +469,18 @@ public class HomeFragment extends Fragment {
 		return mRootView;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onStop() {
 		super.onStop();
 		unregisterBroadcastReceiver();
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onStart() {
 		super.onStart();
@@ -403,6 +488,9 @@ public class HomeFragment extends Fragment {
 		updateUI();
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onDestroy() {
 		super.onDestroy();

+ 34 - 10
src/de/tudarmstadt/informatik/hostage/ui2/fragment/PreferenceHostageFrament.java

@@ -11,27 +11,37 @@ import java.util.HashMap;
 import de.tudarmstadt.informatik.hostage.R;
 
 /**
+ * Manages and creates the application preferences view
+ *
  * @author Alexander Brakowski
  * @created 02.03.14 21:03
  */
 public class PreferenceHostageFrament extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
+
+	/**
+	 * Maps an text preference to an suffix string
+	 */
 	private HashMap<String, String> mSuffixMap;
-	private String[] mTextPreferences;
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onCreate(Bundle savedInstanceState){
 		super.onCreate(savedInstanceState);
 
-		this.mTextPreferences = new String[]{
-			"pref_external_location",
-			"pref_upload_server",
-			"pref_max_connections",
-			"pref_timeout",
-			"pref_sleeptime",
-			"pref_location_time",
-			"pref_location_retries"
+		// these preferences are all text preferences
+		String[] textPreferences = new String[]{
+				"pref_external_location",
+				"pref_upload_server",
+				"pref_max_connections",
+				"pref_timeout",
+				"pref_sleeptime",
+				"pref_location_time",
+				"pref_location_retries"
 		};
 
+		// map the text preferences to suffixes
 		this.mSuffixMap = new HashMap<String, String>();
 		this.mSuffixMap.put("pref_timeout", "s");
 		this.mSuffixMap.put("pref_sleeptime", "ms");
@@ -39,11 +49,16 @@ public class PreferenceHostageFrament extends PreferenceFragment implements Shar
 
 		addPreferencesFromResource(R.xml.settings_preferences);
 
-		for(String k: this.mTextPreferences){
+		for(String k: textPreferences){
 			updatePreferenceSummary(k);
 		}
 	}
 
+	/**
+	 * Updates the summary text of the given preference
+	 *
+	 * @param key the preference key
+	 */
 	private void updatePreferenceSummary(String key){
 		Preference p = findPreference(key);
 		SharedPreferences sharedPreferences = this.getPreferenceManager().getSharedPreferences();
@@ -59,12 +74,18 @@ public class PreferenceHostageFrament extends PreferenceFragment implements Shar
 		}
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onResume() {
 		super.onResume();
 		getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onPause() {
 		getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
@@ -87,6 +108,9 @@ public class PreferenceHostageFrament extends PreferenceFragment implements Shar
 		return false;
 	}*/
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
 		updatePreferenceSummary(key);

+ 54 - 31
src/de/tudarmstadt/informatik/hostage/ui2/fragment/ProfileEditFragment.java

@@ -29,30 +29,42 @@ import de.tudarmstadt.informatik.hostage.persistence.ProfileManager;
 import de.tudarmstadt.informatik.hostage.model.Profile;
 
 /**
+ * Creates an preference screen to edit an profile
+ *
  * @author Alexander Brakowski
  * @created 08.02.14 23:39
  */
 public class ProfileEditFragment extends PreferenceFragment implements
 		SharedPreferences.OnSharedPreferenceChangeListener {
 
-	private LayoutInflater mInflater;
-	private SharedPreferences.Editor prefs;
+	/**
+	 * Holds the shared preference editor for out preference screen
+	 */
+	private SharedPreferences.Editor mPrefs;
 
-	private HashMap<String, Boolean> profileProtocols;
+	/**
+	 * A map which mirrors the state protocols in the preferencescreen
+	 */
+	private HashMap<String, Boolean> mProfileProtocols;
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onCreate(Bundle savedInstanceState){
 		getActivity().getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
 		super.onCreate(savedInstanceState);
 
-		mInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+		LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
 
-		View actionBarButtons = mInflater.inflate(R.layout.actionbar_donebar, new LinearLayout(getActivity()), false);
+		// remove default action bar and replace it with an "done"/"discard" action bar
+		View actionBarButtons = inflater.inflate(R.layout.actionbar_donebar, new LinearLayout(getActivity()), false);
 		getActivity().getActionBar().setCustomView(actionBarButtons);
 
 		View doneButton = actionBarButtons.findViewById(R.id.action_done);
 		View cancelButton = actionBarButtons.findViewById(R.id.action_cancel);
 
+		// add click listener for the save button
 		doneButton.setOnClickListener(new View.OnClickListener() {
 			@Override
 			public void onClick(View v) {
@@ -63,10 +75,12 @@ public class ProfileEditFragment extends PreferenceFragment implements
 
 				boolean createNew = false;
 
+				// no profile was given to the fragment, which means this is a new profile
 				if(profile == null){
 					profile = new Profile();
 					createNew = true;
 				} else {
+					// profile was given, if profile is not editable, clone the profile and make it editable
 					if(!profile.isEditable()){
 						profile = profile.cloneProfile();
 						profile.mEditable = true;
@@ -74,6 +88,7 @@ public class ProfileEditFragment extends PreferenceFragment implements
 					}
 				}
 
+				// update the profile object data with data from the preferences
 				profile.mLabel = prefs.getString("pref_profile_general_name", profile.mLabel);
 				profile.mIconPath = prefs.getString("pref_profile_general_image", profile.mIconPath);
 				profile.mText = prefs.getString("pref_profile_general_description", profile.mText);
@@ -84,8 +99,9 @@ public class ProfileEditFragment extends PreferenceFragment implements
 					profile.mGhostActive = false;
 				}
 
-				profile.mActiveProtocols = new HashMap<String, Boolean>(profileProtocols);
+				profile.mActiveProtocols = new HashMap<String, Boolean>(mProfileProtocols);
 
+				// persist the changes of the profile
 				if(createNew){
 					profile.mId = -1;
 					profile.mIconId = 0;
@@ -109,7 +125,7 @@ public class ProfileEditFragment extends PreferenceFragment implements
 		});
 
 		Profile profile = getProfile();
-		prefs = PreferenceManager.getDefaultSharedPreferences(getActivity()).edit();
+		mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity()).edit();
 
 		String pname = "",
 			   pimage = null,
@@ -126,14 +142,16 @@ public class ProfileEditFragment extends PreferenceFragment implements
 			pbghost = profile.mGhostActive;
 		}
 
-		prefs.putString("pref_profile_general_name", pname);
-		prefs.putString("pref_profile_general_image", pimage);
-		prefs.putString("pref_profile_general_description", pdesc);
-		prefs.putString("pref_profile_protocols_ghost_text", pghost);
-		prefs.putBoolean("pref_profile_protocols_ghost_active", pbghost);
+		// fill the preferences of the preference screen with data from the profile object
+		mPrefs.putString("pref_profile_general_name", pname);
+		mPrefs.putString("pref_profile_general_image", pimage);
+		mPrefs.putString("pref_profile_general_description", pdesc);
+		mPrefs.putString("pref_profile_protocols_ghost_text", pghost);
+		mPrefs.putBoolean("pref_profile_protocols_ghost_active", pbghost);
 
-		prefs.commit();
+		mPrefs.commit();
 
+		// create the preference view
 		addPreferencesFromResource(R.xml.profile_preferences);
 
 		Preference pref = findPreference("pref_profile_general_image");
@@ -142,11 +160,12 @@ public class ProfileEditFragment extends PreferenceFragment implements
 
 		if(profile != null){
 			pref.setIcon(profile.getIconDrawable());
-			profileProtocols = new HashMap<String, Boolean>(profile.mActiveProtocols);
+			mProfileProtocols = new HashMap<String, Boolean>(profile.mActiveProtocols);
 		} else {
-			profileProtocols = new HashMap<String, Boolean>();
+			mProfileProtocols = new HashMap<String, Boolean>();
 		}
 
+		// show an image chooser dialog when pressing the image preference
 		pref.setOnPreferenceClickListener(
 				new Preference.OnPreferenceClickListener() {
 					@Override
@@ -176,28 +195,30 @@ public class ProfileEditFragment extends PreferenceFragment implements
 		String[] protocols = getResources().getStringArray(R.array.protocols);
 		String[] protocols_summary = getResources().getStringArray(R.array.protocols_description);
 
+		// add all available protocols to the preference screen with an checkbox
 		for(int i = 0; i<protocols.length; i++){
 			if(protocols[i].equals("GHOST")) continue;
 
-			prefs.putBoolean("pref_profile_protocol_" + protocols[i], profile != null && profile.isProtocolActive(protocols[i]));
-			prefs.commit();
+			mPrefs.putBoolean("pref_profile_protocol_" + protocols[i], profile != null && profile.isProtocolActive(protocols[i]));
+			mPrefs.commit();
 
 			CheckBoxPreference check = new CheckBoxPreference(getActivity());
 			check.setTitle(protocols[i]);
 			check.setKey("pref_profile_protocol_" + protocols[i]);
 			check.setSummary(protocols_summary[i]);
-			//check.setChecked(profile != null && profile.isProtocolActive(protocols[i]));
-			//System.out.println("-----------------_> " + profile.isProtocolActive(protocols[i]) + " :: " + protocols[i]);
+
 			protocolsCategory.addPreference(check);
 		}
 	}
 
+	/**
+	 * Retrieve the given profile from the intent
+	 * @return the profile
+	 */
 	public Profile getProfile(){
 		ProfileManager pmanager = ProfileManager.getInstance();
 
 		Intent intent = getActivity().getIntent();
-		//Profile profile = (Profile) intent.getSerializableExtra("profile");
-
 		int profile_id = intent.getIntExtra("profile_id", -1);
 
 		if(profile_id != -1){
@@ -207,12 +228,18 @@ public class ProfileEditFragment extends PreferenceFragment implements
 		return null;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onResume() {
 		super.onResume();
 		getPreferenceManager().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onPause() {
 		getPreferenceManager().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
@@ -236,21 +263,19 @@ public class ProfileEditFragment extends PreferenceFragment implements
 		if(p instanceof EditTextPreference){
 			p.setSummary(sharedPreferences.getString(key, ""));
 		} else if(p instanceof CheckBoxPreference && !p.getKey().equals("pref_profile_protocols_ghost_active")){
-			profileProtocols.put(p.getTitle().toString(), ((CheckBoxPreference) p).isChecked());
+			mProfileProtocols.put(p.getTitle().toString(), ((CheckBoxPreference) p).isChecked());
 			//System.out.println("------------------------------- P: " + ((CheckBoxPreference) p).isChecked());
 		}
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) {
 		super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
 
 		if(resultCode == Activity.RESULT_OK){
-			Uri selectedImage = imageReturnedIntent.getData();
-			String[] filePathColumn = {MediaStore.Images.Media.DATA};
-
-			assert selectedImage != null;
-
 			Cursor cursor = getActivity().getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
 					new String[]{
 							MediaStore.Images.Media.DATA,
@@ -259,7 +284,6 @@ public class ProfileEditFragment extends PreferenceFragment implements
 					},
 			MediaStore.Images.Media.DATE_ADDED, null, "date_added ASC");
 
-			assert cursor != null;
 			String filePath = "";
 			if(cursor != null && cursor.moveToFirst())
 			{
@@ -275,11 +299,10 @@ public class ProfileEditFragment extends PreferenceFragment implements
 			options.inPreferredConfig = Bitmap.Config.ARGB_8888;
 			Bitmap bitmap = BitmapFactory.decodeFile(filePath, options);
 
-			assert pref != null;
 			pref.setIcon(new BitmapDrawable(getResources(), bitmap));
 
-			prefs.putString("pref_profile_general_image", filePath);
-			prefs.commit();
+			mPrefs.putString("pref_profile_general_image", filePath);
+			mPrefs.commit();
 		}
 	}
 }

+ 33 - 2
src/de/tudarmstadt/informatik/hostage/ui2/fragment/ProfileManagerFragment.java

@@ -26,25 +26,44 @@ import de.tudarmstadt.informatik.hostage.ui2.adapter.ProfileManagerListAdapter;
 import de.tudarmstadt.informatik.hostage.ui2.swipelist.SwipeListView;
 
 /**
+ * Displays a list of all available profiles and allows invocation of the edit activity for an profile
+ *
  * @author Alexander Brakowski
  * @created 14.01.14 15:05
  */
 public class ProfileManagerFragment extends Fragment {
+
+	/**
+	 * The adapter for the profile list
+	 */
 	private ProfileManagerListAdapter mAdapter;
 
+	/**
+	 * Holds the shared preferences for the app
+	 */
 	private SharedPreferences mSharedPreferences;
 
 	public ProfileManagerFragment(){}
 
+	/**
+	 * Holds the listview for the profile list
+	 */
 	private SwipeListView list;
-    @Override
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container,
                              Bundle savedInstanceState) {
 
 	    super.onCreateView(inflater, container, savedInstanceState);
 	    getActivity().setTitle(getResources().getString(R.string.drawer_profile_manager));
-	    setHasOptionsMenu(true);
 
+		// show action bar menu items
+		setHasOptionsMenu(true);
+
+		// inflate the view
         View rootView = inflater.inflate(R.layout.fragment_profile_manager, container, false);
 	    list = (SwipeListView) rootView.findViewById(R.id.profile_manager_listview);
 
@@ -56,6 +75,7 @@ public class ProfileManagerFragment extends Fragment {
 
         final List<Profile> strList = new LinkedList<Profile>(pmanager.getProfilesList());
 
+		// show an help item in the listview to indicate, that the items in the list are swipeable
 	    if(strList.size() > 0 && !mSharedPreferences.getBoolean("dismissedProfileSwipeHelp", false)){
 		    Profile tProfile = new Profile();
 		    tProfile.mShowTooltip = true;
@@ -68,6 +88,7 @@ public class ProfileManagerFragment extends Fragment {
 
         list.setAdapter(mAdapter);
 
+		// add open and close actions to the items of the list view
 		list.setSwipeListViewListener(new BaseSwipeListViewListener() {
 			@Override
 			public void onOpened(int position, boolean toRight){
@@ -83,6 +104,7 @@ public class ProfileManagerFragment extends Fragment {
 
 			@Override
 			public void onClickFrontView(int position) {
+				// active the pressed profile
 				Profile profile = mAdapter.getItem(position);
 				if(profile.mShowTooltip) return;
 
@@ -95,6 +117,9 @@ public class ProfileManagerFragment extends Fragment {
         return rootView;
     }
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onResume() {
 		super.onResume();
@@ -102,12 +127,18 @@ public class ProfileManagerFragment extends Fragment {
 		mAdapter.notifyDataSetChanged();
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
 		// Inflate the menu items for use in the action bar
 		inflater.inflate(R.menu.profile_manager_actions, menu);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	@Override
 	public boolean onOptionsItemSelected(MenuItem item) {
 		switch(item.getItemId()){

+ 86 - 71
src/de/tudarmstadt/informatik/hostage/ui2/fragment/RecordDetailFragment.java

@@ -25,56 +25,33 @@ import de.tudarmstadt.informatik.hostage.logging.MessageRecord;
 import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
 
 /**
- * Created by Julien on 02.03.14.
+ * Displays detailed informations about an record.
+ *
+ * @author Fabio Arnold
+ * @author Alexander Brakowski
+ * @author Julien Clauter
  */
 public class RecordDetailFragment extends UpNavigatibleFragment {
-	private class Location {
-		private double longitude;
-		private double latitude;
-		private float accuracy;
 
-		public double getLatitude() {
-			return latitude;
-		}
-
-		public void setLatitude(double latitude) {
-			this.latitude = latitude;
-		}
+	/**
+	 * Hold the record of which the detail informations should be shown
+	 */
+	private Record mRecord;
 
-		public float getAccuracy() {
-			return accuracy;
-		}
-
-		public void setAccuracy(float accuracy) {
-			this.accuracy = accuracy;
-		}
+	/**
+	 * The database helper to retrieve data from the database
+	 */
+	private HostageDBOpenHelper mDBOpenHelper;
 
-		public double getLongitude() {
-			return this.longitude;
-		}
-
-		public void setLongitude(double longitude) {
-			this.longitude = longitude;
-		}
-
-		public Location() {
-			super();
-		}
-
-		public Location(double latitude, double longitude, float accuracy) {
-			super();
-			this.latitude = latitude;
-			this.longitude = longitude;
-			this.accuracy = accuracy;
-		}
-	}
-
-	private Record record;
-	private HostageDBOpenHelper dbh;
-	private View rootView;
+	/**
+	 * The layout inflater
+	 */
 	private LayoutInflater mInflater;
 
-	private ScrollView mScrollView;
+	/*
+	 * References to the views in the layout
+	 */
+	private View mRootView;
 	private LinearLayout mRecordOverviewConversation;
 	private TextView mRecordDetailsTextSsid;
 	private TextView mRecordDetailsTextBssid;
@@ -82,46 +59,73 @@ public class RecordDetailFragment extends UpNavigatibleFragment {
 	private TextView mRecordDetailsTextProtocol;
 	private Button mRecordDeleteButton;
 
+	/**
+	 * Sets the record of which the details should be displayed
+	 * @param rec the record to be used
+	 */
 	public void setRecord(Record rec) {
-		this.record = rec;
+		this.mRecord = rec;
 	}
 
+	/**
+	 * Retriebes the record which is used for the display of the detail informations
+	 * @return the record
+	 */
 	public Record getRecord() {
-		return this.record;
+		return this.mRecord;
 	}
 
+	/**
+	 * Retrieves the id of the layout
+	 * @return the id of the layout
+	 */
 	public int getLayoutId() {
-		// return R.layout.fragment_record_detail;
-		return R.layout.fragment_record_overview;
+		return R.layout.fragment_record_detail;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
 	public void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 		setHasOptionsMenu(true);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 		super.onCreateView(inflater, container, savedInstanceState);
 
 		mInflater = inflater;
-		getActivity().setTitle(record.getSsid());
+		getActivity().setTitle(mRecord.getSsid());
 
-		this.dbh = new HostageDBOpenHelper(this.getActivity().getBaseContext());
+		this.mDBOpenHelper = new HostageDBOpenHelper(this.getActivity().getBaseContext());
 
-		this.rootView = inflater.inflate(this.getLayoutId(), container, false);
-		this.assignViews(rootView);
-		this.configurateRootView(rootView);
+		this.mRootView = inflater.inflate(this.getLayoutId(), container, false);
+		this.assignViews(mRootView);
+		this.configurateRootView(mRootView);
 
-		return rootView;
+		return mRootView;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
 	public void onStart() {
 		super.onStart();
 
 	}
 
+	/**
+	 * Retrieves all the views from the given view
+	 *
+	 * @param view the layout view
+	 */
 	private void assignViews(View view) {
-		mScrollView = (ScrollView) view.findViewById(R.id.scrollView);
 		mRecordOverviewConversation = (LinearLayout) view.findViewById(R.id.record_overview_conversation);
 		mRecordDetailsTextSsid = (TextView) view.findViewById(R.id.record_details_text_ssid);
 		mRecordDetailsTextBssid = (TextView) view.findViewById(R.id.record_details_text_bssid);
@@ -130,16 +134,24 @@ public class RecordDetailFragment extends UpNavigatibleFragment {
 		mRecordDeleteButton = (Button) view.findViewById(R.id.record_delete_button);
 	}
 
+
+	/**
+	 * Configures the given view and fills it with the detail information
+	 *
+	 * @param rootView the view to use to display the informations
+	 */
 	private void configurateRootView(View rootView) {
 
-		mRecordDetailsTextBssid.setText(record.getBssid());
-		mRecordDetailsTextSsid.setText(record.getSsid());
-		if (record.getRemoteIP() != null)
-			mRecordDetailsTextRemoteip.setText(record.getRemoteIP() + ":" + record.getRemotePort());
-		mRecordDetailsTextProtocol.setText(record.getProtocol());
+		mRecordDetailsTextBssid.setText(mRecord.getBssid());
+		mRecordDetailsTextSsid.setText(mRecord.getSsid());
+		if (mRecord.getRemoteIP() != null)
+			mRecordDetailsTextRemoteip.setText(mRecord.getRemoteIP() + ":" + mRecord.getRemotePort());
 
-		ArrayList<Record> conversation = this.dbh.getConversationForAttackID(record.getAttack_id());
+			mRecordDetailsTextProtocol.setText(mRecord.getProtocol());
 
+		ArrayList<Record> conversation = this.mDBOpenHelper.getConversationForAttackID(mRecord.getAttack_id());
+
+		// display the conversation of the attack
 		for (Record r : conversation) {
 			View row;
 
@@ -195,14 +207,8 @@ public class RecordDetailFragment extends UpNavigatibleFragment {
 								new DialogInterface.OnClickListener() {
 									public void onClick(DialogInterface dialog,
 											int which) {
-										dbh.deleteByAttackID(record.getAttack_id());
-
-										// TODO: just navigate back...
-										/*RecordOverviewFragment recordOverviewFragment = new RecordOverviewFragment();
-										recordOverviewFragment.setFilter(new LogFilter());
-										recordOverviewFragment.setGroupKey("Protocol");
+										mDBOpenHelper.deleteByAttackID(mRecord.getAttack_id());
 
-										MainActivity.getInstance().injectFragment(recordOverviewFragment, false);*/
 										MainActivity.getInstance().navigateBack();
 									}
 								}
@@ -217,15 +223,24 @@ public class RecordDetailFragment extends UpNavigatibleFragment {
 	 * Date Transform
 	 * 
 	 * ***************************/
+
+	/**
+	 * Converts the given data to an localized string
+	 *
+	 * @param date the date to convert
+	 * @return the converted date as an string
+	 */
 	private String getDateAsString(Date date) {
 		return DateFormat.getDateFormat(getActivity()).format(date);
 	}
 
+	/**
+	 * Converts the given date to an localized time
+	 *
+	 * @param date the date to convert
+	 * @return the converted time as an string
+	 */
 	private String getTimeAsString(Date date) {
 		return DateFormat.getTimeFormat(getActivity()).format(date);
 	}
-
-	public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
-		super.onCreateOptionsMenu(menu, inflater);
-	}
 }

+ 11 - 0
src/de/tudarmstadt/informatik/hostage/ui2/fragment/SettingsFragment.java

@@ -10,10 +10,17 @@ import de.tudarmstadt.informatik.hostage.R;
 import de.tudarmstadt.informatik.hostage.system.Device;
 
 /**
+ * Creates the view to edit the preferences of the app and shows the porthack and rooted state of the device
+ *
  * @author Alexander Brakowski
  * @created 24.02.14 23:37
  */
 public class SettingsFragment extends UpNavigatibleFragment {
+
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
 	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
 		super.onCreateView(inflater, container, savedInstanceState);
 		getActivity().setTitle(getResources().getString(R.string.drawer_settings));
@@ -41,6 +48,10 @@ public class SettingsFragment extends UpNavigatibleFragment {
 		return v;
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
 	public void onViewCreated(View view, Bundle savedInstanceState) {
 		super.onViewCreated(view, savedInstanceState);
 

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/ui2/fragment/ThreatMapFragment.java

@@ -107,7 +107,7 @@ public class ThreatMapFragment extends Fragment implements GoogleMap.OnInfoWindo
 		recordOverviewFragment.setGroupKey("ESSID");
 		recordOverviewFragment.setAllowBack(true);
 
-		MainActivity.getInstance().injectFragment(recordOverviewFragment, false);
+		MainActivity.getInstance().injectFragment(recordOverviewFragment);
 		//recordOverviewFragment.showDetailsForSSID(getActivity(), ssid);
 		//}
 	}

+ 28 - 0
src/de/tudarmstadt/informatik/hostage/ui2/fragment/UpNavigatibleFragment.java

@@ -3,27 +3,55 @@ package de.tudarmstadt.informatik.hostage.ui2.fragment;
 import android.app.Fragment;
 
 /**
+ * This abstract fragments allows the definition of an child - parent relation of fragments. It is necessary for the app to allow Up navigation of fragments.
+ *
  * @author Alexander Brakowski
  * @created 12.03.14 16:20
  */
 public abstract class UpNavigatibleFragment extends Fragment {
+	/**
+	 * Holds a reference to the parent fragment
+	 */
 	private Class<?> mUpFragment;
+
+	/**
+	 * Indicates whether the fragment is up navigatible
+	 */
 	private boolean mIsUpNavigatible = false;
 
 	private boolean mAllowBack = false;
 
+	/**
+	 * Retrieves the parent fragment to be used for up navigation
+	 * @return the parent fragment
+	 */
 	public Class<?> getUpFragment(){
 		return mUpFragment;
 	}
 
+	/**
+	 * Sets the parent fragment of this fragment.
+	 * @param upFragment the fragment to set as parent
+	 */
 	public void setUpFragment(Class<?> upFragment){
 		this.mUpFragment = upFragment;
 	}
 
+	/**
+	 * Checks whether this fragment can be navigated up
+	 *
+	 * @return true if this fragment can be up navigated,
+	 *         false otherwise
+	 */
 	public boolean isUpNavigatible(){
 		return mIsUpNavigatible;
 	}
 
+	/**
+	 * Sets the state of up navigation for this fragment
+	 * @param isUpNavigatible true to allow up navigation
+	 *                        false no up navigation
+	 */
 	public void setUpNavigatible(boolean isUpNavigatible){
 		this.mIsUpNavigatible = isUpNavigatible;
 	}

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/AnimatedMesh.java

@@ -217,7 +217,7 @@ public class AnimatedMesh {
 		// header
 		int magicNum = data.getInt();
 		int version = data.getInt();
-		assert(magicNum == ('A' << 24 | 'M' << 16 | 'S' << 8 | 'H') && version == 1);
+		//assert(magicNum == ('A' << 24 | 'M' << 16 | 'S' << 8 | 'H') && version == 1);
 		
 		vertexSize = 48;
 		vertexOffset = data.getInt();

+ 5 - 0
src/de/tudarmstadt/informatik/hostage/ui2/layouts/FlowLayout.java

@@ -16,6 +16,11 @@ import android.view.View;
 import android.view.ViewGroup;
 import de.tudarmstadt.informatik.hostage.R;
 
+/**
+ * Subviews of this View will be positioned in an "flowing" manner.
+ *
+ * See {@link https://github.com/ApmeM/android-flowlayout}
+ */
 public class FlowLayout extends ViewGroup {
 	public static final int HORIZONTAL = 0;
 	public static final int VERTICAL = 1;

+ 10 - 0
src/de/tudarmstadt/informatik/hostage/ui2/model/DrawerListItem.java

@@ -4,11 +4,21 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 /**
+ * Holds the data for an navigation item in the navigation drawer
+ *
  * @author Alexander Brakowski
  * @created 13.01.14 16:37
  */
 public class DrawerListItem {
+
+	/**
+	 * The icon of the item
+	 */
     public int icon;
+
+	/**
+	 * The text of the item
+	 */
     public int text;
 
     public DrawerListItem(int text, int icon){

+ 0 - 31
src/de/tudarmstadt/informatik/hostage/ui2/model/ProfileListItem.java

@@ -1,31 +0,0 @@
-package de.tudarmstadt.informatik.hostage.ui2.model;
-
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-
-import de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity;
-
-/**
- * @author Alexander Brakowski
- * @created 14.01.14 18:04
- */
-public class ProfileListItem {
-    public String label;
-    public String text;
-
-    public boolean activated;
-    public Bitmap icon;
-
-	public boolean isBackVisible = false;
-
-    public ProfileListItem(String text, String label, Bitmap icon){
-        this.text = text;
-        this.label = label;
-        this.activated = false;
-        this.icon = icon;
-    }
-
-    public ProfileListItem(String text, String label, int icon){
-        this(text, label, BitmapFactory.decodeResource(MainActivity.context.getResources(), icon));
-    }
-}

+ 16 - 1
src/de/tudarmstadt/informatik/hostage/ui2/swipelist/SwipeListView.java

@@ -4,30 +4,45 @@ import android.content.Context;
 import android.util.AttributeSet;
 
 /**
+ * Extends the SwipeListView with an mechanism to allow to open only one item at the same time.
+ *
  * @author Alexander Brakowski
  * @created 28.02.14 22:05
  */
 public class SwipeListView extends com.fortysevendeg.android.swipelistview.SwipeListView {
 
-
+	/**
+	 * {@inheritDoc}
+	 */
 	public SwipeListView(Context context, int swipeBackView, int swipeFrontView) {
 		super(context, swipeBackView, swipeFrontView);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public SwipeListView(Context context, AttributeSet attrs) {
 		super(context, attrs);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
 	public SwipeListView(Context context, AttributeSet attrs, int defStyle) {
 		super(context, attrs, defStyle);
 	}
 
+	/**
+	 * {@inheritDoc}
+	 */
+	@Override
 	protected void onOpened(int position, boolean toRight) {
 		super.onOpened(position, toRight);
 
 		int start = getFirstVisiblePosition();
 		int end = getLastVisiblePosition();
 
+		// close all visible items other then the current one
 		for(int i=start; i<=end; i++){
 			if(i != position){
 				closeAnimate(i);