Added VirusTotal integration option

This commit is contained in:
M66B
2022-07-22 08:05:37 +02:00
parent 0b4aecdcd2
commit facaaf5a6a
8 changed files with 192 additions and 62 deletions

View File

@@ -123,6 +123,7 @@ import com.google.android.material.snackbar.Snackbar;
import org.openintents.openpgp.util.OpenPgpApi;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -201,7 +202,6 @@ public class Helper {
static final String DONTKILL_URI = "https://dontkillmyapp.com/";
static final String URI_SUPPORT_RESET_OPEN = "https://support.google.com/pixelphone/answer/6271667";
static final String URI_SUPPORT_CONTACT_GROUP = "https://support.google.com/contacts/answer/30970";
static final String URI_VIRUS_TOTAL = "https://www.virustotal.com/";
// https://developer.android.com/distribute/marketing-tools/linking-to-google-play#PerformingSearch
private static final String PLAY_STORE_SEARCH = "https://play.google.com/store/search";
@@ -2390,6 +2390,17 @@ public class Helper {
return hex(bytes);
}
static String getHash(InputStream is, String algorithm) throws NoSuchAlgorithmException, IOException {
MessageDigest digest = MessageDigest.getInstance(algorithm);
int count;
byte[] buffer = new byte[BUFFER_SIZE];
while ((count = is.read(buffer)) != -1)
digest.update(buffer, 0, count);
return hex(digest.digest());
}
static String hex(byte[] bytes) {
StringBuilder sb = new StringBuilder();
for (byte b : bytes)