Skip to content

Commit

Permalink
Address code analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-delbusso committed Mar 22, 2021
1 parent 2db7771 commit 491a8f1
Show file tree
Hide file tree
Showing 25 changed files with 74 additions and 250 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: "Create Release"

on:
push:
tags:
- "v*"
push:
tags:
- "v*"

jobs:
pre-release:
name: "Create Release"
runs-on: "ubuntu-latest"
pre-release:
name: "Create Release"
runs-on: "ubuntu-latest"

steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
*
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
*
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ out/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/
Expand All @@ -57,7 +56,6 @@ proguard/
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
Expand All @@ -76,7 +74,6 @@ captures/
#*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
Expand Down Expand Up @@ -146,7 +143,6 @@ hs_err_pid*
# Generated files

# Gradle files
.gradle

# Signing files
.signing/
Expand Down Expand Up @@ -205,7 +201,6 @@ obj/
.idea/jarRepositories.xml

# OS-specific files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
Expand Down
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ plugins {

android {
compileSdkVersion 28
buildToolsVersion "30.0.2"
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.example.prj_android_app"
minSdkVersion 26
//noinspection OldTargetApi
targetSdkVersion 28
versionCode 1
versionName "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import android.os.Bundle;
import android.util.Log;

import com.prj.app.services.WifiScanningService;
import com.prj.app.managers.DatabaseManager;
import com.prj.app.managers.NotificationManager;
import com.prj.app.services.WifiScanningService;
import com.prj.app.ui.MainActivity;

import org.jetbrains.annotations.NotNull;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/prj/app/logic/BSSIDMatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import android.widget.TextView;

import com.android.volley.Request;
import com.prj.app.util.Scan;
import com.prj.app.api.CustomJsonArrayRequest;
import com.prj.app.api.VolleySingleton;
import com.prj.app.managers.DatabaseManager;
import com.prj.app.managers.NotificationManager;
import com.prj.app.util.Scan;

import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
Expand Down Expand Up @@ -91,7 +91,7 @@ private void sendMatchingBSSIDsPOST(@NotNull String URL, @NotNull JSONObject jso
/**
* Match given JSONArray of scan data with local storage
*
* @param matchingScans a JSONArray of remote postive scans;
* @param matchingScans a JSONArray of remote positive scans;
*/
private void matchResult(@NotNull JSONArray matchingScans) {
List<Scan> localScans = databaseManager.getScanData();
Expand All @@ -110,7 +110,7 @@ private void matchResult(@NotNull JSONArray matchingScans) {
localScans = removeUnusedLocalScans(localScans, remoteScans);
//sort by timestamp
localScans.sort(Comparator.comparing(Scan::getTimestamp));
localScans = removeNonConcurrentScans(localScans); //filter out scans that don't have at least 2 mins of the same bssid
localScans = removeNonConcurrentScans(localScans); //filter out scans that don't have at least 2 minutes of the same bssid

remoteScans.sort(Comparator.comparing(Scan::getTimestamp));
localScans.sort(Comparator.comparing(Scan::getTimestamp));
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/prj/app/managers/ScanManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;

import com.prj.app.managers.DatabaseManager;

import java.util.List;

public class ScanManager {
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/prj/app/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import androidx.work.PeriodicWorkRequest;
import androidx.work.WorkManager;

import com.prj.app.workers.DummyUploadWorker;
import com.prj.app.workers.ExposureWorker;
import com.prj.app.managers.NotificationManager;
import com.prj.app.R;
import com.prj.app.managers.NotificationManager;
import com.prj.app.services.WifiScanningService;
import com.prj.app.workers.DummyUploadWorker;
import com.prj.app.workers.ExposureWorker;
import com.skyfishjy.library.RippleBackground;

import org.jetbrains.annotations.NotNull;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/prj/app/ui/SettingsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
import androidx.appcompat.app.AppCompatActivity;

import com.android.volley.Request;
import com.prj.app.logic.BSSIDMatcher;
import com.prj.app.R;
import com.prj.app.api.CustomJsonArrayRequest;
import com.prj.app.api.VolleySingleton;
import com.prj.app.logic.BSSIDMatcher;
import com.prj.app.managers.DatabaseManager;
import com.prj.app.R;
import com.prj.app.util.Scan;
import com.prj.app.api.VolleySingleton;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/prj/app/ui/UploadDataActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import com.android.volley.Request;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.prj.app.managers.DatabaseManager;
import com.prj.app.R;
import com.prj.app.util.Scan;
import com.prj.app.api.VolleySingleton;
import com.prj.app.managers.DatabaseManager;
import com.prj.app.util.Scan;

import org.json.JSONArray;
import org.json.JSONException;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/com/prj/app/util/Scan.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import java.util.List;

public class Scan implements Comparable<Scan> {
String bssid;
Double distance;
Date timestamp;
final String bssid;
final Double distance;
final Date timestamp;

public Scan(String bssid, Double distance, Date timestamp) {
this.bssid = bssid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
import com.android.volley.Request;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.prj.app.api.VolleySingleton;
import com.prj.app.managers.DatabaseManager;
import com.prj.app.util.Scan;
import com.prj.app.api.VolleySingleton;

import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
Expand Down
16 changes: 0 additions & 16 deletions app/src/main/res/drawable-anydpi/ic_stat_name.xml

This file was deleted.

Binary file removed app/src/main/res/drawable-hdpi/ic_stat_name.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-mdpi/ic_stat_name.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xhdpi/ic_stat_name.png
Binary file not shown.
Binary file removed app/src/main/res/drawable-xxhdpi/ic_stat_name.png
Binary file not shown.
13 changes: 9 additions & 4 deletions app/src/main/res/drawable/ic_coronavirus.xml

Large diffs are not rendered by default.

170 changes: 0 additions & 170 deletions app/src/main/res/drawable/ic_launcher_background.xml

This file was deleted.

Loading

0 comments on commit 491a8f1

Please sign in to comment.