Сравнить коммиты
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
826d638ea3 | ||
|
|
1b687bd075 | ||
|
|
42d5584d8d | ||
|
|
ff88682e40 | ||
|
|
307e692459 | ||
|
|
b7ec644ecf | ||
|
|
842baa2aec | ||
|
|
26bc92cf8e |
+12
-8
@@ -2,15 +2,15 @@ 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 75
|
||||||
versionName '6.12'
|
versionName '6.14'
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,20 +47,24 @@ 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'
|
||||||
|
implementation('dev.doubledot.doki:library:0.0.1@aar') {
|
||||||
|
transitive = true
|
||||||
|
}
|
||||||
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')) {
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
tools:replace="android:label">
|
tools:replace="android:label">
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name="org.traccar.client.MainActivity">
|
android:name="org.traccar.client.MainActivity"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter android:label="@string/app_name">
|
<intent-filter android:label="@string/app_name">
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
@@ -18,7 +19,9 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<receiver android:name="org.traccar.client.DialLaunchReceiver" >
|
<receiver
|
||||||
|
android:name="org.traccar.client.DialLaunchReceiver"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
|
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|||||||
@@ -34,10 +34,12 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
|
android:exported="true"
|
||||||
android:launchMode="singleTask" />
|
android:launchMode="singleTask" />
|
||||||
|
|
||||||
<activity-alias
|
<activity-alias
|
||||||
android:name=".Launcher"
|
android:name=".Launcher"
|
||||||
|
android:exported="true"
|
||||||
android:targetActivity=".MainActivity">
|
android:targetActivity=".MainActivity">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -48,10 +50,13 @@
|
|||||||
android:resource="@xml/shortcuts" />
|
android:resource="@xml/shortcuts" />
|
||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
<activity android:name=".StatusActivity"/>
|
<activity
|
||||||
|
android:name=".StatusActivity"
|
||||||
|
android:exported="false" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ShortcutActivity"
|
android:name=".ShortcutActivity"
|
||||||
|
android:exported="true"
|
||||||
android:label="@string/menu_shortcuts">
|
android:label="@string/menu_shortcuts">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
@@ -61,12 +66,16 @@
|
|||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".TrackingService"
|
android:name=".TrackingService"
|
||||||
|
android:exported="false"
|
||||||
android:foregroundServiceType="location" />
|
android:foregroundServiceType="location" />
|
||||||
|
|
||||||
<service
|
<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>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|||||||
@@ -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,18 @@ class BatteryOptimizationHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (!sharedPreferences.getBoolean(KEY_AUTOSTART_REQUESTED, false)) {
|
||||||
|
sharedPreferences.edit().putBoolean(KEY_AUTOSTART_REQUESTED, true).apply()
|
||||||
|
try {
|
||||||
|
AutoStartPermissionHelper.getInstance().getAutoStartPermission(context)
|
||||||
|
} catch (e: SecurityException) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import androidx.preference.Preference
|
|||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
import androidx.preference.TwoStatePreference
|
import androidx.preference.TwoStatePreference
|
||||||
|
import dev.doubledot.doki.ui.DokiActivity
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.collections.HashSet
|
import kotlin.collections.HashSet
|
||||||
|
|
||||||
@@ -92,7 +93,13 @@ class MainFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListene
|
|||||||
alarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
alarmManager = requireActivity().getSystemService(Context.ALARM_SERVICE) as AlarmManager
|
||||||
val originalIntent = Intent(activity, AutostartReceiver::class.java)
|
val originalIntent = Intent(activity, AutostartReceiver::class.java)
|
||||||
originalIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
|
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)) {
|
if (sharedPreferences.getBoolean(KEY_STATUS, false)) {
|
||||||
startTrackingService(checkPermission = true, initialPermission = false)
|
startTrackingService(checkPermission = true, initialPermission = false)
|
||||||
@@ -190,6 +197,9 @@ class MainFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListene
|
|||||||
if (item.itemId == R.id.status) {
|
if (item.itemId == R.id.status) {
|
||||||
startActivity(Intent(activity, StatusActivity::class.java))
|
startActivity(Intent(activity, StatusActivity::class.java))
|
||||||
return true
|
return true
|
||||||
|
} else if (item.itemId == R.id.info) {
|
||||||
|
DokiActivity.start(requireContext())
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item)
|
return super.onOptionsItemSelected(item)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,12 @@ class TrackingService : Service() {
|
|||||||
} else {
|
} else {
|
||||||
intent = Intent(Settings.ACTION_SETTINGS)
|
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()
|
return builder.build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,4 +8,9 @@
|
|||||||
android:title="@string/menu_status"
|
android:title="@string/menu_status"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/info"
|
||||||
|
android:title="@string/menu_info"
|
||||||
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<string name="settings_foreground_title">Foreground service</string>
|
<string name="settings_foreground_title">Foreground service</string>
|
||||||
<string name="settings_foreground_summary">Increase service priority</string>
|
<string name="settings_foreground_summary">Increase service priority</string>
|
||||||
<string name="menu_status">Status</string>
|
<string name="menu_status">Status</string>
|
||||||
|
<string name="menu_info">Info</string>
|
||||||
<string name="menu_shortcuts">Add shortcuts</string>
|
<string name="menu_shortcuts">Add shortcuts</string>
|
||||||
<string name="menu_clear">Clear</string>
|
<string name="menu_clear">Clear</string>
|
||||||
<string name="status_service_create">Service started</string>
|
<string name="status_service_create">Service started</string>
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<network-security-config>
|
<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>
|
</network-security-config>
|
||||||
|
|||||||
+3
-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"
|
||||||
@@ -16,5 +16,6 @@ allprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user