From 8b68d2d4dcf599c1285d70703c1d97224d60f8dd Mon Sep 17 00:00:00 2001 From: zafodB Date: Wed, 18 Aug 2021 16:00:01 +0200 Subject: [PATCH] disable and hide hpfeeds setting --- .../fragment/PreferenceHostageFragment.java | 51 ++++++++++--------- src/main/res/xml/settings_preferences.xml | 12 ++--- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/main/java/dk/aau/netsec/hostage/ui/fragment/PreferenceHostageFragment.java b/src/main/java/dk/aau/netsec/hostage/ui/fragment/PreferenceHostageFragment.java index 4c4dab7c..a96a4728 100644 --- a/src/main/java/dk/aau/netsec/hostage/ui/fragment/PreferenceHostageFragment.java +++ b/src/main/java/dk/aau/netsec/hostage/ui/fragment/PreferenceHostageFragment.java @@ -177,8 +177,8 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin if (key.equals(PREFERENCE_KEY_MULTISTAGE)) { checkMultistage(); - } else if (key.equals(PREFERENCE_KEY_HPFEEDS)) { - checkHpfeeds(); +// } else if (key.equals(PREFERENCE_KEY_HPFEEDS)) { +// checkHpfeeds(); } } @@ -192,12 +192,12 @@ private void checkMultistage() { } } - private void checkHpfeeds() { - SwitchPreference switchPrefHpfeeds = (SwitchPreference) getPreferenceManager().findPreference(PREFERENCE_KEY_HPFEEDS); - - if (switchPrefHpfeeds.isChecked() && !enabledHpfeeds) - confirmHpfeeds(switchPrefHpfeeds).create().show(); - } +// private void checkHpfeeds() { +// SwitchPreference switchPrefHpfeeds = (SwitchPreference) getPreferenceManager().findPreference(PREFERENCE_KEY_HPFEEDS); +// +// if (switchPrefHpfeeds.isChecked() && !enabledHpfeeds) +// confirmHpfeeds(switchPrefHpfeeds).create().show(); +// } private MaterialAlertDialogBuilder confirmMultistage(SwitchPreference switchPrefMultiStage) { MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); @@ -215,23 +215,24 @@ private MaterialAlertDialogBuilder confirmMultistage(SwitchPreference switchPref return builder; } - private MaterialAlertDialogBuilder confirmHpfeeds(SwitchPreference switchPrefHpFeeds) { - MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); - builder.setTitle(R.string.data_disclaimer); -// TODO extract strings - builder.setMessage("The data collected from HosTaGe attack records will be stored for Advanced Collaborative Threat Intelligence. GDPR sensitive data include but are not limited to the public IP address of the publishing HosTaGe device. Please note that the physical geographical location of the participating HosTaGe publisher can be determined with the public IP address. Furthermore, hpfeeds include the IP address and the ports of the attack sources. Exclusive access to the hpfeeds repository is provided only with an internal review process.\n" + - "\n" + - "By enabling hpfeeds, the user of this app agrees to send Aalborg University (Denmark) attack data and provides his consent to use this data to process threat intelligence. The user has the right to ask for the deletion of the data published by him/her. Please contact hostage@es.aau.dk for queries and more information."); - builder.setPositiveButton(R.string.enable, (dialog, which) -> { - enabledHpfeeds = true; - }); - builder.setNegativeButton(R.string.close, (dialog, which) -> { - switchPrefHpFeeds.setChecked(false); - enabledHpfeeds = false; - }); - - return builder; - } +// private MaterialAlertDialogBuilder confirmHpfeeds(SwitchPreference switchPrefHpFeeds) { +// MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity()); +// builder.setTitle(R.string.data_disclaimer); +//// TODO extract strings + +// builder.setMessage("The data collected from HosTaGe attack records will be stored for Advanced Collaborative Threat Intelligence. GDPR sensitive data include but are not limited to the public IP address of the publishing HosTaGe device. Please note that the physical geographical location of the participating HosTaGe publisher can be determined with the public IP address. Furthermore, hpfeeds include the IP address and the ports of the attack sources. Exclusive access to the hpfeeds repository is provided only with an internal review process.\n" + +// "\n" + +// "By enabling hpfeeds, the user of this app agrees to send Aalborg University (Denmark) attack data and provides his consent to use this data to process threat intelligence. The user has the right to ask for the deletion of the data published by him/her. Please contact hostage@es.aau.dk for queries and more information."); +// builder.setPositiveButton(R.string.enable, (dialog, which) -> { +// enabledHpfeeds = true; +// }); +// builder.setNegativeButton(R.string.close, (dialog, which) -> { +// switchPrefHpFeeds.setChecked(false); +// enabledHpfeeds = false; +// }); +// +// return builder; +// } @Override public Fragment getCallbackFragment() { diff --git a/src/main/res/xml/settings_preferences.xml b/src/main/res/xml/settings_preferences.xml index e5176008..4c3586fa 100644 --- a/src/main/res/xml/settings_preferences.xml +++ b/src/main/res/xml/settings_preferences.xml @@ -13,12 +13,12 @@ android:summary="@string/multistage_summary" android:title="@string/multistage_service"/> - + + + + + +