Browse Source

merge zum 1.

Mihai Plasoianu 10 years ago
parent
commit
b54c5f64e2
100 changed files with 101 additions and 20 deletions
  1. 8 1
      .gitignore
  2. 0 4
      .settings/org.eclipse.m2e.core.prefs
  3. 35 15
      AndroidManifest.xml
  4. 10 0
      TODO
  5. BIN
      assets/meshes/android.amh
  6. BIN
      assets/meshes/bee.amh
  7. BIN
      assets/meshes/mario.amh
  8. 16 0
      assets/shaders/skinned.frag
  9. 25 0
      assets/shaders/skinned.vert
  10. BIN
      assets/textures/android-tex.png
  11. BIN
      assets/textures/bee-tex.png
  12. BIN
      libs/nineoldandroids-2.4.0.jar
  13. BIN
      libs/swipelistview-1.0.jar
  14. 4 0
      project.properties
  15. BIN
      res/drawable-hdpi/ic_action_accept.png
  16. BIN
      res/drawable-hdpi/ic_action_cancel.png
  17. BIN
      res/drawable-hdpi/ic_action_done.png
  18. BIN
      res/drawable-hdpi/ic_action_new.png
  19. BIN
      res/drawable-hdpi/ic_action_stats.png
  20. BIN
      res/drawable-hdpi/ic_device_access_storage.png
  21. BIN
      res/drawable-hdpi/ic_discard.png
  22. BIN
      res/drawable-hdpi/ic_edit.png
  23. BIN
      res/drawable-hdpi/ic_filter.png
  24. BIN
      res/drawable-hdpi/ic_launcher.png
  25. BIN
      res/drawable-hdpi/ic_menu_allfriends.png
  26. BIN
      res/drawable-hdpi/ic_menu_gallery.png
  27. BIN
      res/drawable-hdpi/ic_menu_home.png
  28. BIN
      res/drawable-hdpi/ic_menu_info_details.png
  29. BIN
      res/drawable-hdpi/ic_menu_mapmode.png
  30. BIN
      res/drawable-hdpi/ic_menu_preferences.png
  31. BIN
      res/drawable-hdpi/ic_menu_records.png
  32. BIN
      res/drawable-hdpi/ic_menu_set_as.png
  33. BIN
      res/drawable-hdpi/ic_menu_stats.png
  34. BIN
      res/drawable-hdpi/ic_navigation_drawer.png
  35. BIN
      res/drawable-hdpi/ic_profile_vista.png
  36. BIN
      res/drawable-hdpi/ic_profile_w7.png
  37. BIN
      res/drawable-hdpi/ic_service_green.png
  38. BIN
      res/drawable-hdpi/ic_service_red.png
  39. BIN
      res/drawable-hdpi/ic_service_yellow.png
  40. BIN
      res/drawable-hdpi/ic_sort_by_size.png
  41. BIN
      res/drawable-hdpi/rd_btn_off.png
  42. BIN
      res/drawable-hdpi/rd_btn_on.png
  43. BIN
      res/drawable-mdpi/ic_action_accept.png
  44. BIN
      res/drawable-mdpi/ic_action_cancel.png
  45. BIN
      res/drawable-mdpi/ic_action_done.png
  46. BIN
      res/drawable-mdpi/ic_action_new.png
  47. BIN
      res/drawable-mdpi/ic_action_stats.png
  48. BIN
      res/drawable-mdpi/ic_device_access_storage.png
  49. BIN
      res/drawable-mdpi/ic_discard.png
  50. BIN
      res/drawable-mdpi/ic_edit.png
  51. BIN
      res/drawable-mdpi/ic_launcher.png
  52. BIN
      res/drawable-mdpi/ic_menu_allfriends.png
  53. BIN
      res/drawable-mdpi/ic_menu_gallery.png
  54. BIN
      res/drawable-mdpi/ic_menu_home.png
  55. BIN
      res/drawable-mdpi/ic_menu_info_details.png
  56. BIN
      res/drawable-mdpi/ic_menu_mapmode.png
  57. BIN
      res/drawable-mdpi/ic_menu_preferences.png
  58. BIN
      res/drawable-mdpi/ic_menu_records.png
  59. BIN
      res/drawable-mdpi/ic_menu_set_as.png
  60. BIN
      res/drawable-mdpi/ic_menu_stats.png
  61. BIN
      res/drawable-mdpi/ic_navigation_drawer.png
  62. BIN
      res/drawable-mdpi/ic_profile_vista.png
  63. BIN
      res/drawable-mdpi/ic_profile_w7.png
  64. BIN
      res/drawable-mdpi/ic_service_green.png
  65. BIN
      res/drawable-mdpi/ic_service_red.png
  66. BIN
      res/drawable-mdpi/ic_service_yellow.png
  67. BIN
      res/drawable-mdpi/rd_btn_off.png
  68. BIN
      res/drawable-mdpi/rd_btn_on.png
  69. BIN
      res/drawable-xhdpi/ic_action_accept.png
  70. BIN
      res/drawable-xhdpi/ic_action_cancel.png
  71. BIN
      res/drawable-xhdpi/ic_action_done.png
  72. BIN
      res/drawable-xhdpi/ic_action_new.png
  73. BIN
      res/drawable-xhdpi/ic_action_stats.png
  74. BIN
      res/drawable-xhdpi/ic_device_access_storage.png
  75. BIN
      res/drawable-xhdpi/ic_discard.png
  76. BIN
      res/drawable-xhdpi/ic_edit.png
  77. BIN
      res/drawable-xhdpi/ic_launcher.png
  78. BIN
      res/drawable-xhdpi/ic_menu_allfriends.png
  79. BIN
      res/drawable-xhdpi/ic_menu_gallery.png
  80. BIN
      res/drawable-xhdpi/ic_menu_home.png
  81. BIN
      res/drawable-xhdpi/ic_menu_info_details.png
  82. BIN
      res/drawable-xhdpi/ic_menu_mapmode.png
  83. BIN
      res/drawable-xhdpi/ic_menu_preferences.png
  84. BIN
      res/drawable-xhdpi/ic_menu_records.png
  85. BIN
      res/drawable-xhdpi/ic_menu_set_as.png
  86. BIN
      res/drawable-xhdpi/ic_navigation_drawer.png
  87. BIN
      res/drawable-xhdpi/ic_profile_vista.png
  88. BIN
      res/drawable-xhdpi/ic_profile_w7.png
  89. BIN
      res/drawable-xhdpi/ic_service_green.png
  90. BIN
      res/drawable-xhdpi/ic_service_red.png
  91. BIN
      res/drawable-xhdpi/ic_service_yellow.png
  92. 3 0
      res/drawable-xhdpi/popup_background.xml
  93. BIN
      res/drawable-xhdpi/popup_black.9.png
  94. BIN
      res/drawable-xhdpi/rd_btn_off.png
  95. BIN
      res/drawable-xhdpi/rd_btn_on.png
  96. BIN
      res/drawable-xxhdpi/ic_action_cancel.png
  97. BIN
      res/drawable-xxhdpi/ic_action_stats.png
  98. BIN
      res/drawable-xxhdpi/ic_device_access_storage.png
  99. BIN
      res/drawable-xxhdpi/ic_launcher.png
  100. BIN
      res/drawable-xxhdpi/ic_menu_allfriends.png

