mirror of
https://github.com/MaintainTeam/Hypatia.git
synced 2025-02-28 21:38:21 +03:00
Tweaks
- Add signature count back to notification too - Ignore hashes of empty content Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
parent
0e5606adcc
commit
ee3b4fed72
4 changed files with 17 additions and 9 deletions
|
@ -6,8 +6,8 @@ android {
|
|||
applicationId "us.spotco.malwarescanner"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 32
|
||||
versionCode 118
|
||||
versionName "2.38"
|
||||
versionCode 119
|
||||
versionName "2.39"
|
||||
resConfigs 'en', 'af', 'de', 'el', 'es', 'fi', 'fr', 'it', 'pl', 'pt', 'ru', 'tr', 'zh-rCN'
|
||||
}
|
||||
buildTypes {
|
||||
|
|
|
@ -184,7 +184,7 @@ class MalwareScanner extends AsyncTask<HashSet<File>, Object, String> {
|
|||
}
|
||||
}
|
||||
if (Database.isDatabaseLoaded()) {
|
||||
publishProgress("\t" + context.getString(R.string.main_database_loaded, String.valueOf(Database.signaturesCount)) + "\n", true);
|
||||
publishProgress("\t" + context.getString(R.string.main_database_loaded, NumberFormat.getInstance().format(Database.signaturesCount)) + "\n", true);
|
||||
|
||||
//Perform a self-test
|
||||
if (Database.selfTest()) {
|
||||
|
@ -274,11 +274,15 @@ class MalwareScanner extends AsyncTask<HashSet<File>, Object, String> {
|
|||
private void checkSignature(String hashType, HashMap<File, String> signaturesToCheck, BloomFilter<String> signatureDatabase) {
|
||||
if (Database.isDatabaseLoaded() && signatureDatabase != null) {
|
||||
for (Map.Entry<File, String> file : signaturesToCheck.entrySet()) {
|
||||
if (signatureDatabase.mightContain(file.getValue())) {
|
||||
amtMatchedFiles++;
|
||||
publishProgress("Potential match in " + file.getKey().toString().replaceAll(Environment.getExternalStorageDirectory().toString(), "~"), false, fileHashesSHA256.get(file.getKey()));
|
||||
} else {
|
||||
//Log.d("Hypatia", "No match for " + file.getValue());
|
||||
if (!file.getValue().equals("d41d8cd98f00b204e9800998ecf8427e")
|
||||
&& !file.getValue().equals("da39a3ee5e6b4b0d3255bfef95601890afd80709")
|
||||
&& !file.getValue().equals("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) {
|
||||
if (signatureDatabase.mightContain(file.getValue())) {
|
||||
amtMatchedFiles++;
|
||||
publishProgress("Potential match in " + file.getKey().toString().replaceAll(Environment.getExternalStorageDirectory().toString(), "~"), false, fileHashesSHA256.get(file.getKey()));
|
||||
} else {
|
||||
//Log.d("Hypatia", "No match for " + file.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
publishProgress("\t" + context.getString(R.string.main_hash_scan_done, hashType) + "\n", true);
|
||||
|
|
|
@ -120,7 +120,7 @@ public class MalwareScannerService extends Service {
|
|||
|
||||
private void updateForegroundNotification() {
|
||||
foregroundNotification
|
||||
.setSubText(getString(R.string.main_files_scanned_count, NumberFormat.getInstance().format(Utils.FILES_SCANNED)));
|
||||
.setSubText(NumberFormat.getInstance().format(Database.signaturesCount) + " sigs" + " • " + getString(R.string.main_files_scanned_count, NumberFormat.getInstance().format(Utils.FILES_SCANNED)));
|
||||
notificationManager.notify(-1, foregroundNotification.build());
|
||||
}
|
||||
|
||||
|
|
4
fastlane/metadata/android/en-US/changelogs/119.txt
Normal file
4
fastlane/metadata/android/en-US/changelogs/119.txt
Normal file
|
@ -0,0 +1,4 @@
|
|||
* Show the approximate signature count
|
||||
* Unbreak hash processing: md5 & sha1 were getting mixed up for years
|
||||
* Add many checks to database processing
|
||||
* Ignore hashes of empty content
|
Loading…
Add table
Reference in a new issue