Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ jobs:
matrix:
target: [Android, Windows, Linux]
include:
- os: windows-2019
- os: windows-latest
target: Windows
build_target: windows
build_path: build\windows\runner\Release
asset_extension: .zip
asset_content_type: application/zip
- os: ubuntu-20.04
- os: ubuntu-latest
target: Linux
build_target: linux
build_path: build/linux/x64/release/bundle
asset_extension: .tar.gz
asset_content_type: application/gzip
- os: ubuntu-20.04
- os: ubuntu-latest
target: Android
build_target: apk
build_path: build/app/outputs/flutter-apk
Expand All @@ -45,11 +45,14 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev

- name: Install Android dependencies
if: matrix.target == 'Android'
uses: actions/setup-java@v1
uses: actions/setup-java@v5
with:
java-version: '12.x'
java-version: "17"
distribution: "microsoft"

- name: Enable desktop support
if: matrix.target != 'Android'
run: |
Expand All @@ -60,7 +63,7 @@ jobs:

# Checkout smarthome code, recreate missing files, and get packages.
- name: Checkout smarthome code
uses: actions/checkout@v2
uses: actions/checkout@v5
- run: flutter create . --project-name smarthome
- run: flutter pub get

Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ jobs:
draft-release:
name: Draft Github release
needs: generate-changelog
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Download changelog
uses: actions/download-artifact@v2
uses: actions/download-artifact@v5
with:
name: changelog
- name: Draft release with changelog
Expand All @@ -62,19 +62,19 @@ jobs:
matrix:
target: [Android, Windows, Linux]
include:
- os: windows-2019
- os: windows-latest
target: Windows
build_target: windows
build_path: build\windows\runner\Release
asset_extension: .zip
asset_content_type: application/zip
- os: ubuntu-20.04
- os: ubuntu-latest
target: Linux
build_target: linux
build_path: build/linux/x64/release/bundle
asset_extension: .tar.gz
asset_content_type: application/gzip
- os: ubuntu-20.04
- os: ubuntu-latest
target: Android
build_target: apk
build_path: build/app/outputs/flutter-apk
Expand All @@ -95,11 +95,14 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libx11-dev pkg-config cmake ninja-build libblkid-dev

- name: Install Android dependencies
if: matrix.target == 'Android'
uses: actions/setup-java@v1
uses: actions/setup-java@v5
with:
java-version: '12.x'
java-version: "17"
distribution: "microsoft"

- name: Enable desktop support
if: matrix.target != 'Android'
run: |
Expand All @@ -110,7 +113,7 @@ jobs:

# Checkout smarthome code, recreate missing files, and get packages.
- name: Checkout smarthome code
uses: actions/checkout@v2
uses: actions/checkout@v5
- run: flutter create . --project-name smarthome
- run: flutter pub get

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
.pub-cache/
.pub/
build/
android/app/.cxx/

# Android related
**/android/**/gradle-wrapper.jar
Expand Down
95 changes: 59 additions & 36 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,55 +1,78 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = "1.0"
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = '1.1'
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.1'
def str = ""
for (element in flutterVersionName.split("\\.")) {
str += element.toString().padLeft(2, "0")
}
flutterVersionCode = str + flutterVersionCode.padLeft(4, "0") //Use 4 left pads, to be compatible with the old mobile client versioning stuff

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def dartEnvironmentVariables = ["":""]

if (project.hasProperty('dart-defines')) {
dartEnvironmentVariables = project.property('dart-defines')
.split(',')
.collectEntries { entry ->
def pair = new String(entry.decodeBase64(), 'UTF-8').split('=')
[(pair.first()): pair.last()]
}
}
if (!dartEnvironmentVariables.containsKey('APPLICATION_ID')) {
dartEnvironmentVariables['APPLICATION_ID'] = 'de.airsphere.paxcontrol.client.mobile'
}

