AndroidX migration

This commit is contained in:
Tad 2019-02-12 16:19:46 -05:00
parent 24c81c7f81
commit 58fc8be965
21 changed files with 43 additions and 140 deletions

View file

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WizardSettings">
<option name="children">
<map>
<entry key="imageWizard">
<value>
<PersistentState />
</value>
</entry>
<entry key="vectorWizard">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="vectorAssetStep">
<value>
<PersistentState>
<option name="children">
<map>
<entry key="clipartAsset">
<value>
<PersistentState>
<option name="values">
<map>
<entry key="url" value="jar:file:/app/extra/plugins/android/lib/android.jar!/images/material_design_icons/file/ic_cloud_download_black_24dp.xml" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
<option name="values">
<map>
<entry key="outputName" value="ic_cloud_download_24dp" />
<entry key="sourceFile" value="$USER_HOME$" />
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</PersistentState>
</value>
</entry>
</map>
</option>
</component>
</project>

Binary file not shown.

BIN
.idea/caches/gradle_models.ser generated Normal file

Binary file not shown.

View file

@ -1,11 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="tad">
<words>
<w>autostart</w>
<w>eicar</w>
<w>hypatia</w>
<w>malware</w>
<w>realtime</w>
</words>
</dictionary>
</component>

9
.idea/gradle.xml generated
View file

@ -3,14 +3,11 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<compositeConfiguration>
<compositeBuild compositeDefinitionSource="SCRIPT" />
</compositeConfiguration>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="/mnt/Drive-1/Development/Java/Android_Workspace/Veritas" />
<option value="/mnt/Drive-1/Development/Java/Android_Workspace/Veritas/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>

45
.idea/misc.xml generated
View file

@ -1,49 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
<component name="CMakeSettings">
<configurations>
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
</configurations>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>Android API 19 Platform</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>

4
.idea/modules.xml generated
View file

@ -2,8 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file:///mnt/Drive-1/Development/Java/Android_Workspace/Veritas/Veritas.iml" filepath="/mnt/Drive-1/Development/Java/Android_Workspace/Veritas/Veritas.iml" />
<module fileurl="file:///mnt/Drive-1/Development/Java/Android_Workspace/Veritas/app/app.iml" filepath="/mnt/Drive-1/Development/Java/Android_Workspace/Veritas/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/Veritas.iml" filepath="$PROJECT_DIR$/Veritas.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>

2
.idea/vcs.xml generated
View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="/mnt/Drive-1/Development/Java/Android_Workspace/Veritas" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

View file

@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
compileSdkVersion 28
defaultConfig {
applicationId "us.spotco.malwarescanner"
minSdkVersion 16
@ -30,9 +30,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:preference-v7:26.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'com.google.android.material:material:1.1.0-alpha03'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.1.0-alpha03'
}

View file

@ -2,7 +2,7 @@ package us.spotco.malwarescanner;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View file

@ -19,7 +19,7 @@ package us.spotco.malwarescanner;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View file

@ -20,13 +20,13 @@ package us.spotco.malwarescanner;
import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import androidx.annotation.NonNull;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.core.content.ContextCompat;
import android.view.MenuItem;
public class MainActivity extends FragmentActivity {

View file

@ -27,7 +27,7 @@ import android.os.Build;
import android.os.Environment;
import android.os.FileObserver;
import android.os.IBinder;
import android.support.v4.app.NotificationCompat;
import androidx.core.app.NotificationCompat;
import java.io.File;
import java.util.HashSet;
@ -79,7 +79,7 @@ public class MalwareScannerService extends Service {
notificationManager = (NotificationManager) getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel foregroundChannel = new NotificationChannel("FOREGROUND", getString(R.string.notif_scanner_realtime), NotificationManager.IMPORTANCE_LOW);
foregroundChannel.setDescription(getString(R.string.notif_scanner_realtime_summary));
foregroundChannel.setDescription(getString(R.string.notif_scanner_realtime_channel));
foregroundChannel.setShowBadge(false);
notificationManager.createNotificationChannel(foregroundChannel);
}
@ -122,7 +122,7 @@ public class MalwareScannerService extends Service {
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_notification)
.setContentTitle(getText(R.string.notif_scanner_realtime))
.setContentText(getText(R.string.notif_scanner_realtime_summary))
.setContentText(getText(R.string.notif_scanner_realtime_context))
.setPriority(Notification.PRIORITY_MIN)
.setShowWhen(false);

View file

@ -19,7 +19,7 @@ package us.spotco.malwarescanner;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View file

@ -21,8 +21,8 @@ package us.spotco.malwarescanner;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.preference.PreferenceFragmentCompat;
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceFragmentCompat;
import android.widget.Toast;
/**

View file

@ -59,7 +59,7 @@ public class Utils {
public static int getMaxThreads() {
int maxThreads = Runtime.getRuntime().availableProcessors();
if (maxThreads >= 2) {
if (maxThreads >= 4) {
maxThreads /= 2;
}
return maxThreads;

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout 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"
android:id="@+id/main_container"
@ -16,7 +16,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.design.widget.BottomNavigationView
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -28,4 +28,4 @@
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/navigation" />
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -10,7 +10,8 @@
<!-- START NOTIFICATIONS -->
<string name="notif_scanner_realtime">Malware Detection</string>
<string name="notif_scanner_realtime_summary">Used to alert when malware is detected</string>
<string name="notif_scanner_realtime_channel">Used to alert when malware is detected</string>
<string name="notif_scanner_realtime_context">Malware will be detected in realtime</string>
<!-- END NOTIFICATIONS -->
<!-- START TOASTS -->

View file

@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.android.tools.build:gradle:3.3.1'
// NOTE: Do not place your application dependencies here; they belong

View file

@ -9,6 +9,8 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.

View file

@ -1,6 +1,6 @@
#Wed Dec 13 22:17:06 EST 2017
#Tue Feb 12 16:15:07 GMT-05:00 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip