Skip to content

Log matches and domains in main app screen. #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,16 @@ private void scanDomain(String domain) {
scannedDomains.add(domain);
if (Database.domains.mightContain(domain)) {
sendNotification(domain);
logDomains(domain);
}
}
}

private void logDomains(String link) {
link = link.replaceAll("\\.", "[.]");
HypatiaLogger.Log(getString(R.string.lblNotificationLinkDetection));
HypatiaLogger.Log("\"Domain:\" + link");
HypatiaLogger.Log(getString(R.string.see_notifications) + "\n");
}
private void sendNotification(String link) {
link = link.replaceAll("\\.", "[.]");
Notification.Builder mBuilder =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ private void logResult(String result, String hashsum) {
if (isCache) {
malwareDetect[1] = context.getString(R.string.cache_scan_result_deletion_warning);
}

HypatiaLogger.Log(context.getText(R.string.lblNotificationRealtimeDetection) + " " + malwareDetect[0]);
HypatiaLogger.Log("File:" + malwareDetect[1]);
HypatiaLogger.Log(context.getString(R.string.see_notifications) + "\n");

Notification.Builder mBuilder =
new Notification.Builder(context.getApplicationContext())
.setSmallIcon(R.drawable.ic_notification)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@
<string name="confirm_link_scanner_title">Enable link scanner?</string>
<string name="confirm_link_scanner_summary">[EXPERIMENTAL]\nThis will download an additional database of domains.\nAny domains found in screen content will be checked against the database.\nThis requires granting accessibility service permission manually.\nThis can have a substantial performance impact on screens with large amounts of text.</string>
<string name="cache_scan_result_deletion_warning">Since this was a share scan you should manually remove or quarantine the file!</string>
<string name="see_notifications">Please see Notifications to manage the infected file.</string>
</resources>
Loading