Сравнить коммиты
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
42d5584d8d | ||
|
|
ff88682e40 | ||
|
|
307e692459 | ||
|
|
b7ec644ecf | ||
|
|
842baa2aec | ||
|
|
26bc92cf8e |
+12
-8
@@ -2,15 +2,15 @@ apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
compileSdkVersion 31
|
||||
|
||||
defaultConfig {
|
||||
applicationId 'org.traccar.client'
|
||||
buildConfigField 'boolean', 'HIDDEN_APP', 'false'
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 30
|
||||
versionCode 73
|
||||
versionName '6.12'
|
||||
targetSdkVersion 31
|
||||
versionCode 74
|
||||
versionName '6.13'
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
@@ -47,20 +47,24 @@ android {
|
||||
}
|
||||
|
||||
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.preference:preference-ktx:1.1.1'
|
||||
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 'com.github.judemanutd:autostarter:1.1.0'
|
||||
implementation('dev.doubledot.doki:library:0.0.1@aar') {
|
||||
transitive = true
|
||||
}
|
||||
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 'com.google.firebase:firebase-core'
|
||||
googleImplementation 'com.google.firebase:firebase-analytics'
|
||||
googleImplementation 'com.google.firebase:firebase-crashlytics'
|
||||
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')) {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
tools:replace="android:label">
|
||||
|
||||
<activity
|
||||
android:name="org.traccar.client.MainActivity">
|
||||
android:name="org.traccar.client.MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter android:label="@string/app_name">
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
@@ -18,7 +19,9 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<receiver android:name="org.traccar.client.DialLaunchReceiver" >
|
||||
<receiver
|
||||
android:name="org.traccar.client.DialLaunchReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
|
||||
</intent-filter>
|
||||
|
||||
@@ -34,10 +34,12 @@
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask" />
|
||||
|
||||
<activity-alias
|
||||
android:name=".Launcher"
|
||||
android:exported="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -48,10 +50,13 @@
|
||||
android:resource="@xml/shortcuts" />
|
||||
</activity-alias>
|
||||
|
||||
<activity android:name=".StatusActivity"/>
|
||||
<activity
|
||||
android:name=".StatusActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<activity
|
||||
android:name=".ShortcutActivity"
|
||||
android:exported="true"
|
||||
android:label="@string/menu_shortcuts">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -61,12 +66,16 @@
|
||||
|
||||
<service
|
||||
android:name=".TrackingService"
|
||||
android:exported="false"
|
||||
android:foregroundServiceType="location" />
|
||||
|
||||
<service
|
||||
android:name=".TrackingService$HideNotificationService" />
|
||||
android:name=".TrackingService$HideNotificationService"
|
||||
android:exported="false" />
|
||||
|
||||
<receiver android:name=".AutostartReceiver">
|
||||
<receiver
|
||||
android:name=".AutostartReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
</intent-filter>
|
||||
|
||||
@@ -25,6 +25,7 @@ import android.os.PowerManager
|
||||
import android.provider.Settings
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.judemanutd.autostarter.AutoStartPermissionHelper
|
||||
|
||||
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 {
|
||||
private const val KEY_EXCEPTION_REQUESTED = "exceptionRequested"
|
||||
private const val KEY_AUTOSTART_REQUESTED = "autostartRequested"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.preference.TwoStatePreference
|
||||
import dev.doubledot.doki.ui.DokiActivity
|
||||
import java.util.*
|
||||
import kotlin.collections.HashSet
|
||||
|
||||
@@ -92,7 +93,13 @@ class MainFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListene
|
||||
alarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||
val originalIntent = Intent(activity, AutostartReceiver::class.java)
|
||||
originalIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
|
||||
alarmIntent = PendingIntent.getBroadcast(activity, 0, originalIntent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
|
||||
val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
PendingIntent.FLAG_MUTABLE
|
||||
} else {
|
||||
0
|
||||
}
|
||||
alarmIntent = PendingIntent.getBroadcast(activity, 0, originalIntent, flags)
|
||||
|
||||
if (sharedPreferences.getBoolean(KEY_STATUS, false)) {
|
||||
startTrackingService(checkPermission = true, initialPermission = false)
|
||||
@@ -190,6 +197,9 @@ class MainFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListene
|
||||
if (item.itemId == R.id.status) {
|
||||
startActivity(Intent(activity, StatusActivity::class.java))
|
||||
return true
|
||||
} else if (item.itemId == R.id.info) {
|
||||
DokiActivity.start(requireContext())
|
||||
return true
|
||||
}
|
||||
return super.onOptionsItemSelected(item)
|
||||
}
|
||||
|
||||
@@ -122,7 +122,12 @@ class TrackingService : Service() {
|
||||
} else {
|
||||
intent = Intent(Settings.ACTION_SETTINGS)
|
||||
}
|
||||
builder.setContentIntent(PendingIntent.getActivity(context, 0, intent, 0))
|
||||
val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
PendingIntent.FLAG_IMMUTABLE
|
||||
} else {
|
||||
PendingIntent.FLAG_UPDATE_CURRENT
|
||||
}
|
||||
builder.setContentIntent(PendingIntent.getActivity(context, 0, intent, flags))
|
||||
return builder.build()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,9 @@
|
||||
android:title="@string/menu_status"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/info"
|
||||
android:title="@string/menu_info"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
</menu>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<string name="settings_foreground_title">Foreground service</string>
|
||||
<string name="settings_foreground_summary">Increase service priority</string>
|
||||
<string name="menu_status">Status</string>
|
||||
<string name="menu_info">Info</string>
|
||||
<string name="menu_shortcuts">Add shortcuts</string>
|
||||
<string name="menu_clear">Clear</string>
|
||||
<string name="status_service_create">Service started</string>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
<base-config cleartextTrafficPermitted="true">
|
||||
<trust-anchors>
|
||||
<certificates src="system" />
|
||||
<certificates src="user" />
|
||||
</trust-anchors>
|
||||
</base-config>
|
||||
</network-security-config>
|
||||
|
||||
+3
-2
@@ -1,11 +1,11 @@
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.5.30'
|
||||
ext.kotlin_version = '1.5.31'
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
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.firebase:firebase-crashlytics-gradle:2.7.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
@@ -16,5 +16,6 @@ allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
maven { url 'https://jitpack.io' }
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user