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 {
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private boolean scanSystem = true;
|
private boolean scanSystem = false;
|
||||||
private boolean scanApps = true;
|
private boolean scanApps = true;
|
||||||
private boolean scanInternal = true;
|
private boolean scanInternal = true;
|
||||||
private boolean scanExternal = false;
|
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");
|
logView.append("\nDisclaimer: This is an extremely basic signature scanner\n\n");
|
||||||
|
|
||||||
final Database database = new Database(this, logView);
|
final Database database = new Database(this, logView);
|
||||||
|
|
||||||
if (!Database.doesDatabaseExist()) {
|
|
||||||
Database.updateDatabase(Database.signatureDatabases);
|
|
||||||
}
|
|
||||||
|
|
||||||
final MalwareScanner scanner = new MalwareScanner(this, logView);
|
final MalwareScanner scanner = new MalwareScanner(this, logView);
|
||||||
|
|
||||||
FloatingActionButton fab = findViewById(R.id.fab);
|
FloatingActionButton fab = findViewById(R.id.fab);
|
||||||
|
@ -61,6 +56,9 @@ public class MainActivity extends AppCompatActivity {
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
case R.id.mnuUpdateDatabase:
|
||||||
|
Database.updateDatabase(Database.signatureDatabases);
|
||||||
|
break;
|
||||||
case R.id.mnuScanSystem:
|
case R.id.mnuScanSystem:
|
||||||
scanSystem = !item.isChecked();
|
scanSystem = !item.isChecked();
|
||||||
item.setChecked(scanSystem);
|
item.setChecked(scanSystem);
|
||||||
|
|
|
@ -30,11 +30,11 @@ public class MalwareScanner {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startScanner(boolean scanSystem, boolean scanApps, boolean scanInternal, boolean scanExternal) {
|
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);
|
malwareScannerTask = new MalwareScannerTask().execute(scanSystem, scanApps, scanInternal, scanExternal);
|
||||||
//} else {
|
} else {
|
||||||
// log.append("No database found... download one first!\n");
|
log.append("No database found... download one first!\n");
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopScanner() {
|
public void stopScanner() {
|
||||||
|
|
|
@ -1,13 +1,16 @@
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
tools:context="us.spotco.malwarescanner.MainActivity">
|
tools:context="us.spotco.malwarescanner.MainActivity">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/mnuUpdateDatabase"
|
||||||
|
android:title="@string/lblUpdateDatabase" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/mnuScanSystem"
|
android:id="@+id/mnuScanSystem"
|
||||||
android:title="@string/lblScanSystem"
|
android:title="@string/lblScanSystem"
|
||||||
android:checkable="true"
|
android:checkable="true"
|
||||||
android:checked="true" />
|
android:checked="false" />
|
||||||
<item
|
<item
|
||||||
android:id="@+id/mnuScanApps"
|
android:id="@+id/mnuScanApps"
|
||||||
android:title="@string/lblScanApps"
|
android:title="@string/lblScanApps"
|
||||||
|
|
Loading…
Add table
Reference in a new issue