mirror of
https://github.com/MaintainTeam/Hypatia.git
synced 2025-03-01 05:48:23 +03:00
Add database update button
This commit is contained in:
parent
2973d57aaa
commit
8e4b5328bd
3 changed files with 14 additions and 13 deletions
|
@ -12,7 +12,7 @@ import android.widget.TextView;
|
|||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private boolean scanSystem = true;
|
||||
private boolean scanSystem = false;
|
||||
private boolean scanApps = true;
|
||||
private boolean scanInternal = true;
|
||||
private boolean scanExternal = false;
|
||||
|
@ -32,11 +32,6 @@ public class MainActivity extends AppCompatActivity {
|
|||
logView.append("\nDisclaimer: This is an extremely basic signature scanner\n\n");
|
||||
|
||||
final Database database = new Database(this, logView);
|
||||
|
||||
if (!Database.doesDatabaseExist()) {
|
||||
Database.updateDatabase(Database.signatureDatabases);
|
||||
}
|
||||
|
||||
final MalwareScanner scanner = new MalwareScanner(this, logView);
|
||||
|
||||
FloatingActionButton fab = findViewById(R.id.fab);
|
||||
|
@ -61,6 +56,9 @@ public class MainActivity extends AppCompatActivity {
|
|||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.mnuUpdateDatabase:
|
||||
Database.updateDatabase(Database.signatureDatabases);
|
||||
break;
|
||||
case R.id.mnuScanSystem:
|
||||
scanSystem = !item.isChecked();
|
||||
item.setChecked(scanSystem);
|
||||
|
|
|
@ -30,11 +30,11 @@ public class MalwareScanner {
|
|||
}
|
||||
|
||||
public void startScanner(boolean scanSystem, boolean scanApps, boolean scanInternal, boolean scanExternal) {
|
||||
//if(Database.doesDatabaseExist()) {
|
||||
if(Database.doesDatabaseExist()) {
|
||||
malwareScannerTask = new MalwareScannerTask().execute(scanSystem, scanApps, scanInternal, scanExternal);
|
||||
//} else {
|
||||
// log.append("No database found... download one first!\n");
|
||||
//}
|
||||
} else {
|
||||
log.append("No database found... download one first!\n");
|
||||
}
|
||||
}
|
||||
|
||||
public void stopScanner() {
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:context="us.spotco.malwarescanner.MainActivity">
|
||||
|
||||
<item
|
||||
android:id="@+id/mnuUpdateDatabase"
|
||||
android:title="@string/lblUpdateDatabase" />
|
||||
|
||||
<item
|
||||
android:id="@+id/mnuScanSystem"
|
||||
android:title="@string/lblScanSystem"
|
||||
android:checkable="true"
|
||||
android:checked="true" />
|
||||
android:checked="false" />
|
||||
<item
|
||||
android:id="@+id/mnuScanApps"
|
||||
android:title="@string/lblScanApps"
|
||||
|
|
Loading…
Add table
Reference in a new issue