Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security updates #140

Merged
merged 6 commits into from
May 8, 2024
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
47 changes: 47 additions & 0 deletions .github/workflows/scheduled_snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Snyk scheduled test
on:
schedule:
- cron: '0 2 * * 1'
push:
branches:
- master

jobs:
security:
runs-on: ubuntu-latest
env:
REPORT_FILE: test.json

steps:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
with:
snyk-version: v1.1032.0

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Snyk
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--all-sub-projects
--configuration-matching='^releaseRuntimeClasspath$'
--fail-on=upgradable
--json-file-output=${{ env.REPORT_FILE }}
--org=radar-base
--policy-path=$PWD/.snyk

- name: Report new vulnerabilities
uses: thehyve/report-vulnerability@master
if: success() || failure()
with:
report-file: ${{ env.REPORT_FILE }}
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Snyk test
on:
pull_request:
branches:
- master
- dev

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
with:
snyk-version: v1.1032.0

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run Snyk to check for vulnerabilities
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--all-sub-projects
--configuration-matching="^runtimeClasspath$"
--fail-on=upgradable
--org=radar-base
--policy-path=.snyk
--severity-threshold=high
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
app/src/debug/google-services.json
app/google-services.json

# Local configuration file
local.properties

Expand Down
100 changes: 49 additions & 51 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'kotlin-android'
apply plugin: "com.android.application"
apply plugin: "com.google.android.gms.oss-licenses-plugin"
apply plugin: "kotlin-android"