+ 8 - 1
.gitignore

@@ -23,4 +23,11 @@ proguard/
 *.ipr
 *.iws
 .idea/
-/native
+
+# Ignore some folders
+target/
+build/
+.gradle/
+gen-external-apklibs/
+native/build
+native/build.o

+ 0 - 4
.settings/org.eclipse.m2e.core.prefs

@@ -1,4 +0,0 @@
-activeProfiles=
-eclipse.preferences.version=1
-resolveWorkspaceProjects=true
-version=1

+ 35 - 15
AndroidManifest.xml

@@ -5,7 +5,7 @@
     android:versionName="1.0" >
 
     <uses-sdk
-        android:minSdkVersion="8"
+        android:minSdkVersion="14"
         android:targetSdkVersion="19" />
 
     <uses-permission android:name="android.permission.VIBRATE" />
@@ -13,10 +13,9 @@
     <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-feature
         android:name="android.hardware.nfc"
@@ -24,19 +23,36 @@
 
     <application
         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:theme="@style/AppTheme"
+        android:vmSafeMode="true" >
+        <meta-data
+            android:name="com.google.android.gms.version"
+            android:value="@integer/google_play_services_version" />
+        <meta-data
+            android:name="com.google.android.maps.v2.API_KEY"
+            android:value="AIzaSyCqh4bb4aMzvDcpDfiqHyXoAWFTQ6iNxe8" />
+
         <activity