android {
compileSdkVersion 33
namespace = "de.susch19.smarthome"
compileSdk = flutter.compileSdkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
compileOptions {
coreLibraryDesugaringEnabled true

lintOptions {
disable 'InvalidPackage'
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}


defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "de.susch19.smarthome"
applicationId dartEnvironmentVariables.APPLICATION_ID
resValue "string", "app_name", "Smarthome"
minSdkVersion flutter.minSdkVersion
targetSdkVersion 31
minSdk flutter.minSdkVersion
targetSdk flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true

}

signingConfigs {
Expand All @@ -61,28 +84,28 @@ android {
}
}

buildTypes {
buildTypes {
release {
signingConfig signingConfigs.release
}
profile {
applicationIdSuffix ".profile"
versionNameSuffix "-profile"
resValue "string", "app_name", "Smarthome Profile"
// profile {
// applicationIdSuffix ".profile"
// versionNameSuffix "-profile"
// resValue "string", "app_name", "Smarthome Profile"

}
debug {
applicationIdSuffix ".debug"
versionNameSuffix "-debug"
resValue "string", "app_name", "Smarthome Debug"
}
// }
// debug {
// applicationIdSuffix ".debug"
// versionNameSuffix "-debug"
// resValue "string", "app_name", "Smarthome Debug"
// }
}
}

flutter {
source '../..'
source = "../.."
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
}
19 changes: 3 additions & 16 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
30 changes: 22 additions & 8 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.9.1" apply false
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
}

include ":app"
1 change: 0 additions & 1 deletion android/settings_aar.gradle

This file was deleted.

31 changes: 31 additions & 0 deletions assets/certs/Smarthome.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFVTCCAz2gAwIBAgIUXW1ShXyRiKCSivhA/2xKZAARk04wDQYJKoZIhvcNAQEL
BQAwOTEaMBgGA1UEAwwRU21hcnRob21lIFJvb3QgQ0ExCzAJBgNVBAYTAkRFMQ4w
DAYDVQQKDAVzdXNjaDAgFw0yNTAxMjYxNTUxMjBaGA8yMTI1MDEwMjE1NTEyMFow
OTEaMBgGA1UEAwwRU21hcn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
3g6c5W7VyY1dDgcUkSB6NFIjhU6PyL7acu7LsxNh+PQy0qifGAN/gK8D15GTIqEk
M3ytQTzzDA0fNpSaqzC5ErEx9ZSVOeHJLbf9k05aQXfL3UbkpXTtk26KrPnAwJs4
CBBUK+knCkiUxv1sHjpsmshyiGOhMCLXFrl/r89/mA1UNWkDB/AnTfTUGWz0xnWq
/2fwJ3gW9fSQWj6J2++g1m2UE/kGcDSH3K1L53jvRDlQrAlQFoPZwe+GN0cahEKu
a9xXnWGlUPZZZ7n2dEtSpgrnRwkblUzAiTXQ+booZOFXZxgQ+ARwYoc3v3TlePO8
zf596Wvf4LepoAK5GOoCEDI5wC5NwQBT6cizHNvVYDK1Lp4XjqEVN4IaVuKzhbig
VCzRdbNDAjM58Pciw/g+wvNPzJC1pXc8DYSzGtZNg27QVpH4IiXfC0uxPZjprFDL
sVQcryAtu+8J4qRBEe46udReoIt5yABNFhZ16swrbK+DC9d7lx4t5Md8FL6Mxuj2
mh0Uf1t9eY7ECK2aqFuYBZK9E3IybGZGEA==
-----END CERTIFICATE-----
18 changes: 18 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
targets:
$default:
builders:
swagger_dart_code_generator:
options:
input_folder: 'lib/swagger_jsons/'
output_folder: 'lib/restapi/'
overriden_models:
- file_name: "swagger"
import_url: "../devices/device_exporter.dart"
overriden_models:
- "Device"
- "DetailPropertyInfo"
- "DashboardPropertyInfo"
- "LayoutBasePropertyInfo"
- "SvgIcon"
- "AppNotification"
- "Command"
Loading