Сравнить коммиты
| Автор | SHA1 | Дата | |
|---|---|---|---|
|
|
e8d5e5c99b | ||
|
|
c3980780d8 | ||
|
|
3c11216334 | ||
|
|
bcde8388d6 | ||
|
|
7f18915514 | ||
|
|
42ad669fca |
+17
-11
@@ -1,16 +1,16 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 27
|
compileSdkVersion 28
|
||||||
buildToolsVersion '27.0.3'
|
buildToolsVersion '28.0.2'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "org.traccar.client"
|
applicationId "org.traccar.client"
|
||||||
buildConfigField "boolean", "HIDDEN_APP", "false"
|
buildConfigField "boolean", "HIDDEN_APP", "false"
|
||||||
minSdkVersion 15
|
minSdkVersion 15
|
||||||
targetSdkVersion 27
|
targetSdkVersion 28
|
||||||
versionCode 47
|
versionCode 48
|
||||||
versionName '5.10'
|
versionName '5.11'
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
@@ -26,15 +26,21 @@ android {
|
|||||||
buildConfigField "boolean", "HIDDEN_APP", "true"
|
buildConfigField "boolean", "HIDDEN_APP", "true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testOptions {
|
||||||
|
unitTests {
|
||||||
|
includeAndroidResources = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'com.android.support:design:27.1.0'
|
implementation 'com.android.support:design:28.0.0-rc01'
|
||||||
compile 'com.mapzen.android:lost:3.0.4'
|
implementation 'com.mapzen.android:lost:3.0.4'
|
||||||
testCompile 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
testCompile 'org.robolectric:robolectric:3.6.1'
|
testImplementation 'org.robolectric:robolectric:3.8'
|
||||||
googleCompile 'com.google.firebase:firebase-core:11.8.0'
|
googleImplementation 'com.google.firebase:firebase-core:16.0.1'
|
||||||
googleCompile 'com.crashlytics.sdk.android:crashlytics:2.9.1'
|
googleImplementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Google")) {
|
if (getGradle().getStartParameter().getTaskRequests().toString().contains("Google")) {
|
||||||
|
|||||||
@@ -9,10 +9,12 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import java.util.Date;
|
|||||||
|
|
||||||
public class DatabaseHelper extends SQLiteOpenHelper {
|
public class DatabaseHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
public static final int DATABASE_VERSION = 2;
|
public static final int DATABASE_VERSION = 3;
|
||||||
public static final String DATABASE_NAME = "traccar.db";
|
public static final String DATABASE_NAME = "traccar.db";
|
||||||
|
|
||||||
public interface DatabaseHandler<T> {
|
public interface DatabaseHandler<T> {
|
||||||
@@ -80,7 +80,8 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
"speed REAL," +
|
"speed REAL," +
|
||||||
"course REAL," +
|
"course REAL," +
|
||||||
"accuracy REAL," +
|
"accuracy REAL," +
|
||||||
"battery REAL)");
|
"battery REAL," +
|
||||||
|
"mock INTEGER)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -100,6 +101,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
values.put("course", position.getCourse());
|
values.put("course", position.getCourse());
|
||||||
values.put("accuracy", position.getAccuracy());
|
values.put("accuracy", position.getAccuracy());
|
||||||
values.put("battery", position.getBattery());
|
values.put("battery", position.getBattery());
|
||||||
|
values.put("mock", position.getMock() ? 1 : 0);
|
||||||
|
|
||||||
db.insertOrThrow("position", null, values);
|
db.insertOrThrow("position", null, values);
|
||||||
}
|
}
|
||||||
@@ -133,6 +135,7 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||||||
position.setCourse(cursor.getDouble(cursor.getColumnIndex("course")));
|
position.setCourse(cursor.getDouble(cursor.getColumnIndex("course")));
|
||||||
position.setAccuracy(cursor.getDouble(cursor.getColumnIndex("accuracy")));
|
position.setAccuracy(cursor.getDouble(cursor.getColumnIndex("accuracy")));
|
||||||
position.setBattery(cursor.getDouble(cursor.getColumnIndex("battery")));
|
position.setBattery(cursor.getDouble(cursor.getColumnIndex("battery")));
|
||||||
|
position.setMock(cursor.getInt(cursor.getColumnIndex("mock")) > 0);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2015 - 2017 Anton Tananaev (anton.tananaev@gmail.com)
|
* Copyright 2015 - 2018 Anton Tananaev (anton.tananaev@gmail.com)
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -17,6 +17,7 @@ package org.traccar.client;
|
|||||||
|
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.location.LocationManager;
|
import android.location.LocationManager;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -37,6 +38,9 @@ public class Position {
|
|||||||
accuracy = location.getAccuracy();
|
accuracy = location.getAccuracy();
|
||||||
}
|
}
|
||||||
this.battery = battery;
|
this.battery = battery;
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||||
|
this.mock = location.isFromMockProvider();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long id;
|
private long id;
|
||||||
@@ -139,4 +143,14 @@ public class Position {
|
|||||||
this.battery = battery;
|
this.battery = battery;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean mock;
|
||||||
|
|
||||||
|
public boolean getMock() {
|
||||||
|
return mock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMock(boolean mock) {
|
||||||
|
this.mock = mock;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ public class ProtocolFormatter {
|
|||||||
.appendQueryParameter("accuracy", String.valueOf(position.getAccuracy()))
|
.appendQueryParameter("accuracy", String.valueOf(position.getAccuracy()))
|
||||||
.appendQueryParameter("batt", String.valueOf(position.getBattery()));
|
.appendQueryParameter("batt", String.valueOf(position.getBattery()));
|
||||||
|
|
||||||
|
if (position.getMock()) {
|
||||||
|
builder.appendQueryParameter("mock", String.valueOf(position.getMock()));
|
||||||
|
}
|
||||||
|
|
||||||
if (alarm != null) {
|
if (alarm != null) {
|
||||||
builder.appendQueryParameter("alarm", alarm);
|
builder.appendQueryParameter("alarm", alarm);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config>
|
||||||
|
<base-config cleartextTrafficPermitted="true" />
|
||||||
|
</network-security-config>
|
||||||
+3
-4
@@ -5,9 +5,9 @@ buildscript {
|
|||||||
maven { url 'https://maven.fabric.io/public' }
|
maven { url 'https://maven.fabric.io/public' }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.0.1'
|
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||||
classpath 'com.google.gms:google-services:3.1.1'
|
classpath 'com.google.gms:google-services:4.0.2'
|
||||||
classpath 'io.fabric.tools:gradle:1.25.1'
|
classpath 'io.fabric.tools:gradle:1.25.4'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,6 +15,5 @@ allprojects {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-all.zip
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user