-            android:name="de.tudarmstadt.informatik.hostage.ui.MainActivity"
+            android:name="de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity"
             android:configChanges="keyboardHidden|orientation|screenSize"
-            android:label="@string/app_name" >
+            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="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" >
@@ -45,6 +61,10 @@
             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" >
@@ -58,14 +78,14 @@
             android:label="@string/gui_playground" >
         </activity>
         <activity
-            android:name="de.tudarmstadt.informatik.hostage.sync.BluetoothSync" 
-            android:theme="@android:style/Theme.Dialog"
-            android:label="@string/gui_bluetooth">
+            android:name="de.tudarmstadt.informatik.hostage.sync.BluetoothSync"
+            android:label="@string/gui_bluetooth"
+            android:theme="@android:style/Theme.Dialog" >
         </activity>
         <activity
             android:name="de.tudarmstadt.informatik.hostage.sync.NFCSync"
-            android:theme="@android:style/Theme.Dialog"
-            android:label="@string/gui_nfc" >
+            android:label="@string/gui_nfc"
+            android:theme="@android:style/Theme.Dialog" >
             <intent-filter>
                 <action android:name="android.nfc.action.NDEF_DISCOVERED" />
 
@@ -75,7 +95,9 @@
             </intent-filter>
         </activity>
 
-        <service android:name="de.tudarmstadt.informatik.hostage.Hostage" >
+        <service
+            android:name="de.tudarmstadt.informatik.hostage.Hostage"
+            android:exported="false" >
         </service>
         <service
             android:name="de.tudarmstadt.informatik.hostage.logging.Logger"
@@ -87,8 +109,6 @@
             android:authorities="de.tudarmstadt.informatik.hostage.provider"
             android:exported="false" >
         </provider>
-        
-
     </application>
 
 </manifest>

+ 10 - 0
TODO

@@ -0,0 +1,10 @@
+√ [Overview]    Greeting animation only to show on application start, not on every fragment creation/recreating
+! [Overview]	Don’t play „no threat“ animation first before playing actual animation (quickly tell ThreatIndicator the threat state)
+! [Statistics]  Switch to records view on record click
+! [Back Button] * Fix scenario: Home View -> Threat Map -> Back Button -> Threat Map
+                * Fix scenario: Home View -> Connection details -> Records -> Back Button
+! [Record Overview] Display a message when there are no records (because of filtering)
+! [Overview]	Correct icon for active profile
+! [Profile Manager] Use new icon for assorted profiles
+! [Honey Service] Use nicer icon
+! [Statistics]  Numbers shouldn't be float numbers

BIN
assets/meshes/android.amh


BIN
assets/meshes/bee.amh


BIN
assets/meshes/mario.amh


+ 16 - 0
assets/shaders/skinned.frag

