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 4 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
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ 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
minSdkVersion 26
targetSdkVersion 33
versionCode 62
versionName '1.2.0'
versionName '1.2.1'
manifestPlaceholders = ['appAuthRedirectScheme': 'org.radarbase.passive.app']
multiDexEnabled true
ndkVersion "25.2.9519653"
Expand All @@ -38,8 +38,8 @@ android {
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_17
}
buildFeatures {
viewBinding true
Expand Down Expand Up @@ -74,7 +74,7 @@ repositories {
maven { url 'https://repo.thehyve.nl/content/repositories/releases' }
}

ext.radarCommonsVersion = '1.2.3'
ext.radarCommonsVersion = '1.2.4-SNAPSHOT'

dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Expand Down Expand Up @@ -115,7 +115,7 @@ dependencies {

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
apiVersion = '1.7'
languageVersion = '1.7'
}
Expand Down
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>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<string name="deviceTypeLabel2">Angel</string>
<string name="pebble2DisplayName">Pebble</string>
<string name="phoneServiceDisplayName">Phone</string>
<string name="polarDisplayName">Polar</string>
<string name="disabledText">NA</string>

<!--Status texts-->
Expand Down Expand Up @@ -76,6 +77,7 @@
<string name="login_failed_firebase">Settings are incomplete. Please update the Firebase Remote Configuration</string>
<string name="login_failed_connection">No network connection available. Please connect your phone to the internet and try again.</string>
<string name="login_failed_mp">Login failed. Please try again later.</string>
<string name="login_failed">Login failed. Please try again later.</string>
<string name="no_connection">No internet connection available. Please make sure wifi and/or cellphone data is turned on.</string>
<string name="info">About This App</string>
<string name="radar_prmt_title">RADAR pRMT</string>
Expand Down Expand Up @@ -149,4 +151,5 @@
<string name="hundred_percent">100%</string>
<string name="reject_privacy_policy_button">Reject</string>
<string name="consent">Consent</string>
<string name="filter_split_regex">,</string>
</resources>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.8.10'
ext.kotlin_version = '1.9.23'
repositories {
mavenLocal()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.android.tools.build:gradle:8.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.jetifier.ignorelist=jackson-core-2.15.2.jar, jackson-core-2.16.1.jar
android.defaults.buildfeatures.buildconfig=true

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
Loading