From 88355b89658a61f76f8409946eb8ff647f11b2ff Mon Sep 17 00:00:00 2001 From: Aoudia Date: Sat, 3 Mar 2018 22:20:59 +0100 Subject: [PATCH] BREAKING CHANGE: Add JaCoCo & Sonarqube Update dependencies versions. Update TravisCI env variables. --- .gitignore | 2 + .travis.yml | 20 +- ApollineKeyStore.jks.enc | Bin 3024 -> 0 bytes README.md | 4 +- app/build.gradle | 199 +++++++++------- app/google-services.json.enc | Bin 1504 -> 0 bytes .../java/science/apolline/RoomDatabaseTest.kt | 4 +- app/src/main/AndroidManifest.xml | 40 ++-- build.gradle | 64 +++++- configuration.tar.enc | Bin 0 -> 6672 bytes detekt-config.yml | 217 ++++++++++++++++++ local.properties.ci | 2 +- 12 files changed, 426 insertions(+), 126 deletions(-) delete mode 100644 ApollineKeyStore.jks.enc delete mode 100644 app/google-services.json.enc create mode 100644 configuration.tar.enc create mode 100644 detekt-config.yml diff --git a/.gitignore b/.gitignore index 17cbceb..4427751 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,5 @@ projectFilesBackup1/\.idea/workspace\.xml \.idea/codeStyleSettings\.xml app/fabric\.properties + +configuration\.tar diff --git a/.travis.yml b/.travis.yml index 38ccf93..0f1f42c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,9 +19,11 @@ before_install: - mkdir "$ANDROID_HOME/licenses" || true - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license" - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license" - - ls -all - - openssl aes-256-cbc -K $encrypted_1f0900b4d867_key -iv $encrypted_1f0900b4d867_iv -in ${TRAVIS_BUILD_DIR}/app/google-services.json.enc -out ${TRAVIS_BUILD_DIR}/app/google-services.json -d + - openssl aes-256-cbc -K $encrypted_8906d6504312_key -iv $encrypted_8906d6504312_iv -in configuration.tar.enc -out configuration.tar -d + - tar xvf configuration.tar + - mv ${TRAVIS_BUILD_DIR}/google-services.json ${TRAVIS_BUILD_DIR}/app/google-services.json - cp local.properties.ci local.properties + - ls -all - source scripts/writeToManifest.sh && copyEnvVarsToManifest - docker pull influxdb - docker run --name=influxdb -d -p 127.0.0.1:8086:8086 influxdb @@ -33,13 +35,6 @@ env: - ANDROID_API_LEVEL=27 - ANDROID_BUILD_TOOLS=27.0.3 - ADB_INSTALL_TIMEOUT=5 - - secure: lYFnvihaPRXu97v1emVFawOlzExUGFayzzA4fqFEaBdPfvJSMMCcZJUOPFJQKmFmUzVdH1ib5z2DuaLgy+vWQKT0ILODAwa+24O3EXbfpJxdMgdrS/h8zC6QsPZ16BmJUeoaavLejQh4WPFb7zqD//NH6XRpfQT69PdB0sSl7lKFvGjmPx9iHsnW5petNYNhT3S7zSy/xWf/MPDRMf0nUmf8hdiXsmZRH+pByC1BccsUiEYa5HrIcb69KGfpMH9EaNLuaquvV45RyCmlq+glOg2xvW1JII13D+GRoAOLHq1zuqLtShnWJNmOuvfvx0tsOXIOgNJxi5xVRwWU3QjykfZMtwSJfCM133yz3QfDKOlNvbiFbVlgV0LWwxQQi5fFQPOTGYZd6TH2b/7/Cg5hgaQvmU2mWHUIL/Q/uvl+T3rJVLlLh0BIeTTandfFwoPJtRAmvPZl7zXCwv5ocEK7knSG/uGZB8t1ceagxxt5cUb3CZrAg7MiOhO6uHnevozmnQCZDvBrQ5iWmWgIFlem6HZMAr0e4X2OVRTmaHdX2OH8pyryhMyCpMyRBm8XbCrkFSPK74YFgb7/5YnMlsciYLkb8rkSsqouvy8DYJMC/Huaa+CCQh0goygFo6wHJLYPRig17UvoCorzB0vUUZ72Lmbs6BKfV9InknXdAfywLL8= - - secure: ig65OGCzLAx2J6R3HYQqE+K/s8SpBLjWGad182G3XMgDQ122c+6seXANhwQcWEjGjZ1uTKuuSoKqampEqLXJGMlMbpz4kYiIVCj8j21ZFz2HaVcReFUJbeFHZ6hKC2+HS5AF8wfub+1Q8DTrnHFNoccbxjA9Z+vaG49jj+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ZCqqmw/FlLR3NFM+YvAYs= - - secure: ROXBgeOvnE6rk/pZKQD/i38VGZs7Lxd18sRBNpAn+QJNV3lgJtD11J3vo+V7myoKsprgmXx4vZd2tYMywub7vjCdb4EoG6FjIML/7d6Nw5ASB2THmN+3cF/mEaFN/ow3rqTuLZmOPfPB0x+2hz8rXgwxPbGDCloKgqMAFnEu/W9xmOlrKuh56MXmPSv4wP9+t3nreXeJJ2HQCwV9BYbtpR47tUGIIRavV6wZbkA5GztfMso4wwVmUWuOTBSzGYrw4pbbchTWyPaMLUAWPdS4qs06BvNEMgxyIfWcupXNpsuAbzGdHEL7XOINxexc4KsziXNhuztXr3nC73t1MP3V8toLW3OYFrl/3SVBO0wVUjtG/UshyoqL4s2SCBRDJFRm0SIk7PCOz/N28v8MMkrTM/4Dxo9oT7p2HuclHDa8Z7OXlAVsdYS5YuuLNFOXSbg4m6tq0KYeWQC2DTdEwKFUuW1FZLUYUKxsLvI3BHNtP58WiS4Z3TnjetQhwV0NfxwGq2bdRNl7SBCv2YodTlbwRn6aShznOlJAmeDhEmEf6nbK+g5tPVOV0IxmS6Qrv+qvWN9qqrk3f0v4Y0EsiNdy8qkBcm6ZB80TRj8KuRm0QlJARvkvvFCD1bcVSAsCwfGaSZ4U6uFhIpSiUSdcgSmWxdoNgWiwzVj9fj4ClSbNUlg= android: components: - tools @@ -55,10 +50,8 @@ script: - curl -i -XPOST http://127.0.0.1:8086/query --data-urlencode "q=CREATE DATABASE test" - "./gradlew clean test build" before_deploy: - - openssl aes-256-cbc -K $encrypted_c4a232eaf55b_key -iv $encrypted_c4a232eaf55b_iv -in ApollineKeyStore.jks.enc -out ApollineKeyStore.jks -d - cd app/build/outputs/apk/release - - jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ${TRAVIS_BUILD_DIR}/ApollineKeyStore.jks - -storepass $storepass -keypass $keypass app-release-unsigned.apk apolline + - jarsigner -verbose -tsa http://timestamp.comodoca.com/rfc3161 -sigalg SHA1withRSA -digestalg SHA1 -keystore ${TRAVIS_BUILD_DIR}/ApollineKeystore.jks -storepass $STOREPASS -keypass $KEYPASS app-release-unsigned.apk $ALIAS - jarsigner -verify app-release-unsigned.apk - "${ANDROID_HOME}/build-tools/${ANDROID_BUILD_TOOLS}/zipalign -v 4 app-release-unsigned.apk Apolline.apk" @@ -66,8 +59,7 @@ deploy: provider: releases skip_cleanup: true file: Apolline.apk - api_key: - secure: wNyHnxqWJcwqR6ZwxkY8/xh/7yWedut5c+PX+0aaNtL+xBDzbXlFyf5SqwKrG3/UN+JtiVVtjomrzE7MALiHEUpeqmA1jT5BwirFwB7hFYSHu26p4pwsanZM1tkZxkGW8rlLx75qrud70MOboi3nb2ZoAaJk27khfTViDv8BowrPFTG6X26Lzg0P0dD94s+24cB7KtcdmBlkZvp8uK1xfLYQflAUGPRpFC0lPJujqODZXTyqapXQZPcCDOvG+A1iKNWR175EuAgSwdcqLqp3cB6KGZJ+44ODE2zv3W9sR9bSQ0xQqYjBRaCeIwNmpRyB8UW4rY8zTw/gput2gV/nJZBBE+xDsuLTSVRuqSABTRfPzJVYy6QJ2R936/EIIsIdyzU45a7k48hHOQFWiopabBxm0uilS7T0Y1PNuOUln3SABL7igjGfaPeNH511F9qUDdSUuvaNEFialUk5L7V6syPb8tYQ/sJDRZjE9gk6V5J8Z+Ig9pw9lD/3SAPIi1f5bVD1WNhfy7tHWR4Y+s5gZ7B0T76SKmiVIcgolBTEx0OXiG0Z2ML5pRw8zkj0R016Wq/kjeSqJlQnKFhbLFFB4ZzDH6ac6jIz6FOYqv0gBd5FzoSY31+34CoVaKqEhnCFCtjpR6tVGIHMbRkaSECwCKU4LITTl8borVr3yUly0+8= + api_key: $GH_TOKEN on: repo: Apolline-Lille/apolline-android tags: true diff --git a/ApollineKeyStore.jks.enc b/ApollineKeyStore.jks.enc deleted file mode 100644 index d33d9b377d43bd6075e2e3d989f402a31e3ccbe2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3024 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0RUo?{{ln1~w};Yvbe$q(Z_krTGFHPT99+EuQ$X6f!qL z6GT#MxoaXEJQM0KDL~aq7?Q;6nns5ch}2T#e0en`Te7Ng%TX^s*y{RdgIOjf?S7KHcP S7(bT_X2r1Dr}W?YQqyE>Jojb* diff --git a/README.md b/README.md index 94d94a7..a156d25 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,9 @@ Supported sensors: * [Toasty](https://github.com/GrenderG/Toasty) - The usual Android Toast, but with steroids (Colors). * [Gson](https://github.com/google/gson) - A Java serialization/deserialization library to convert Java Objects into JSON and back. * [Google Maps Android Heatmap Utility](https://developers.google.com/maps/documentation/android-api/utility/heatmap) - The Google Maps Android API Utility Library includes a heatmap utility, which you can use to add one or more heatmaps to a Google map in your application. - + * [Sonar-kotlin](https://github.com/arturbosch/sonar-kotlin) - Kotlin Sonarqube plugin (Unofficial) + * [Detekt](https://github.com/arturbosch/detekt) - Kotlin static code analysis tool. It operates on the abstract syntax tree provided by the Kotlin compiler. + * [JaCoCo](http://www.eclemma.org/jacoco/) - JaCoCo is a free code coverage library for Java, which has been created by the EclEmma team based on the lessons learned from using and integration existing libraries for many years. ## Download (Unreleased) diff --git a/app/build.gradle b/app/build.gradle index 7301e17..6dcc367 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,9 +4,9 @@ apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' apply plugin: 'io.fabric' apply plugin: 'com.google.firebase.firebase-perf' +apply plugin: 'jacoco' -import java.util.regex.Pattern android { @@ -30,6 +30,7 @@ android { arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] } } + multiDexEnabled true } buildTypes { @@ -43,6 +44,8 @@ android { buildConfigField "String", "INFLUXDB_USR", '"' + properties.getProperty('influxdb_usr') + '"' buildConfigField "String", "INFLUXDB_PWD", '"' + properties.getProperty('influxdb_pwd') + '"' + project.ext.sonarqube_url = '"' + properties.getProperty('sonarqube_url') + '"' + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } @@ -63,6 +66,16 @@ android { sourceCompatibility 1.8 } + testOptions { + + execution 'ANDROID_TEST_ORCHESTRATOR' + animationsDisabled true + + unitTests { + includeAndroidResources = true + returnDefaultValues = true + } + } packagingOptions { exclude 'META-INF/LICENSE' @@ -71,54 +84,13 @@ android { lintOptions { checkReleaseBuilds true + abortOnError false } defaultConfig { multiDexEnabled true } - tasks.whenTaskAdded { task -> - if (task.name == "lint") { - task.enabled = false - } - } - - task('increaseVersionCode') { - doLast { - def manifestFile = file("src/main/AndroidManifest.xml") - def pattern = Pattern.compile("versionCode=\"(\\d+)\"") - def manifestText = manifestFile.getText() - def matcher = pattern.matcher(manifestText) - matcher.find() - def versionCode = Integer.parseInt(matcher.group(1)) - def manifestContent = matcher.replaceAll("versionCode=\"" + ++versionCode + "\"") - manifestFile.write(manifestContent) - } - } - - task('incrementVersionName') { - doLast { - def manifestFile = file("src/main/AndroidManifest.xml") - def patternVersionNumber = Pattern.compile("versionName=\"(\\d+)\\.(\\d+)\\.(\\d+)\"") - def manifestText = manifestFile.getText() - def matcherVersionNumber = patternVersionNumber.matcher(manifestText) - matcherVersionNumber.find() - def majorVersion = Integer.parseInt(matcherVersionNumber.group(1)) - def pointVersion = Integer.parseInt(matcherVersionNumber.group(2)) - def buildVersion = Integer.parseInt(matcherVersionNumber.group(3)) - def mNextVersionName = majorVersion + "." + pointVersion + "." + (buildVersion + 1) - def manifestContent = matcherVersionNumber.replaceAll("versionName=\"" + mNextVersionName + "\"") - manifestFile.write(manifestContent) - } - } - - tasks.whenTaskAdded { task -> - if (task.name == 'assembleRelease') { - task.dependsOn 'increaseVersionCode' - task.dependsOn 'incrementVersionName' - } - } - // Ensure the no-op dependency is always used in JVM tests. configurations.all { config -> if (config.name.contains('UnitTest')) { @@ -134,70 +106,72 @@ android { project.ext { - appcompat = "27.0.2" - rc = "1.0.0" - ioio = "5.07" - maps = "11.8.0" - retrofit = "2.3.0" - constraintLayout = "1.0.2" - anko_version = "0.10.3" + appcompat_version = '27.1.0' + aac_version = '1.0.0' + ioio_version = '5.07' + gms_version = '11.8.0' + retrofit_version = '2.3.0' + anko_version = '0.10.3' + kodein_version = '4.1.0' + leak_version = '1.5.4' } + dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" - implementation 'com.google.firebase:firebase-core:11.8.0' + implementation "com.google.firebase:firebase-core:$gms_version" testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' // Android - implementation "com.android.support:appcompat-v7:$project.appcompat" - implementation "com.android.support:design:$project.appcompat" + implementation "com.android.support:appcompat-v7:$appcompat_version" + implementation "com.android.support:design:$appcompat_version" implementation 'com.android.support.constraint:constraint-layout:1.0.2' - implementation "com.android.support:support-v4:$project.appcompat" + implementation "com.android.support:support-v4:$appcompat_version" // Retrofit - implementation "com.squareup.retrofit2:retrofit:$project.retrofit" - implementation "com.squareup.retrofit2:converter-gson:$project.retrofit" - implementation "com.squareup.retrofit2:converter-scalars:$project.retrofit" + implementation "com.squareup.retrofit2:retrofit:$retrofit_version" + implementation "com.squareup.retrofit2:converter-gson:$retrofit_version" + implementation "com.squareup.retrofit2:converter-scalars:$retrofit_version" implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' // Gson implementation 'com.google.code.gson:gson:2.8.2' // IOIO card - implementation "com.github.ytai.ioio:IOIOLibAndroid:$project.ioio" - implementation "com.github.ytai.ioio:IOIOLibAndroidBluetooth:$project.ioio" - implementation "com.github.ytai.ioio:IOIOLibAndroidAccessory:$project.ioio" - implementation "com.github.ytai.ioio:IOIOLibAndroidDevice:$project.ioio" + implementation "com.github.ytai.ioio:IOIOLibAndroid:$ioio_version" + implementation "com.github.ytai.ioio:IOIOLibAndroidBluetooth:$ioio_version" + implementation "com.github.ytai.ioio:IOIOLibAndroidAccessory:$ioio_version" + implementation "com.github.ytai.ioio:IOIOLibAndroidDevice:$ioio_version" // MPAndroidChart implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3' // Google map - implementation "com.google.android.gms:play-services-maps:$project.maps" - implementation "com.google.android.gms:play-services-location:$project.maps" + implementation "com.google.android.gms:play-services-maps:$gms_version" + implementation "com.google.android.gms:play-services-location:$gms_version" // Logger implementation 'com.orhanobut:logger:2.1.1' - // RxJaVa + // RxJava implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' implementation 'io.reactivex.rxjava2:rxjava:2.1.7' implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0' // Room - kapt "android.arch.persistence.room:compiler:$project.rc" - implementation "android.arch.persistence.room:runtime:$project.rc" - implementation "android.arch.lifecycle:common-java8:$project.rc" - implementation "android.arch.persistence.room:rxjava2:$project.rc" - testImplementation "android.arch.persistence.room:testing:$project.rc" + kapt "android.arch.persistence.room:compiler:$aac_version" + implementation "android.arch.persistence.room:runtime:$aac_version" + implementation "android.arch.lifecycle:common-java8:$aac_version" + implementation "android.arch.persistence.room:rxjava2:$aac_version" + testImplementation "android.arch.persistence.room:testing:$aac_version" // LiveData implementation 'android.arch.lifecycle:extensions:1.1.0' - testImplementation "android.arch.core:core-testing:$project.rc" + testImplementation "android.arch.core:core-testing:$aac_version" // Anko implementation "org.jetbrains.anko:anko-commons:$anko_version" @@ -207,9 +181,9 @@ dependencies { implementation 'com.opencsv:opencsv:4.1' // MultiDex - implementation 'com.android.support:multidex:1.0.2' + implementation 'com.android.support:multidex:1.0.3' - // RxLocation + // Android reactive location implementation 'pl.charmas.android:android-reactive-location2:2.1@aar' // Android Priority Job Queue @@ -225,17 +199,17 @@ dependencies { implementation 'pub.devrel:easypermissions:1.0.1' // LeakCanary - debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4' - releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' + debugImplementation "com.squareup.leakcanary:leakcanary-android:$leak_version" + releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leak_version" // Crashlytics - implementation 'com.google.firebase:firebase-crash:11.8.0' + implementation "com.google.firebase:firebase-crash:$gms_version" implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') { transitive = true } // FireBase performance - implementation 'com.google.firebase:firebase-perf:11.8.0' + implementation "com.google.firebase:firebase-perf:$gms_version" // Floating Actions implementation 'com.github.clans:fab:1.6.4' @@ -248,9 +222,9 @@ dependencies { implementation 'com.github.GrenderG:Toasty:1.2.8' // Kodein - implementation 'com.github.salomonbrys.kodein:kodein-core:4.1.0' - implementation 'com.github.salomonbrys.kodein:kodein:4.1.0' - implementation 'com.github.salomonbrys.kodein:kodein-android:4.1.0' + implementation "com.github.salomonbrys.kodein:kodein-core:$kodein_version" + implementation "com.github.salomonbrys.kodein:kodein:$kodein_version" + implementation "com.github.salomonbrys.kodein:kodein-android:$kodein_version" // Google Maps heat map utility implementation 'com.google.maps.android:android-maps-utils:0.5' @@ -268,6 +242,73 @@ configurations { } } + + +jacoco { + toolVersion = "0.8.0" + reportsDir = file("$buildDir/reports") +} + + +tasks.withType(Test) { + jacoco.includeNoLocationClasses = true +} + + +task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) { + + reports { + xml.enabled = true + html.enabled = true + csv.enabled = true + xml.destination file("${buildDir}/reports/jacocoTestReport.xml") + html.destination file("${buildDir}/reports/jacoco") + csv.destination file("${buildDir}/reports/jacocoTestReport.csv") + } + + def fileFilter = [ + '**/*Parcel.class', + '**/*$CREATOR.class', + '**/*Test*.*', + '**/AutoValue_*.*', + '**/*JavascriptBridge.class', + '**/R.class', + '**/R$*.class', + '**/Manifest*.*', + 'android/**/*.*', + '**/BuildConfig.*', + '**/*$ViewBinder*.*', + '**/*$ViewInjector*.*', + '**/Lambda$*.class', + '**/Lambda.class', + '**/*Lambda.class', + '**/*Lambda*.class', + '**/*$InjectAdapter.class', + '**/*$ModuleAdapter.class', + '**/*$ViewInjector*.class', + '**/*_MembersInjector.class', //Dagger2 generated code + '*/*_MembersInjector*.*', //Dagger2 generated code + '**/*_*Factory*.*', //Dagger2 generated code + '**/*Component*.*', //Dagger2 generated code + '**/*Module*.*' //Dagger2 generated code + ] + + def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter) + + def mainSrc = "${project.projectDir}/src/main/java" + + def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter) + + sourceDirectories = files([mainSrc]) + + classDirectories = files([debugTree], [kotlinDebugTree]) + + executionData = fileTree(dir: buildDir, includes: + ['**/*.exec', '**/*.ec']) +} + +task sonarqube(dependsOn: 'jacocoTestReport') + apply plugin: 'com.google.gms.google-services' diff --git a/app/google-services.json.enc b/app/google-services.json.enc deleted file mode 100644 index 33e996676831c2363d4b998c40b50887c10c5aef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1504 zcmV<61t0qOX?c@W>=B5Mc;)IvT6gZo*0n}4rHT;0eh|(W{#};jSMoOnz|?Ktq%k(G zcclVs%$ouZw@mi?9bOJcr(rBZ_C3*;hN)HlGe?HovKFHxzm*G}CvqIaul4G@E@!%hMJW69ax=KI*_|HadvkvlCN$# z&k9!d0eCy!-qVMg(sgYXj^@jBUYwrdX0<)W&M;5J0ypx>6awW!fisy7-VHtREJJaA z6Op@-JZ0Li6^k{Qn*!-#72|z-WUzB31Y2j!FxL5v)?iai?6P5@$R!J@%&AFTT|)?v zkCQ;258$)?Bg}e}NSE5DCFvv%i)LFy)3rTe9ZUzTBNQ79akP@OyJh!LA#fXFnleF53>W%*(yfa4d=AEiUqJ+Ou zhN1^5ht(jPYdz~V`|{AVsQEZaZf%pk0~@4mZQFK8sA?lm{k;r3A??D;Qi{tr$&dvS zkMB_1%+!jNBQH?1=I+p|L?_#`HVK2K zrVTr2Dd^3d;KYjK_{ADtlut@>@HU{WQuoPR?cjg5n=dH>t_1Xt+>I(qK8-?6oGtmQ zI2hhILLJODE}rV~Wencd;+?9D3P|i|qNabqW!YXN6F9}W5%ZPnsy&iW4L$^uAQu5_ zgQ{hzA7yY|(onlDKC9TT;UoKHRf*1T0v@~*Q0xj`0F=z6!}AV6?6agNdQ1CfuIEv& z^d926KftEFjA+WEO>Kwk{qAHAE{R8n73kwo`Vxs(oPxZzsu=z3Q6TjwS9c6*a zQeciKOzx>=!9=IEHn@jFJrQBgp7qKpep#QnCP+)hHJcxF65C{3D+_E&_dZlEhgy6- z2s+oFGr+DEO%TW~UPy(gITy$K21&(!xT{OPv*$lo59Fg3h><0MYi}xBG#ZAiWo0xf zSc|4-wi{0zv|n64S{9GG@RyX#CY|VImeI%d34BbC{#K$@l13?E^6OjK#m06y0}{ke zwQBwe$x3OkAiapKFdW>Km$cO9lGY@mCg6hJ<=#}R(N6ci!a>#t@AceiLo?;=_z!Nk zuuhys)q_eXQ}jU6$#|!Jlj}*XTq~9@a1#kCfxU=;^*uLPh_~MZVnGJy5oJ@s;sVu9 zTD|vlui>?dNz+E(>TiR|0G8(^9g*j!y^Rix`ak-@!BX+)ESA^SD@Sx?C4W5p?Zu6o zx}k>1_x>N)9+i5!fe!wW}tCwDUznbRIzE}FMZ^9aYu4h0rdozMUV zWBiEzLD_k3k7UR0P`ycELZjUEhNR^nGaArqr&lvG-su_)#T+Uay99b3&wF}R@a zEDzS*(_Si_)Kqd4*9o+-U)H=nW@@xWP0h&z-h$1IOI+3$^$#9B$@6`7xX2N577ZRV zs!V|WlGR&E_j*c7;d#j~-AeHWy3jh8 zc6DpkUVJU((K?9KN - - - + + + - - - - + + + + @@ -23,14 +23,14 @@ android:required="true" /> + android:theme="@style/AppTheme" + android:name=".ApollineApplication"> @@ -39,14 +39,13 @@ android:required="false" /> - + android:theme="@style/AppTheme.NoActionBar" > @@ -83,18 +82,13 @@ + android:value="${fabric_api_key}"/> - - -