Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/active_development'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
Ixam97 committed Aug 28, 2024
2 parents fe203ef + b362cda commit 0f17f2a
Show file tree
Hide file tree
Showing 194 changed files with 8,672 additions and 2,234 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: set up JDK 11
- name: set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Make gradlew executable
run: chmod +x ./gradlew
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ proguard-project.txt
credentials.xml
/automotive/stable/
/automotive/debug/
/.kotlin/
25 changes: 25 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog [DE]:

## 0.27.3
- Zusätzliche Fartbeginn-Bedingungen hinzugefügt (z.B. für den Volvo EX30).

## 0.27.2
- Fehlerbehandlung und Logging beim Wechsel von Trips hinzugefügt.

## 0.27.1
- (Play Edition) Das Legacy Dashboard und der Tripverlauf wurden aufgrund von Einschränkungen durch Google-Richtlinien vorübergehend deaktiviert.
- (Play Edition) Abstürze bei der Erstellung von Changelogs werden abgefangen.
- (Play Edition) Fehler behoben, bei dem das interagieren mit Benachrichtigungen zu Abstürzen führt.
- Abstürze beim Speichern von Tripdaten behoben.
- Absturzmeldungen verbessert.

## 0.27.0
- Implementierung des Automotive App Host für einen potentiellen öffentlichen Release im Play Store (nicht in klassischen Builds enthalten).
- Implementierung von Firebase Crashlytics. Kann in den Einstellungen deaktivert werden.
- Die Art und Weise, wie Changelogs generiert werden, wurde überarbeitet.
- Die Ladekurve wird in der Tripzusammenfassung nicht mehr bei 160 kW abgeschnitten.
- Der Datenbank-Upload läuft nun in einem eigenen Dienst. Es muss nicht länger der Tripverlauf geöffnet bleiben. Eine Benachrichtigung informiert über den Fortschritt.
- Der Datenbank-Upload enthält nun Ladekurven.
- Der Webhook füllt nun das Feld \"charged_soc\" am Ende eines Ladevorgangs aus.
- Datenbankzugriffe reduziert durch das verwenden der Debug-Einstellung bei der Speicherung von Logs.
- Debug-Logs werden nach 28 Tagen ein Mal täglich gelöscht.
- Fehler beim Anwenden des experimentellen Farbschemas behoben.

## 0.26.2
- Verbesserung der Diagramm-Steuerelemente in der Tripzusammenfassung
- Defektes Layout nach Polestar OTA P3.0.3 behoben
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

Currently the app is not available in the public Play Store. This is due to strict requirements by Google what kind of apps are allowed to be installed on cars. As of now the App is only available via internal test tracks which are limited to 100 users each. Here you can find a listing of all available Test Tracks: [Polestar Club](https://polestar.fans/t/carstatsviewer-informationen/15027)

There are currently ongoing talks with Polestar to find ways of bringing the app to a broader audience. Though Polestar won't release the app themselves as a publisher, progress has been made for a public release by myself. The "Play Edition" is currently in an Closed Alpha Test which has passed the Google Review. Read more aobut it in [Issue #225](https://github.com/Ixam97/CarStatsViewer/issues/225).

**Please note:** The dashboard known from previous versions of the app (now called "Legacy") cannot be shown while driving! If you are already participating in one of the many internal test tracks, you won't have a benefit from this version of the app. If the legacy dashboard is important to you, I recommend to keep using the internal test track. However, feedback on the "Play Edition" is welcome from everybody. The apps can be installed and used in parallel without problem.
There are currently ongoing talks with Polestar to find ways of bringing the app to a broader audience. Though Polestar won't release the app themselves as a publisher, progress has been made for a public release by myself. The app is currently in an Closed Alpha Test which has passed the Google Review. Read more about it in [Issue #225](https://github.com/Ixam97/CarStatsViewer/issues/225).

## Using the webhook API

Expand Down
133 changes: 98 additions & 35 deletions automotive/build.gradle
Original file line number Diff line number Diff line change
@@ -1,43 +1,75 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.kotlinKapt)
alias(libs.plugins.composeCompiler)
}

