Преглед изворни кода

Only the protocols, that were defined in the profile will be started

Alexander Brakowski пре 10 година
родитељ
комит
e3d8cb7411
1 измењених фајлова са 8 додато и 2 уклоњено
  1. 8 2
      src/de/tudarmstadt/informatik/hostage/ui2/fragment/HomeFragment.java

+ 8 - 2
src/de/tudarmstadt/informatik/hostage/ui2/fragment/HomeFragment.java

@@ -270,8 +270,14 @@ public class HomeFragment extends Fragment {
 					    setStateNotConnected();
 				    } else {
 					    if(isChecked){
-						    for(String protocol: getResources().getStringArray(R.array.protocols)){
-							    if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) MainActivity.getInstance().getHoneyService().startListener(protocol);
+						    if(ProfileManager.getInstance().getCurrentActivatedProfile() == null){
+							    for(String protocol: getResources().getStringArray(R.array.protocols)){
+								    if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) MainActivity.getInstance().getHoneyService().startListener(protocol);
+							    }
+						    } else {
+							    for(String protocol: ProfileManager.getInstance().getCurrentActivatedProfile().getActiveProtocols()){
+								    if(!MainActivity.getInstance().getHoneyService().isRunning(protocol)) MainActivity.getInstance().getHoneyService().startListener(protocol);
+							    }
 						    }
 						    setStateActive();
 					    } else {