Этот коммит содержится в:
Anton Tananaev
2021-10-09 17:40:27 -07:00
родитель 842baa2aec
Коммит b7ec644ecf
4 изменённых файлов: 21 добавлений и 11 удалений
+7 -6
Просмотреть файл
@@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
android { android {
compileSdkVersion 30 compileSdkVersion 31
defaultConfig { defaultConfig {
applicationId 'org.traccar.client' applicationId 'org.traccar.client'
buildConfigField 'boolean', 'HIDDEN_APP', 'false' buildConfigField 'boolean', 'HIDDEN_APP', 'false'
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 30 targetSdkVersion 31
versionCode 73 versionCode 73
versionName '6.12' versionName '6.12'
multiDexEnabled true multiDexEnabled true
@@ -47,20 +47,21 @@ android {
} }
dependencies { dependencies {
implementation 'com.google.android.material:material:1.5.0-alpha02' implementation 'com.google.android.material:material:1.5.0-alpha04'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.preference:preference-ktx:1.1.1' implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.test:core-ktx:1.4.0' implementation 'androidx.test:core-ktx:1.4.0'
implementation "androidx.core:core-ktx:1.6.0" implementation 'androidx.core:core-ktx:1.6.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.github.judemanutd:autostarter:1.1.0'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.1' testImplementation 'org.robolectric:robolectric:4.6.1'
googleImplementation platform('com.google.firebase:firebase-bom:28.2.1') googleImplementation platform('com.google.firebase:firebase-bom:28.2.1')
googleImplementation 'com.google.firebase:firebase-core' googleImplementation 'com.google.firebase:firebase-core'
googleImplementation 'com.google.firebase:firebase-analytics' googleImplementation 'com.google.firebase:firebase-analytics'
googleImplementation 'com.google.firebase:firebase-crashlytics' googleImplementation 'com.google.firebase:firebase-crashlytics'
googleImplementation 'com.google.android.gms:play-services-location:18.0.0' googleImplementation 'com.google.android.gms:play-services-location:18.0.0'
googleImplementation 'com.google.android.play:core:1.10.0' googleImplementation 'com.google.android.play:core:1.10.2'
} }
if (getGradle().getStartParameter().getTaskRequests().toString().contains('Google')) { if (getGradle().getStartParameter().getTaskRequests().toString().contains('Google')) {
+7 -3
Просмотреть файл
@@ -38,7 +38,8 @@
<activity-alias <activity-alias
android:name=".Launcher" android:name=".Launcher"
android:targetActivity=".MainActivity"> android:targetActivity=".MainActivity"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
@@ -52,7 +53,8 @@
<activity <activity
android:name=".ShortcutActivity" android:name=".ShortcutActivity"
android:label="@string/menu_shortcuts"> android:label="@string/menu_shortcuts"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.CREATE_SHORTCUT" /> <action android:name="android.intent.action.CREATE_SHORTCUT" />
@@ -66,7 +68,9 @@
<service <service
android:name=".TrackingService$HideNotificationService" /> android:name=".TrackingService$HideNotificationService" />
<receiver android:name=".AutostartReceiver"> <receiver
android:name=".AutostartReceiver"
android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter> </intent-filter>
+5
Просмотреть файл
@@ -25,6 +25,7 @@ import android.os.PowerManager
import android.provider.Settings import android.provider.Settings
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import com.judemanutd.autostarter.AutoStartPermissionHelper
class BatteryOptimizationHelper { class BatteryOptimizationHelper {
@@ -80,11 +81,15 @@ class BatteryOptimizationHelper {
} }
} }
} }
} else if (!sharedPreferences.getBoolean(KEY_AUTOSTART_REQUESTED, false)) {
sharedPreferences.edit().putBoolean(KEY_AUTOSTART_REQUESTED, true).apply()
AutoStartPermissionHelper.getInstance().getAutoStartPermission(context)
} }
} }
} }
companion object { companion object {
private const val KEY_EXCEPTION_REQUESTED = "exceptionRequested" private const val KEY_EXCEPTION_REQUESTED = "exceptionRequested"
private const val KEY_AUTOSTART_REQUESTED = "autostartRequested"
} }
} }
+2 -2
Просмотреть файл
@@ -1,11 +1,11 @@
buildscript { buildscript {
ext.kotlin_version = '1.5.30' ext.kotlin_version = '1.5.31'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.1' classpath 'com.android.tools.build:gradle:7.0.2'
classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"