def firebase = useFirbase.toBoolean()
def mapbox = useMapbox.toBoolean()

if (firebase) {
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
}

android {
compileSdkVersion 33
compileSdk 34

defaultConfig {
minSdkVersion 29
targetSdkVersion 33
versionCode 217
versionName "0.26.2.0002"
targetSdkVersion 34
versionCode 266
versionName "0.27.3.0001"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "version"

flavorDimensions = ["version", "aaos"]

productFlavors {
stable {
dimension "version"
resValue("string","useFirebase", firebase.toString())
}

legacy {
dimension "aaos"
applicationId "com.ixam97.carStatsViewer"
}

carapp {
dimension "aaos"
applicationId "de.ixam97.carStatsViewer.carApp"
}

dev {
dimension "version"
applicationId "com.ixam97.carStatsViewer_dev"
resValue("string","useFirebase", firebase.toString())
}
}

// use a dummy if mapbox api is not configured
if (mapbox) {
sourceSets.main.java.srcDirs += ['src/mapbox/java']
} else {
sourceSets.main.java.srcDirs += ['src/mapboxdummy/java']
}

buildTypes {
release {
minifyEnabled false
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

buildFeatures {
viewBinding true
buildConfig true
}

packagingOptions {
Expand All @@ -63,6 +95,19 @@ android {
// android.car exists since Android 10 (API level 29) Revision 5.
useLibrary 'android.car'
namespace 'com.ixam97.carStatsViewer'

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
compose true
}
}

aboutLibraries {
Expand All @@ -71,30 +116,48 @@ aboutLibraries {
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.activity:activity-ktx:1.6.1'
implementation 'androidx.fragment:fragment-ktx:1.5.5'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation "androidx.appcompat:appcompat:1.6.1"
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.1'
implementation 'org.eclipse.angus:jakarta.mail:2.0.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.mikepenz:aboutlibraries-core:10.6.1'
implementation 'com.airbnb.android:paris:2.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.github.matthiaszimmermann:EGM96:master-SNAPSHOT'

implementation("androidx.room:room-ktx:2.5.0")
kapt("androidx.room:room-compiler:2.5.0")

debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
// implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation libs.kotlin.stdlib
implementation libs.androidx.ktx
implementation libs.androidx.activity
implementation libs.androidx.fragment
implementation libs.androidx.recyclerview
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.google.gson
implementation libs.google.gms.location
implementation libs.kotlinx.coroutines.android
implementation libs.kotlinx.coroutines.play.services
implementation libs.jakarta.mail
implementation libs.aboutlibraries.core
implementation libs.airbnb.paris
implementation libs.github.egm96

implementation libs.androidx.car.app
implementation libs.androidx.car.app.automotive

if (mapbox) {
implementation('com.mapbox.maps:android:11.6.0')
}

implementation libs.androidx.activity.compose
implementation libs.androidx.compose.ui
implementation libs.androidx.compose.material
implementation libs.androidx.lifecycle.viewmodel.compose
implementation libs.androidx.navigation.compose
implementation libs.kotlinx.serialization.json

implementation libs.androidx.room
kapt libs.androidx.room.compiler

implementation(platform("com.google.firebase:firebase-bom:33.1.2"))
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-analytics")

debugImplementation libs.squareup.leakcanary

// to fix unresolved references to android.car
def sdkDir = project.android.sdkDirectory.canonicalPath
def androidCarJar = "$sdkDir/platforms/android-33/optional/android.car.jar"
implementation(files(androidCarJar))
// def sdkDir = project.android.sdkDirectory.canonicalPath
// def androidCarJar = "$sdkDir/platforms/android-33/optional/android.car.jar"
// implementation(files(androidCarJar))
}
7 changes: 7 additions & 0 deletions automotive/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-keepclassmembers class com.ixam97.carStatsViewer.liveDataApi.http.HttpDataSet {!transient <fields>;}
-keepclassmembers class com.ixam97.carStatsViewer.database.tripData.DrivingPoint {!transient <fields>;}
-keepclassmembers class com.ixam97.carStatsViewer.database.tripData.ChargingSession {!transient <fields>;}
-keepclassmembers class com.ixam97.carStatsViewer.database.tripData.ChargingPoint {!transient <fields>;}
-keepclassmembers class com.ixam97.carStatsViewer.liveDataApi.abrpLiveData.AbrpDataSet {!transient <fields>;}

-keepattributes LineNumberTable,SourceFile
96 changes: 96 additions & 0 deletions automotive/src/carapp/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
android:name="android.software.car.templates_host"
android:required="true" />
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<uses-feature
android:name="android.hardware.screen.portrait"
android:required="false" />
<uses-feature
android:name="android.hardware.screen.landscape"
android:required="false" />

<application
android:name=".CarStatsViewer"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:hasFragileUserData="true"
android:theme="@style/AppTheme">
<receiver android:name=".AutoStartReceiver"
android:exported="true"
android:enabled="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
<intent-filter>
<action android:name="com.ixam97.carStatsViewer.RestartAction" />
</intent-filter>
<intent-filter>
<action android:name="com.ixam97.carStatsViewer.NOTIFICATION_DELETE" />
</intent-filter>
</receiver>
<service
android:name=".carApp.CarStatsViewerService"
android:exported="true">
<intent-filter>
<action android:name="androidx.car.app.CarAppService"/>
<category android:name="androidx.car.app.category.IOT"/>
</intent-filter>
</service>


<activity
android:exported="true"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
android:name="androidx.car.app.activity.CarAppActivity"
android:launchMode="singleTask"
android:label="@string/app_name">

<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="distractionOptimized" android:value="true"/>
</activity>

<activity android:name=".ui.activities.PermissionsActivity" android:exported="false" />
<!--<activity android:name=".ui.activities.MainActivity" android:exported="true" />-->
<activity android:name=".ui.activities.SettingsActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES"/>
</intent-filter>
</activity>
<!--<activity android:name=".ui.activities.HistoryActivity" android:exported="true" />-->
<activity android:name=".ui.activities.SettingsMainViewActivity" android:exported="false"/>
<!--<activity android:name=".ui.activities.SettingsVehicleActivity" android:exported="false"/>-->
<activity android:name=".ui.activities.LibsActivity" android:exported="false" />
<activity android:name=".ui.activities.AboutActivity" android:exported="false" />
<activity android:name=".ui.activities.SettingsApisActivity" android:exported="false" />
<activity android:name=".ui.activities.DebugActivity" android:exported="false" />
<activity android:name=".compose.ComposeSettingsActivity" android:exported="false" />

<meta-data android:name="com.android.automotive"
android:resource="@xml/automotive_app_desc"/>
<meta-data
android:name="androidx.car.app.minCarApiLevel"
android:value="6"/>
<service android:name=".dataCollector.DataCollector"
android:foregroundServiceType="location"
android:enabled="true"
android:exported="true"/>
<service android:name=".liveDataApi.uploadService.UploadService"
android:enabled="true"
android:exported="true"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.ixam97.carStatsViewer.carApp

import android.content.pm.ApplicationInfo
import androidx.car.app.CarAppService
import androidx.car.app.Session
import androidx.car.app.SessionInfo
import androidx.car.app.validation.HostValidator


class CarStatsViewerService : CarAppService() {
override fun onCreateSession(sessionInfo: SessionInfo): Session {
return CarStatsViewerSession()
}

override fun createHostValidator(): HostValidator {
return if (applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0) {
HostValidator.ALLOW_ALL_HOSTS_VALIDATOR
} else {
HostValidator.Builder(applicationContext)
.addAllowedHosts(androidx.car.app.R.array.hosts_allowlist_sample)
.build()
}
}
}
Loading

0 comments on commit 0f17f2a

Please sign in to comment.