Skip to content

Commit

Permalink
Merge tag '21402'
Browse files Browse the repository at this point in the history
Version 2.14.2

- Fix crash in preferences
- Update libraries

# gpg: Signature made 08/29/20 19:22:10 Romance (zomertijd)
# gpg:                using RSA key 7F23DF85E1D48EA673566BDD1A8AEBABD9012251
# gpg: Good signature from "Niko Strijbol <[email protected]>" [ultimate]
  • Loading branch information
niknetniko committed Sep 6, 2020
2 parents 5bd0f5d + b45d86a commit d1626ce
Show file tree
Hide file tree
Showing 146 changed files with 3,673 additions and 767 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/android.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android CI
name: CI

# We run the tests on master, development and for PR's.
on:
Expand All @@ -9,43 +9,46 @@ on:
pull_request:

jobs:
build-debug:
name: Test debug
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
command: [testOpenDebug, testOpenRelease, testStoreDebug, testStoreRelease]
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 13
- name: Cache Gradle files
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: debug-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
key: ${{ matrix.command }}-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
debug-${{ runner.os }}-gradle-
${{ matrix.command }}-${{ runner.os }}-gradle-
- name: Test with Gradle
uses: eskatos/gradle-command-action@v1
with:
arguments: testDebug
build-release:
name: Test release
arguments: ${{ matrix.command }}
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 13
- name: Cache Gradle files
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: release-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
key: lint-${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
release-${{ runner.os }}-gradle-
- name: Test with Gradle
lint-${{ runner.os }}-gradle-
- name: Lint with Gradle
uses: eskatos/gradle-command-action@v1
with:
arguments: testRelease
arguments: lint
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Hydra (Android) [![Build Status](https://travis-ci.org/ZeusWPI/hydra-android.svg?branch=development)](https://travis-ci.org/ZeusWPI/hydra-android)
# Hydra (Android) ![Android CI](https://github.com/ZeusWPI/hydra-android/workflows/Android%20CI/badge.svg?branch=development)

<a href='https://play.google.com/store/apps/details?id=be.ugent.zeus.hydra&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height="80px"/></a>

Android version of the Hydra app, available for Jelly Bean and up. Available on [Google Play](https://play.google.com/store/apps/details?id=be.ugent.zeus.hydra) or as a download [here](https://github.com/ZeusWPI/hydra-android/releases) (apk file).
The Android version of the Hydra app, available for Jelly Bean and up. Available on [Google Play](https://play.google.com/store/apps/details?id=be.ugent.zeus.hydra) or as a download [here](https://github.com/ZeusWPI/hydra-android/releases) (apk file).

## Contributing

Expand All @@ -21,6 +21,11 @@ If you want to use the Google Maps integration, you will need the API keys. You

After you've obtained the keys, you will need to copy the file `app/secrets.properties.example` to `app/secrets.properties` and insert the correct keys.

### Build variants

Hydra comes in two build variants: `store` and `open`.
The `store` variant is the main variant, and used for the Play Store and is the recommended version for most people. The `open` variant only uses open-source software (e.g. OpenStreetMaps instead of Google Maps). Since the open variant contains no crash reporting functionality, crashes from that version not accompanied by a stack trace will not be considered.

### Useful links
- [How to Write a Git Commit Message](https://chris.beams.io/posts/git-commit/)
- [Android Developer Guides](https://developer.android.com/guide/)
Expand Down
131 changes: 91 additions & 40 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'io.fabric'
apply plugin: 'be.ugent.zeus.hydra.licenses'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

// Read our properties, see bottom for details.
def props = loadProperties()

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
buildToolsVersion "29.0.3"

// Use resources in robolectric
testOptions.unitTests.includeAndroidResources = true
Expand All @@ -17,14 +18,11 @@ android {
applicationId "be.ugent.zeus.hydra"
minSdkVersion 16
targetSdkVersion 29
versionCode 21400
versionName "2.14"
versionCode 21402
versionName "2.14.2"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

manifestPlaceholders = [
google_maps_key: props.getProperty('MAPS_API_KEY'),
]
// For a description of what these do, see the config.properties file.
buildConfigField "boolean", "DEBUG_HOME_STREAM_PRIORITY", props.getProperty('hydra.debug.home.stream.priority')
buildConfigField "boolean", "DEBUG_HOME_STREAM_STALL", props.getProperty('hydra.debug.home.stream.stall')
Expand All @@ -42,6 +40,50 @@ android {
}
}

viewBinding {
enabled = true
}

lintOptions {
warningsAsErrors true
// We don't support Right to Left layouts.
disable "RtlSymmetry", "RtlHardcoded",
// We don't care about long vector paths.
"VectorPath",
// Http is still allowed for now.
"InsecureBaseConfiguration",
// Allow overdraw, mainly used for selectable backgrounds
"Overdraw",
// Disabled until AS 4.0 is available
"UnusedResources",
// We use dependabot for dependencies
"GradleDependency",
// We will choose for ourselves when we update
"OldTargetApi"
}

flavorDimensions "distribution"

productFlavors {

// Play Store and officially supported version
store {
isDefault = true
manifestPlaceholders = [
google_maps_key: props.getProperty('MAPS_API_KEY'),
]
}

open {
ext.enableCrashlytics = false
versionNameSuffix "-open"
applicationIdSuffix ".open"
firebaseCrashlytics {
mappingFileUploadEnabled false
}
}
}

// used by Room, to test migrations
sourceSets {
test.resources.srcDirs += files("$projectDir/schemas".toString())
Expand Down Expand Up @@ -96,15 +138,15 @@ android {

dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.core:core:1.2.0'
implementation 'androidx.core:core:1.3.1'
implementation 'androidx.media:media:1.1.0'
implementation 'androidx.fragment:fragment:1.2.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.fragment:fragment:1.2.5'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
Expand All @@ -113,52 +155,61 @@ dependencies {
annotationProcessor 'androidx.room:room-compiler:2.2.5'
// Do not upgrade beyond 3.12.x until we require API 21+
//noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:3.12.10'
implementation 'com.squareup.moshi:moshi:1.9.2'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.2'
implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.squareup.okhttp3:okhttp:3.12.12'
implementation 'com.squareup.moshi:moshi:1.10.0'
implementation 'com.jakewharton.threetenabp:threetenabp:1.2.4'
implementation 'net.sourceforge.streamsupport:android-retrostreams:1.7.2'
implementation 'com.squareup.picasso:picasso:2.8'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation 'com.heinrichreimersoftware:material-intro:2.0.0'
implementation 'com.github.niknetniko:material-intro:9903deb6c4'
implementation 'com.jonathanfinerty.once:once:1.3.0'
implementation 'blue.aodev:material-values:1.1.1'
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

// Dependencies for the Play Store version.
storeImplementation 'com.google.android.gms:play-services-maps:17.0.0'
storeImplementation 'com.google.firebase:firebase-analytics:17.5.0'
storeImplementation 'com.google.firebase:firebase-crashlytics:17.2.1'

// Dependencies for open version.
openImplementation 'org.osmdroid:osmdroid-android:6.1.8'

if (props.getProperty("hydra.debug.leaks").toBoolean()) {
logger.info("Leak tracking enabled...")
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
}

testImplementation 'junit:junit:4.13'
testImplementation 'org.mockito:mockito-core:3.2.4'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'androidx.test:rules:1.2.0'
testImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
testImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
testImplementation 'org.mockito:mockito-core:3.5.7'
testImplementation 'org.robolectric:robolectric:4.4'
testImplementation 'androidx.test:core:1.3.0'
testImplementation 'androidx.test.ext:junit:1.1.2'
testImplementation 'androidx.test:rules:1.3.0'
testImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
testImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
testImplementation 'androidx.arch.core:core-testing:2.1.0'
testImplementation 'androidx.room:room-testing:2.2.5'
// Enable the normal library for unit tests.
testImplementation('org.threeten:threetenbp:1.4.1') {
testImplementation('org.threeten:threetenbp:1.4.4') {
exclude group: 'com.jakewharton.threetenabp', module: 'threetenabp'
}
//noinspection GradleDependency
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.6'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.1.12'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.12'
testImplementation 'nl.jqno.equalsverifier:equalsverifier:3.4.2'
testImplementation 'com.github.niknetniko:GetterSetterVerifier:0.0.11'
testImplementation 'com.shazam:shazamcrest:0.11'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
testImplementation 'org.jeasy:easy-random-core:4.1.0'
testImplementation 'org.apache.commons:commons-lang3:3.9'
testImplementation 'org.jeasy:easy-random-core:4.2.0'
testImplementation 'org.apache.commons:commons-lang3:3.11'
testImplementation 'commons-validator:commons-validator:1.6'
}

apply plugin: 'com.google.gms.google-services'

// Disable Google services for open variant.
android.applicationVariants.all { variant ->
def googleTask = tasks.findByName("process${variant.name.capitalize()}GoogleServices")
googleTask.enabled = "open" != variant.flavorName
}

/**
* Loads the default properties, and the user properties. This will also load the
Expand Down Expand Up @@ -189,7 +240,7 @@ def loadProperties() {
if (actualKeyFile.exists()) {
actualKeys.load(actualKeyFile.newReader())
} else {
logger.warn('A secrets.properties file was not found. Maps will not work.')
logger.warn('A secrets.properties file was not found.')
}

return actualKeys
Expand Down
19 changes: 1 addition & 18 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- GoogleAppIndexingWarning: not currently used
-->
<application
android:supportsRtl="false"
android:name=".HydraApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
Expand All @@ -27,19 +28,6 @@
android:networkSecurityConfig="@xml/network_security_config"
tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute">

<!-- Disable Firebase Reporting until explicitly started -->
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
<!-- Disables automatic initialisation of Crashlytics. -->
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
<!-- The Maps API key -->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${google_maps_key}" />

<!-- Main activity -->
<activity
android:name=".MainActivity"
Expand Down Expand Up @@ -140,11 +128,6 @@
android:parentActivityName=".MainActivity"
android:theme="@style/Hydra.DayNight.SystemWindows" />

<activity
android:name="com.google.android.gms.oss.licenses.OssLicensesMenuActivity" />
<activity
android:name="com.google.android.gms.oss.licenses.OssLicensesActivity" />

<!-- Urgent stuff -->
<!-- This is a music service without sensitive data and thus does not require permissions -->
<service
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/be/ugent/zeus/hydra/HydraApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.util.Log;
import androidx.appcompat.app.AppCompatDelegate;

import be.ugent.zeus.hydra.common.reporting.Manager;
import be.ugent.zeus.hydra.common.reporting.Reporting;
import be.ugent.zeus.hydra.common.reporting.Tracker;
import be.ugent.zeus.hydra.preferences.ThemeFragment;
Expand Down Expand Up @@ -53,7 +54,7 @@ protected void onCreateInitialise() {
}

// Enable or disable analytics.
Reporting.syncPermissions(this);
Manager.syncPermissions(this);

// Set the theme.
AppCompatDelegate.setDefaultNightMode(ThemeFragment.getNightMode(this));
Expand Down
Loading

0 comments on commit d1626ce

Please sign in to comment.