@@ -0,0 +1,16 @@
+precision mediump float;
+
+uniform vec4 color;
+uniform sampler2D texture;
+
+varying vec3 vertexNormal;
+varying vec2 vertexTexCoord;
+
+void main() {
+	vec3 normal = normalize(vertexNormal);
+	float lambert = max(0.0, -normal.z);
+	float rim = 1.0 - lambert;
+	rim *= rim * rim;
+	vec4 texColor = texture2D(texture, vertexTexCoord);
+	gl_FragColor = rim + (0.4 + 0.4 * lambert) * texColor * color;
+}

+ 25 - 0
assets/shaders/skinned.vert

@@ -0,0 +1,25 @@
+uniform mat4 mvp;
+uniform mat4 boneMatrices[16];
+
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texCoord;
+
+attribute vec4 boneIndices; // should be ivec4
+attribute vec3 boneWeights;
+
+varying vec3 vertexNormal;
+varying vec2 vertexTexCoord;
+
+void main() {
+	float fourthBoneWeight = 1.0 - boneWeights[0] - boneWeights[1] - boneWeights[2];
+
+	mat4 boneMatrix = boneWeights[0] * boneMatrices[int(boneIndices.x)];
+	boneMatrix += boneWeights[1] * boneMatrices[int(boneIndices.y)];
+	boneMatrix += boneWeights[2] * boneMatrices[int(boneIndices.z)];
+	boneMatrix += fourthBoneWeight * boneMatrices[int(boneIndices.w)];
+
+	vertexNormal = mat3(mvp) * mat3(boneMatrix) * normal;
+	vertexTexCoord = texCoord;
+	gl_Position = mvp * boneMatrix * vec4(position, 1.0);
+}

BIN
assets/textures/android-tex.png


BIN
assets/textures/bee-tex.png


BIN
libs/nineoldandroids-2.4.0.jar


BIN
libs/swipelistview-1.0.jar


+ 4 - 0
project.properties

@@ -12,3 +12,7 @@
 
 # Project target.
 target=android-19
+android.library=false
+
+
+android.library.reference.1=../google-play-services_lib

BIN
res/drawable-hdpi/ic_action_accept.png


BIN
res/drawable-hdpi/ic_action_cancel.png


BIN
res/drawable-hdpi/ic_action_done.png


BIN
res/drawable-hdpi/ic_action_new.png


BIN
res/drawable-hdpi/ic_action_stats.png


BIN
res/drawable-hdpi/ic_device_access_storage.png


BIN
res/drawable-hdpi/ic_discard.png


BIN
res/drawable-hdpi/ic_edit.png


BIN
res/drawable-hdpi/ic_filter.png


BIN
res/drawable-hdpi/ic_launcher.png


BIN
res/drawable-hdpi/ic_menu_allfriends.png


BIN
res/drawable-hdpi/ic_menu_gallery.png


BIN
res/drawable-hdpi/ic_menu_home.png


BIN
res/drawable-hdpi/ic_menu_info_details.png


BIN
res/drawable-hdpi/ic_menu_mapmode.png


BIN
res/drawable-hdpi/ic_menu_preferences.png


BIN
res/drawable-hdpi/ic_menu_records.png


BIN
res/drawable-hdpi/ic_menu_set_as.png


BIN
res/drawable-hdpi/ic_menu_stats.png


BIN
res/drawable-hdpi/ic_navigation_drawer.png


BIN
res/drawable-hdpi/ic_profile_vista.png


BIN
res/drawable-hdpi/ic_profile_w7.png


BIN
res/drawable-hdpi/ic_service_green.png


BIN
res/drawable-hdpi/ic_service_red.png


BIN
res/drawable-hdpi/ic_service_yellow.png


BIN
res/drawable-hdpi/ic_sort_by_size.png


BIN
res/drawable-hdpi/rd_btn_off.png


BIN
res/drawable-hdpi/rd_btn_on.png


BIN
res/drawable-mdpi/ic_action_accept.png