android {
compileSdkVersion 33
buildToolsVersion '32.0.0'
compileSdkVersion 34
buildToolsVersion "34.0.0"
namespace "org.radarcns.detail"

defaultConfig {
applicationId 'org.radarcns.detail'
minSdkVersion 24
applicationId "org.radarcns.detail"
minSdkVersion 26
targetSdkVersion 33
versionCode 62
versionName '1.2.0'
manifestPlaceholders = ['appAuthRedirectScheme': 'org.radarbase.passive.app']
versionName "1.2.1"
manifestPlaceholders = ["appAuthRedirectScheme": "org.radarbase.passive.app"]
multiDexEnabled true
ndkVersion "25.2.9519653"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
ndk {
debugSymbolLevel = 'full'
debugSymbolLevel = "full"
}
}
debug {
shrinkResources false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
packagingOptions {
resources {
excludes += ['META-INF/ASL2.0', 'META-INF/LICENSE']
excludes += ["META-INF/ASL2.0", "META-INF/LICENSE"]
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_17
}
buildFeatures {
viewBinding true
Expand All @@ -61,66 +61,64 @@ android {
}

configurations.all {
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, "seconds"
resolutionStrategy.cacheChangingModulesFor 0, "seconds"
}

repositories {
flatDir { dirs 'libs' }
flatDir { dirs "libs" }
google()
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://repo.thehyve.nl/content/repositories/releases' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://repo.thehyve.nl/content/repositories/releases" }
}

ext.radarCommonsVersion = '1.2.3'

dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
api "org.radarbase:radar-commons-android:$radarCommonsVersion"
api "org.radarbase:radar-commons-android:$radar_commons_android_version"

implementation "org.radarbase:radar-android-login-qr:$radarCommonsVersion"
implementation "org.radarbase:radar-android-login-qr:$radar_commons_android_version"

implementation platform('com.google.firebase:firebase-bom:31.2.2')
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation platform("com.google.firebase:firebase-bom:$firebase_bom_version")
implementation "com.google.android.gms:play-services-oss-licenses:$play_services_oss_licenses_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

implementation 'org.slf4j:slf4j-api:2.0.6'
implementation "org.slf4j:slf4j-api:$slf4j_api_version"

implementation 'com.google.firebase:firebase-config'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.google.firebase:firebase-analytics'
implementation "com.google.firebase:firebase-config"
implementation "com.google.firebase:firebase-crashlytics"
implementation "com.google.firebase:firebase-analytics"

implementation 'com.gitlab.mvysny.slf4j:slf4j-handroid:2.0.4'
implementation "com.gitlab.mvysny.slf4j:slf4j-handroid:$slf4j_handroid_version"

implementation "org.radarbase:radar-android-phone:$radarCommonsVersion"
implementation "org.radarbase:radar-android-phone-usage:$radarCommonsVersion"
selfReleaseImplementation "org.radarbase:radar-android-phone-telephony:$radarCommonsVersion"
implementation "org.radarbase:radar-android-empatica:$radarCommonsVersion"
implementation "org.radarbase:radar-android-application-status:$radarCommonsVersion"
implementation "org.radarbase:radar-android-weather:$radarCommonsVersion"
implementation "org.radarbase:radar-android-audio:$radarCommonsVersion"
implementation "org.radarbase:radar-android-faros:$radarCommonsVersion"
implementation "org.radarbase:radar-android-phone:$radar_commons_android_version"
implementation "org.radarbase:radar-android-phone-usage:$radar_commons_android_version"
selfReleaseImplementation "org.radarbase:radar-android-phone-telephony:$radar_commons_android_version"
implementation "org.radarbase:radar-android-empatica:$radar_commons_android_version"
implementation "org.radarbase:radar-android-application-status:$radar_commons_android_version"
implementation "org.radarbase:radar-android-weather:$radar_commons_android_version"
implementation "org.radarbase:radar-android-audio:$radar_commons_android_version"
implementation "org.radarbase:radar-android-faros:$radar_commons_android_version"

implementation 'androidx.lifecycle:lifecycle-process:2.5.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.fragment:fragment-ktx:1.5.7'
implementation "androidx.lifecycle:lifecycle-process:$lifecycle_process_version"
implementation "androidx.legacy:legacy-support-v4:$legacy_support_version"
implementation "com.google.android.material:material:$material_version"
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
implementation "androidx.fragment:fragment-ktx:$fragment_version"

testImplementation 'junit:junit:4.13.2'
testRuntimeOnly 'org.slf4j:slf4j-simple:2.0.6'
testImplementation "junit:junit:$junit_version"
testRuntimeOnly "org.slf4j:slf4j-simple:$slf4j_simple_version"
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = '11'
apiVersion = '1.7'
languageVersion = '1.7'
jvmTarget = "17"
apiVersion = "1.7"
languageVersion = "1.7"
}
}

// Needed for Firebase. Put at the bottom so it can detect the Firebase version.
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: "com.google.gms.google-services"
apply plugin: "com.google.firebase.crashlytics"
29 changes: 29 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "1023372475379",
"project_id": "radar-prmt-2ab80",
"storage_bucket": "radar-prmt-2ab80.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1023372475379:android:a1cf03ad07fee51266b086",
"android_client_info": {
"package_name": "org.radarcns.detail"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDZC56Z_Izh30ScOGX-cvEtOgQRWGZqD_s"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
56 changes: 6 additions & 50 deletions app/src/debug/google-services.json
Original file line number Diff line number Diff line change
@@ -1,70 +1,26 @@
{
"project_info": {
"project_number": "250256119064",
"firebase_url": "https://radar-cns-78f28.firebaseio.com",
"project_id": "radar-cns-78f28",
"storage_bucket": "radar-cns-78f28.appspot.com"
"project_number": "1023372475379",
"project_id": "radar-prmt-2ab80",
"storage_bucket": "radar-prmt-2ab80.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:250256119064:android:f40d0ec34fa2d4ca",
"android_client_info": {
"package_name": "org.radarbase.passive.app"
}
},
"oauth_client": [
{
"client_id": "250256119064-g6o71at9m28ttboflhs8dbdfetjadkvh.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDzSGuSjeEIv-R0ElbSIpoY0r7cG-4SWpk"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:250256119064:android:b6edbb49b79ef2b6",
"mobilesdk_app_id": "1:1023372475379:android:a1cf03ad07fee51266b086",
"android_client_info": {
"package_name": "org.radarcns.detail"
}
},
"oauth_client": [
{
"client_id": "250256119064-g6o71at9m28ttboflhs8dbdfetjadkvh.apps.googleusercontent.com",
"client_type": 3
}
],
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDzSGuSjeEIv-R0ElbSIpoY0r7cG-4SWpk"
"current_key": "AIzaSyDZC56Z_Izh30ScOGX-cvEtOgQRWGZqD_s"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/org/radarcns/detail/RadarApplicationImpl.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class RadarApplicationImpl : AbstractRadarApplication(), LifecycleEventObserver
var isInForeground: Boolean = false
private set

override val largeIcon: Bitmap
val largeIcon: Bitmap
get() = AppCompatResources.getDrawable(this, R.mipmap.ic_launcher)!!.toBitmap()

override val smallIcon = R.drawable.ic_bt_connected
val smallIcon = R.drawable.ic_bt_connected

override fun createRemoteConfiguration(): List<RemoteConfig> = listOf(
FirebaseRemoteConfiguration(this, BuildConfig.DEBUG, R.xml.remote_config_defaults),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/radarcns/detail/SourceRowView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ class SourceRowView internal constructor(

companion object {
private val logger = LoggerFactory.getLogger(SourceRowView::class.java)
private const val sourceStatusIconDefault = R.drawable.status_searching
private val sourceStatusIconDefault = R.drawable.status_searching
}
}
4 changes: 4 additions & 0 deletions app/src/main/res/values/drawables.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<drawable name="ic_bt_connected">@drawable/ic_bt_connected</drawable>
<drawable name="status_searching">@drawable/status_searching</drawable>
</resources>
Loading
Loading