From fd6b9b101f10e653b9685183028980ee7e3896fd Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 23 Jul 2022 11:59:38 +0200 Subject: [PATCH] Added VirusTotal info button --- FAQ.md | 21 ++++++++++++++++++- .../faircode/email/FragmentOptionsMisc.java | 9 ++++++++ .../main/res/layout/fragment_options_misc.xml | 15 +++++++++++-- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/FAQ.md b/FAQ.md index 427138428b..56be71552b 100644 --- a/FAQ.md +++ b/FAQ.md @@ -383,6 +383,7 @@ Fonts, sizes, colors, etc should be material design whenever possible. * [(178) Why are widgets not updating?](#user-content-faq178) * [(179) What are reply templates?](#user-content-faq179) * [(180) How do I use LanguageTool?](#user-content-faq180) +* [(181) How do I use VirusTotal?](#user-content-faq181) [I have another question.](#user-content-get-support) @@ -4845,7 +4846,7 @@ Templates can have the following options: **(180) How do I use LanguageTool?** -LanguageTool need to be enabled in the miscellaneous settings. +LanguageTool integration needs to be enabled in the miscellaneous settings. After writing some text, you can long press on the save draft button to perform a grammar, style, and spell check via [LanguageTool](https://languagetool.org/). Texts with suggestions will be marked and if you tap on a marked suggestion, @@ -4854,6 +4855,24 @@ else you can double tap or long press the marked text to show suggestions.
+ +**(181) How do I use VirusTotal?** + +VirusTotal integration needs to be enabled in the miscellaneous settings. +This will show a *scan* icon button for each attachment. + +Without entering an API key, tapping on the scan button will calculate the SHA-256 hash of the attached file and open the corresponding file report on the VirusTotal website. +If the file is not known by VirusTotal ("*Item not found*"), it is probably okay, unless it contains a new virus not being detected by virus scanners yet. + +With entering an API key, there will be a dialog showing the number of virus scanners detecting the file. +Tapping on the info button will open the corresponding file report on the VirusTotal website. + +To get an API key, you'll need to register on the VirusTotal website. + +This feature was added in version 1.1941 and is available in non Play store versions only. + +
+

Get support

🌎 [Google Translate](https://translate.google.com/translate?sl=en&u=https://github.com/M66B/FairEmail/blob/master/FAQ.md%23user-content-get-support) diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index 68fad2278f..d8f014c119 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -124,6 +124,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private ImageButton ibDeepL; private SwitchCompat swVirusTotal; private TextView tvVirusTotalPrivacy; + private ImageButton ibVirusTotal; private EditText etVirusTotal; private SwitchCompat swUpdates; private ImageButton ibChannelUpdated; @@ -314,6 +315,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc ibDeepL = view.findViewById(R.id.ibDeepL); swVirusTotal = view.findViewById(R.id.swVirusTotal); tvVirusTotalPrivacy = view.findViewById(R.id.tvVirusTotalPrivacy); + ibVirusTotal = view.findViewById(R.id.ibVirusTotal); etVirusTotal = view.findViewById(R.id.etVirusTotal); swUpdates = view.findViewById(R.id.swUpdates); ibChannelUpdated = view.findViewById(R.id.ibChannelUpdated); @@ -659,6 +661,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); + ibVirusTotal.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Helper.viewFAQ(v.getContext(), 181); + } + }); + etVirusTotal.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 31f382960f..6109ae4071 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -416,6 +416,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swVirusTotal" /> + + + app:layout_constraintTop_toBottomOf="@id/ibVirusTotal" /> + app:constraint_referenced_ids="swVirusTotal,tvVirusTotalPrivacy,ibVirusTotal,etVirusTotal" />