BIN
res/drawable-mdpi/ic_action_cancel.png


BIN
res/drawable-mdpi/ic_action_done.png


BIN
res/drawable-mdpi/ic_action_new.png


BIN
res/drawable-mdpi/ic_action_stats.png


BIN
res/drawable-mdpi/ic_device_access_storage.png


BIN
res/drawable-mdpi/ic_discard.png


BIN
res/drawable-mdpi/ic_edit.png


BIN
res/drawable-mdpi/ic_launcher.png


BIN
res/drawable-mdpi/ic_menu_allfriends.png


BIN
res/drawable-mdpi/ic_menu_gallery.png


BIN
res/drawable-mdpi/ic_menu_home.png


BIN
res/drawable-mdpi/ic_menu_info_details.png


BIN
res/drawable-mdpi/ic_menu_mapmode.png


BIN
res/drawable-mdpi/ic_menu_preferences.png


BIN
res/drawable-mdpi/ic_menu_records.png


BIN
res/drawable-mdpi/ic_menu_set_as.png


BIN
res/drawable-mdpi/ic_menu_stats.png


BIN
res/drawable-mdpi/ic_navigation_drawer.png


BIN
res/drawable-mdpi/ic_profile_vista.png


BIN
res/drawable-mdpi/ic_profile_w7.png


BIN
res/drawable-mdpi/ic_service_green.png


BIN
res/drawable-mdpi/ic_service_red.png


BIN
res/drawable-mdpi/ic_service_yellow.png


BIN
res/drawable-mdpi/rd_btn_off.png


BIN
res/drawable-mdpi/rd_btn_on.png


BIN
res/drawable-xhdpi/ic_action_accept.png


BIN
res/drawable-xhdpi/ic_action_cancel.png


BIN
res/drawable-xhdpi/ic_action_done.png


BIN
res/drawable-xhdpi/ic_action_new.png


BIN
res/drawable-xhdpi/ic_action_stats.png


BIN
res/drawable-xhdpi/ic_device_access_storage.png


BIN
res/drawable-xhdpi/ic_discard.png


BIN
res/drawable-xhdpi/ic_edit.png


BIN
res/drawable-xhdpi/ic_launcher.png


BIN
res/drawable-xhdpi/ic_menu_allfriends.png


BIN
res/drawable-xhdpi/ic_menu_gallery.png


BIN
res/drawable-xhdpi/ic_menu_home.png


BIN
res/drawable-xhdpi/ic_menu_info_details.png


BIN
res/drawable-xhdpi/ic_menu_mapmode.png


BIN
res/drawable-xhdpi/ic_menu_preferences.png


BIN
res/drawable-xhdpi/ic_menu_records.png


BIN
res/drawable-xhdpi/ic_menu_set_as.png


BIN
res/drawable-xhdpi/ic_navigation_drawer.png


BIN
res/drawable-xhdpi/ic_profile_vista.png


BIN
res/drawable-xhdpi/ic_profile_w7.png


BIN
res/drawable-xhdpi/ic_service_green.png


BIN
res/drawable-xhdpi/ic_service_red.png


BIN
res/drawable-xhdpi/ic_service_yellow.png


+ 3 - 0
res/drawable-xhdpi/popup_background.xml

@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
+    android:src="@drawable/popup_black"/>

BIN
res/drawable-xhdpi/popup_black.9.png


BIN
res/drawable-xhdpi/rd_btn_off.png


BIN
res/drawable-xhdpi/rd_btn_on.png


BIN
res/drawable-xxhdpi/ic_action_cancel.png


BIN
res/drawable-xxhdpi/ic_action_stats.png


BIN
res/drawable-xxhdpi/ic_device_access_storage.png


BIN
res/drawable-xxhdpi/ic_launcher.png


BIN
res/drawable-xxhdpi/ic_menu_allfriends.png


Some files were not shown because too many files changed in this diff