Browse Source

Attacks are now being stored in the HoneyService; fixed synchronization bugs with services and home fragment

Alexander Brakowski 10 years ago
parent
commit
6deeee492f

+ 26 - 1
src/de/tudarmstadt/informatik/hostage/HoneyService.java

@@ -5,6 +5,7 @@ import java.io.InputStreamReader;
 import java.net.Socket;
 import java.security.SecureRandom;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -55,6 +56,8 @@ import de.tudarmstadt.informatik.hostage.ui2.activity.MainActivity;
  */
 public class HoneyService extends Service {
 
+	private HashMap<String, Boolean> mProtocolActiveAttacks;
+
 	public class LocalBinder extends Binder {
 		public HoneyService getService() {
 			return HoneyService.this;
@@ -273,7 +276,9 @@ public class HoneyService extends Service {
 		createNotification();
 		// Send Notification
 		if (sender.equals(HoneyHandler.class.getName())
-				&& values[0].equals(R.string.broadcast_started)) {
+				&& values[0].equals(getString(R.string.broadcast_started))) {
+			this.mProtocolActiveAttacks.put(values[1], true);
+
 			attackNotification();
 		}
 		// Inform UI of Preference Change
@@ -297,6 +302,9 @@ public class HoneyService extends Service {
 		connectionInfo = getSharedPreferences(
 				getString(R.string.connection_info), Context.MODE_PRIVATE);
 		connectionInfoEditor = connectionInfo.edit();
+
+		mProtocolActiveAttacks = new HashMap<String, Boolean>();
+
 		createNotification();
 		registerNetReceiver();
 		updateConnectionInfo();
@@ -363,6 +371,7 @@ public class HoneyService extends Service {
 
 			}
 		}
+
 		HoneyListener listener = createListener(protocolName, port);
 		if (listener != null) {
 			if (listener.start()) {
@@ -415,6 +424,7 @@ public class HoneyService extends Service {
 					&& listener.getPort() == port) {
 				if (listener.isRunning()) {
 					listener.stop();
+					mProtocolActiveAttacks.remove(protocolName);
 				}
 			}
 		}
@@ -429,6 +439,7 @@ public class HoneyService extends Service {
 		for (HoneyListener listener : listeners) {
 			if (listener.isRunning()) {
 				listener.stop();
+				mProtocolActiveAttacks.remove(listener.getProtocolName());
 			}
 		}
 		Toast.makeText(getApplicationContext(), "SERVICES STOPPED!",
@@ -621,6 +632,18 @@ public class HoneyService extends Service {
 		unregisterReceiver(netReceiver);
 	}
 
+	public boolean hasProtocolActiveAttacks(String protocol){
+		if(!mProtocolActiveAttacks.containsKey(protocol)) return false;
+		return mProtocolActiveAttacks.get(protocol);
+	}
+
+	public boolean hasActiveAttacks(){
+		for(boolean b: mProtocolActiveAttacks.values()){
+			if(b) return true;
+		}
+
+		return false;
+	}
 	/**
 	 * Updates the connection info and saves them in the the SharedPreferences
 	 * for session data.
@@ -642,6 +665,8 @@ public class HoneyService extends Service {
 		editor.commit();
 		SetExternalIPTask async = new SetExternalIPTask();
 		async.execute(new String[] { "http://ip2country.sourceforge.net/ip2c.php?format=JSON" });
+
+		this.mProtocolActiveAttacks.clear();
 	}
 
 }

+ 72 - 70
src/de/tudarmstadt/informatik/hostage/ui2/adapter/ServicesListAdapter.java

@@ -1,6 +1,7 @@
 package de.tudarmstadt.informatik.hostage.ui2.adapter;
 
 
+import android.annotation.TargetApi;
 import android.app.AlertDialog;
 import android.content.Context;
 import android.content.DialogInterface;
@@ -26,20 +27,29 @@ import de.tudarmstadt.informatik.hostage.ui2.model.ServicesListItem;
 public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
 
 	private class ViewHolder {
-			public TextView protocolName;
-			public TextView recordedAttacks;
-			public Switch activated;
-			public View circle;
-		}
+
+		public TextView protocolName;
+
+		public TextView recordedAttacks;
+
+		public Switch activated;
+
+		public View circle;
+	}
 
 	private Context mActivity;
+
 	private Switch mServicesSwitch;
+
 	private CompoundButton.OnCheckedChangeListener mListener;
+
 	private final Context context;
+
 	private final List<ServicesListItem> values;
+
 	int sdk = Build.VERSION.SDK_INT;
 
-	public ServicesListAdapter(Context context, List<ServicesListItem> objects){
+	public ServicesListAdapter(Context context, List<ServicesListItem> objects) {
 		super(context, R.layout.services_list_item, objects);
 
 		this.context = context;
@@ -62,7 +72,7 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
 
 		final ServicesListItem item = values.get(position);
 
-		if(rowView == null){
+		if (rowView == null) {
 			rowView = inflater.inflate(R.layout.services_list_item, parent, false);
 
 			holder = new ViewHolder();
@@ -72,7 +82,6 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
 			holder.activated = (Switch) rowView.findViewById(R.id.services_item_switch);
 			holder.circle = rowView.findViewById(R.id.services_circle);
 			rowView.setTag(holder);
-
 		} else {
 			holder = (ViewHolder) rowView.getTag();
 		}
@@ -82,89 +91,82 @@ public class ServicesListAdapter extends ArrayAdapter<ServicesListItem> {
 
 		this.updateStatus(item, holder);
 
-			holder.activated.setOnCheckedChangeListener(
-					new CompoundButton.OnCheckedChangeListener() {
-						public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-							ServicesListItem item = (ServicesListItem) buttonView.getTag();
-				if(!HelperUtils.isWifiConnected(mActivity)){
-					new AlertDialog.Builder(mActivity)
-							.setTitle(R.string.information)
-							.setMessage(R.string.wifi_not_connected_msg)
-							.setPositiveButton(android.R.string.ok,
-									new DialogInterface.OnClickListener() {
-										public void onClick(DialogInterface dialog, int which) {
-										}
-									})
-							.setIcon(android.R.drawable.ic_dialog_info)
-							.show();
-
-
-					buttonView.setChecked(false);
-				} else {
-					//check if switch is set to ON and start the concrete listener for the protocol
-					if(isChecked){
-						if(!MainActivity.getInstance().getHoneyService().isRunning(item.protocol)) {
-							MainActivity.getInstance().getHoneyService().startListener(item.protocol);
-							System.out.println("Protokoll gestartet innerIFFFFF: ------------------------------" + item.protocol);
-
-							//set the main switch to null, so that he won't react and starts all protocols
-							mServicesSwitch.setOnCheckedChangeListener(null);
-							mServicesSwitch.setChecked(true);
-							mServicesSwitch.setOnCheckedChangeListener(mListener);
-							buttonView.setChecked(true);
+		holder.activated.setOnCheckedChangeListener(
+				new CompoundButton.OnCheckedChangeListener() {
+					public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+						ServicesListItem item = (ServicesListItem) buttonView.getTag();
+
+						if (!HelperUtils.isWifiConnected(mActivity)) {
+							new AlertDialog.Builder(mActivity)
+									.setTitle(R.string.information)
+									.setMessage(R.string.wifi_not_connected_msg)
+									.setPositiveButton(android.R.string.ok,
+											new DialogInterface.OnClickListener() {
+												public void onClick(DialogInterface dialog,
+														int which) {
+												}
+											})
+									.setIcon(android.R.drawable.ic_dialog_info).show();
+
+							buttonView.setChecked(false);
+						} else {
+							//check if switch is set to ON and start the concrete listener for the protocol
+							if (isChecked) {
+								if (!MainActivity.getInstance().getHoneyService().isRunning(item.protocol)) {
+									MainActivity.getInstance().getHoneyService().startListener(item.protocol);
+
+									//set the main switch to null, so that he won't react and starts all protocols
+									mServicesSwitch.setOnCheckedChangeListener(null);
+									mServicesSwitch.setChecked(true);
+									mServicesSwitch.setOnCheckedChangeListener(mListener);
+									buttonView.setChecked(true);
+								} else if (MainActivity.getInstance().getHoneyService().isRunning(item.protocol)) {
+									buttonView.setChecked(true);
+								}
+							} else {
+								if (MainActivity.getInstance().getHoneyService().isRunning(item.protocol)) {
+									MainActivity.getInstance().getHoneyService().stopListener(item.protocol);
+								}
+								buttonView.setChecked(false);
+							}
 						}
-						else if(MainActivity.getInstance().getHoneyService().isRunning(item.protocol)){
-							System.out.println("Protokoll ist bereits gestartet: ------------------------------" + item.protocol);
-							buttonView.setChecked(true);
-						}
-					} else {
-						if(MainActivity.getInstance().getHoneyService().isRunning(item.protocol)){
-							MainActivity.getInstance().getHoneyService().stopListener(item.protocol);
-						}
-						buttonView.setChecked(false);
 					}
-				}
-						}
-					});
+				});
 		return rowView;
 	}
 
-	private void updateStatus(ServicesListItem item, ViewHolder holder){
-		if(MainActivity.getInstance().getHoneyService().isRunning(item.protocol)){
+	private void updateStatus(ServicesListItem item, ViewHolder holder) {
+		if (MainActivity.getInstance().getHoneyService().isRunning(item.protocol)) {
 			holder.activated.setChecked(true);
-			if(!MainActivity.getInstance().hasProtocolAttacks(item.protocol)){
-				if(Integer.valueOf(item.attacks) > 0) {
+			if (!MainActivity.getInstance().getHoneyService().hasProtocolActiveAttacks(item.protocol)) {
+				if (item.attacks > 0) {
 					setBackground(holder, R.drawable.services_circle_yellow);
-				}
-				else {
+				} else {
 					setBackground(holder, R.drawable.services_circle_green);
 				}
 
-			}
-			else {
-				if(MainActivity.getInstance().hasProtocolAttacks(item.protocol)){
+			} else {
+				if (MainActivity.getInstance().getHoneyService().hasProtocolActiveAttacks(item.protocol)) {
 					setBackground(holder, R.drawable.services_circle_red);
 				}
 			}
-		}
-		else if(Integer.valueOf(item.attacks) > 0){
+		} else if (item.attacks > 0) {
 			holder.activated.setChecked(false);
 			setBackground(holder, R.drawable.services_circle_yellow);
-		}
-		else {
+		} else {
 			holder.activated.setChecked(false);
 			setBackground(holder, R.drawable.services_circle);
 		}
-		holder.recordedAttacks.setText(String.format(MainActivity.getContext().getResources().getString(R.string.recorded_attacks) + "  %d", Integer.valueOf(item.attacks)));
+		holder.recordedAttacks
+				.setText(String.format(MainActivity.getContext().getResources().getString(R.string.recorded_attacks) + "  %d", Integer.valueOf(item.attacks)));
 	}
 
-	private void setBackground(ViewHolder holder, int drawable){
-		if(sdk < Build.VERSION_CODES.JELLY_BEAN){
+	@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
+	private void setBackground(ViewHolder holder, int drawable) {
+		if (sdk < Build.VERSION_CODES.JELLY_BEAN) {
 			holder.circle.setBackgroundDrawable(MainActivity.getInstance().getResources().getDrawable(drawable));
-		}
-		else {
-			holder.circle.setBackground(MainActivity.getInstance().getResources()
-					.getDrawable(drawable));
+		} else {
+			holder.circle.setBackground(MainActivity.getInstance().getResources().getDrawable(drawable));
 		}
 	}
 }

+ 31 - 37
src/de/tudarmstadt/informatik/hostage/ui2/fragment/HomeFragment.java

@@ -153,37 +153,26 @@ public class HomeFragment extends Fragment {
 
 		boolean hasActiveListeners = false;
 		int totalAttacks = dbh.numBssidSeen(mConnectionInfo.getString(getString(R.string.connection_info_bssid), null));
-
-		if(MainActivity.getInstance().isServiceBound()){
-			for(String protocol: getResources().getStringArray(R.array.protocols)){
-				if(MainActivity.getInstance().getHoneyService().isRunning(protocol)){
-					hasActiveListeners = true;
-
-					boolean attackRegistered = MainActivity.getInstance().hasProtocolAttacks(protocol);
-
-					if(!attackRegistered){
-						if(totalAttacks > 0){
-							if(THREAT_LEVEL != ThreatIndicatorGLRenderer.ThreatLevel.LIVE_THREAT){
-								THREAT_LEVEL = ThreatIndicatorGLRenderer.ThreatLevel.PAST_THREAT;
-							}
-						} else {
-							if(THREAT_LEVEL != ThreatIndicatorGLRenderer.ThreatLevel.LIVE_THREAT && THREAT_LEVEL != ThreatIndicatorGLRenderer.ThreatLevel.PAST_THREAT){
-								THREAT_LEVEL = ThreatIndicatorGLRenderer.ThreatLevel.NO_THREAT;
-							}
-						}
-					} else {
-						THREAT_LEVEL = ThreatIndicatorGLRenderer.ThreatLevel.LIVE_THREAT;
-					}
+		ThreatIndicatorGLRenderer.ThreatLevel threatLevel = ThreatIndicatorGLRenderer.ThreatLevel.NOT_MONITORING;
+
+		if(MainActivity.getInstance().getHoneyService() != null){
+			if(MainActivity.getInstance().getHoneyService().hasRunningListeners()){
+				hasActiveListeners = true;
+
+				if(MainActivity.getInstance().getHoneyService().hasActiveAttacks() && totalAttacks > 0){
+					threatLevel = ThreatIndicatorGLRenderer.ThreatLevel.LIVE_THREAT;
+				} else if(totalAttacks > 0){
+					threatLevel = ThreatIndicatorGLRenderer.ThreatLevel.PAST_THREAT;
+				} else {
+					threatLevel = ThreatIndicatorGLRenderer.ThreatLevel.NO_THREAT;
 				}
 			}
 		}
 
-
-
 		if(hasActiveListeners){
 			setStateActive(true);
 
-			switch(THREAT_LEVEL){
+			switch(threatLevel){
 				case NO_THREAT:
 					mHomeTextAttacks.setText(R.string.zero_attacks);
 					mHomeTextSecurity.setText(R.string.secure);
@@ -204,17 +193,13 @@ public class HomeFragment extends Fragment {
 					break;
 			}
 
-			ThreatIndicatorGLRenderer.setThreatLevel(THREAT_LEVEL);
+			ThreatIndicatorGLRenderer.setThreatLevel(threatLevel);
 		} else {
-			mHomeSwitchConnection.setOnCheckedChangeListener(null);
 			setStateNotActive();
-			THREAT_LEVEL = ThreatIndicatorGLRenderer.ThreatLevel.NO_THREAT;
 
 			if(!HelperUtils.isWifiConnected(getActivity())){
 				setStateNotConnected();
 			}
-
-			mHomeSwitchConnection.setOnCheckedChangeListener(switchChangeListener);
 		}
 	}
 
@@ -264,8 +249,6 @@ public class HomeFragment extends Fragment {
 
 	    updateUI();
 
-		final String[] protocols = getResources().getStringArray(R.array.protocols);
-
 	    mHomeSwitchConnection = (Switch) rootView.findViewById(R.id.home_switch_connection);
 
 	    if(switchChangeListener == null){
@@ -283,19 +266,19 @@ public class HomeFragment extends Fragment {
 							    .setIcon(android.R.drawable.ic_dialog_info)
 							    .show();
 
-
 					    setStateNotActive();
 					    setStateNotConnected();
 				    } else {
 					    if(isChecked){
-						    for(String protocol: protocols){
+						    for(String protocol: getResources().getStringArray(R.array.protocols)){
 							    if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) MainActivity.getInstance().getHoneyService().startListener(protocol);
 						    }
-
 						    setStateActive();
 					    } else {
-						    MainActivity.getInstance().getHoneyService().stopListeners();
-						    MainActivity.getInstance().stopAndUnbind();
+						    if(MainActivity.getInstance().getHoneyService() != null && MainActivity.getInstance().isServiceRunning()){
+							    MainActivity.getInstance().getHoneyService().stopListeners();
+							    MainActivity.getInstance().stopAndUnbind();
+						    }
 						    setStateNotActive();
 					    }
 				    }
@@ -316,10 +299,21 @@ public class HomeFragment extends Fragment {
         return rootView;
     }
 
+	@Override
+	public void onStop(){
+		super.onStop();
+		mHomeSwitchConnection.setOnCheckedChangeListener(null);
+	}
+
+	@Override
+	public void onStart(){
+		super.onStart();
+		mHomeSwitchConnection.setOnCheckedChangeListener(switchChangeListener);
+	}
 
 	@Override
 	public void onDestroy(){
-		unregisterBroadcastReceiver();
 		super.onDestroy();
+		unregisterBroadcastReceiver();
 	}
 }

+ 62 - 51
src/de/tudarmstadt/informatik/hostage/ui2/fragment/ServicesFragment.java

@@ -20,7 +20,9 @@ import android.widget.Switch;
 import android.widget.TextView;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 
+import de.tudarmstadt.informatik.hostage.HoneyHandler;
 import de.tudarmstadt.informatik.hostage.R;
 import de.tudarmstadt.informatik.hostage.commons.HelperUtils;
 import de.tudarmstadt.informatik.hostage.logging.UglyDbHelper;
@@ -77,6 +79,10 @@ public class ServicesFragment extends Fragment{
 			mServicesSwitchService.setOnCheckedChangeListener(switchChangeListener);
 		}
 		else {
+			if(MainActivity.getInstance().getHoneyService().hasRunningListeners()){
+				setStateActive();
+			}
+
 			mServicesTextName.setText(HelperUtils.getSSID(getActivity()));
 		}
 
@@ -85,22 +91,31 @@ public class ServicesFragment extends Fragment{
 
 	private void registerBroadcastReceiver(){
 		if(!mReceiverRegistered){
-		mReceiver = new BroadcastReceiver() {
-			@Override
-			public void onReceive(Context context, Intent intent) {
+			mReceiver = new BroadcastReceiver() {
+				@Override
+				public void onReceive(Context context, Intent intent) {
+					String sender = intent.getStringExtra("SENDER");
+					String[] values = intent.getStringArrayExtra("VALUES");
+
+					if(sender.equals(HoneyHandler.class.getName()) && values[0].equals(getString(R.string.broadcast_started))){
+						for(ServicesListItem item: protocolList){
+							if(item.protocol.equals(values[1])){
+								item.attacks = dbh.numBssidSeen(item.protocol, mConnectionInfo.getString(getString(R.string.connection_info_bssid), null));
+							}
+						}
+					}
 
-				for(int i = 0; i < protocols.length; i++ ){
-					protocolList.get(i).attacks = String.valueOf(dbh.numBssidSeen(protocolList.get(i).protocol, mConnectionInfo.getString(getString(R.string.connection_info_bssid), null)));
-				}
-				if (!MainActivity.getInstance().getHoneyService().hasRunningListeners()) {
-					setStateNotActive();
+					if (!MainActivity.getInstance().getHoneyService().hasRunningListeners()) {
+						setStateNotActive();
+					} else {
+						setStateActive();
+					}
+
+					adapter.notifyDataSetChanged();
 				}
-				adapter.notifyDataSetChanged();
-			}
-		};
+			};
 
-		LocalBroadcastManager
-				.getInstance(getActivity()).registerReceiver(mReceiver, new IntentFilter(getString(R.string.broadcast)));
+			LocalBroadcastManager.getInstance(getActivity()).registerReceiver(mReceiver, new IntentFilter(getString(R.string.broadcast)));
 			this.mReceiverRegistered = true;
 		}
 	}
@@ -124,55 +139,47 @@ public class ServicesFragment extends Fragment{
 		int i=0;
 		for(String protocol: protocols){
 			protocolList.add(new ServicesListItem(protocol));
-			protocolList.get(i).attacks = String.valueOf(dbh.numBssidSeen(protocolList.get(i).protocol, mConnectionInfo.getString(getString(R.string.connection_info_bssid), null)));
+			protocolList.get(i).attacks = dbh.numBssidSeen(protocolList.get(i).protocol, mConnectionInfo.getString(getString(R.string.connection_info_bssid), null));
 			i++;
-			if(MainActivity.getInstance().getHoneyService().isRunning(protocol)){
-				setStateActive();
-			}
 		}
 
-		adapter = new ServicesListAdapter(getActivity().getBaseContext(), protocolList);
-		adapter.setActivity(this.getActivity(), this.mServicesSwitchService, this.switchChangeListener);
-		list.setAdapter(adapter);
-
-		registerBroadcastReceiver();
-
 		mServicesSwitchService = (Switch) rootView.findViewById(R.id.service_switch_connection);
 
-		if(switchChangeListener == null){
+		if (switchChangeListener == null) {
 			switchChangeListener = new CompoundButton.OnCheckedChangeListener() {
 				public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-					if(!HelperUtils.isWifiConnected(getActivity())){
+					if (!HelperUtils.isWifiConnected(getActivity())) {
 						new AlertDialog.Builder(getActivity())
 								.setTitle(R.string.information)
 								.setMessage(R.string.wifi_not_connected_msg)
-								.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
-									public void onClick(DialogInterface dialog, int which) {
+								.setPositiveButton(android.R.string.ok,
+										new DialogInterface.OnClickListener() {
+											public void onClick(DialogInterface dialog, int which) {
 
-									}
-								})
+											}
+										})
 								.setIcon(android.R.drawable.ic_dialog_info)
 								.show();
 
-
 						setStateNotActive();
 						setStateNotConnected();
 					} else {
-						if(MainActivity.getInstance().isServiceBound()) {
-							if(isChecked){
-									for(String protocol: protocols){
-										if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) {
-											System.out.println("SERVICESFRAGMENT starts LISTENER for PROTO:" + protocol);
-											MainActivity.getInstance().getHoneyService().startListener(protocol);
-										}
+						if (MainActivity.getInstance().isServiceBound()) {
+							if (isChecked) {
+								for (String protocol : protocols) {
+									if (!MainActivity.getInstance().getHoneyService().isRunning(protocol)) {
+										System.out.println(
+												"SERVICESFRAGMENT starts LISTENER for PROTO:"
+														+ protocol);
+										MainActivity.getInstance().getHoneyService().startListener(protocol);
 									}
-									setStateActive();
-							}
-							else {
+								}
+								setStateActive();
+							} else {
 								MainActivity.getInstance().getHoneyService().stopListeners();
 								MainActivity.getInstance().stopAndUnbind();
 								setStateNotActive();
-								}
+							}
 						}
 					}
 				}
@@ -181,21 +188,21 @@ public class ServicesFragment extends Fragment{
 		}
 		mServicesSwitchService.setOnCheckedChangeListener(switchChangeListener);
 
+		adapter = new ServicesListAdapter(getActivity().getBaseContext(), protocolList);
+		adapter.setActivity(this.getActivity(), this.mServicesSwitchService, this.switchChangeListener);
+		list.setAdapter(adapter);
+
+		registerBroadcastReceiver();
+
 		return rootView;
 
 	};
 
 	@Override
 	public void onStart(){
-		registerBroadcastReceiver();
 		super.onStart();
-	}
-
-	@Override
-	public void onStop(){
-		unregisterBroadcastReceiver();
-		super.onStop();
-
+		registerBroadcastReceiver();
+		mServicesSwitchService.setOnCheckedChangeListener(switchChangeListener);
 	}
 
 	private void unregisterBroadcastReceiver(){
@@ -215,13 +222,17 @@ public class ServicesFragment extends Fragment{
 
 	private void setStateNotActive() {
 		mServicesSwitchService.setChecked(false);
-
 	}
 
+	@Override
+	public void onStop(){
+		super.onStop();
+		mServicesSwitchService.setOnCheckedChangeListener(null);
+	}
 	@Override
 	public void onDestroy(){
-		unregisterBroadcastReceiver();
 		super.onDestroy();
+		unregisterBroadcastReceiver();
 	}
 
 }

+ 2 - 2
src/de/tudarmstadt/informatik/hostage/ui2/fragment/opengl/HomeGLSurfaceView.java

@@ -24,7 +24,7 @@ public class HomeGLSurfaceView extends GLSurfaceView {
 	}
 	
 	// TODO: just for testing -> remove this eventually
-	@Override
+	/*@Override
 	public boolean onTouchEvent(MotionEvent event) {
 		if (event.getAction() == MotionEvent.ACTION_DOWN) {
 			ThreatIndicatorGLRenderer.ThreatLevel threatLevel = ThreatIndicatorGLRenderer.ThreatLevel.NO_THREAT;
@@ -33,5 +33,5 @@ public class HomeGLSurfaceView extends GLSurfaceView {
 			ThreatIndicatorGLRenderer.setThreatLevel(threatLevel);
 		}
 		return false;
-	}
+	}*/
 }

+ 1 - 2
src/de/tudarmstadt/informatik/hostage/ui2/model/ServicesListItem.java

@@ -5,8 +5,7 @@ package de.tudarmstadt.informatik.hostage.ui2.model;
  */
 public class ServicesListItem {
 	public String protocol;
-	public String attacks;
-	public static int initialValue;
+	public int attacks;
 
 	public boolean activated;