Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Update project #395

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ crashlytics-build.properties
fabric.properties

# Firebase
google-services.json
app/google-services.json

### Temporary files

Expand Down
1 change: 0 additions & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ if pluginEnabled?(ENV["JUNIT_ENABLED"])
junit.report
end
end

# Jacoco reporting:
unless envBlank?(ENV["JACOCO_REPORT_PATH"])
# Uncomment to enforce minimum coverage of your choice, causing build fail when this is not met:
#jacoco.minimum_project_coverage_percentage = 50
#jacoco.minimum_class_coverage_percentage = 75

# Specify your exact report location
jacoco.report(ENV["JACOCO_REPORT_PATH"])
end

# Jira link commenting (based on PR title or commits messages):
unless envBlank?(ENV["JIRA_IDENTIFIERS"]) || envBlank?(ENV["JIRA_SUBDOMAIN"])
jira.check(
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ gem 'danger'
gem 'danger-android_lint'
gem 'danger-kotlin_detekt'
gem 'danger-junit'
gem 'danger-jacoco'
gem 'danger-slack'
gem 'danger-jira'
gem 'danger-apkanalyzer'
58 changes: 23 additions & 35 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'com.vanniktech.android.junit.jacoco'
apply plugin: 'io.fabric'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'

ext {

secrets = [
firebaseCloudMessagingServerKey: keyProperty("FIREBASE_CLOUD_MESSAGING_SERVER_KEY")
]
}

android {
compileSdkVersion 29
namespace 'co.netguru.baby.monitor.client'
compileSdkVersion 33
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.netguru.babyguard"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 33
versionCode isBitrise ? Integer.parseInt(bitrise.io.buildNumber) : 1
versionName '0.5.0'
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}

buildFeatures {
buildConfig = true
}
viewBinding {
enabled = true
}

buildTypes {
debug {
versionNameSuffix "-DEBUG"
Expand Down Expand Up @@ -87,35 +92,16 @@ android {
sourceSets.all {
it.java.srcDir "src/$it.name/kotlin"
}
junitJacoco {
jacocoVersion = '0.8.2'
excludes = ['android/databinding/**/*.class',
'**/android/databinding/*Binding.class',
'**/BR.*',
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*$ViewInjector*.*',
'**/*$ViewBinder*.*',
'**/*_MembersInjector.class',
'**/Dagger*Component.class',
'**/Dagger*Component$Builder.class',
'**/*Module_*Factory.class',
'**/AutoValue_*.*',
'**/*JavascriptBridge.class',
'**/Lambda$*.class',
'**/Lambda.class',
'**/*Lambda.class',
'**/*Lambda*.class']
}
lintOptions {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
viewBinding {
enabled = true
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
Expand All @@ -128,9 +114,6 @@ kapt {
correctErrorTypes = true
}

androidExtensions {
experimental = true
}

configurations {
dependencyUpdates.resolutionStrategy = {
Expand All @@ -148,6 +131,11 @@ configurations {
}

dependencies {

implementation 'com.google.firebase:firebase-perf:20.3.3'
implementation 'org.slf4j:slf4j-api:1.7.32'
implementation 'org.slf4j:slf4j-simple:1.7.32'

//Kotlin
implementation libs.kotlin
implementation libs.constraintLayout
Expand Down Expand Up @@ -234,9 +222,9 @@ dependencies {
implementation libs.okHttp

//Firebase Analytics
implementation libs.firebaseAnalytics
implementation libs.crashlytics
implementation libs.firebasePerformance
implementation platform(libs.firebaseBom)
implementation libs.firebaseAnalythics
implementation libs.firebaseCrashlytics

implementation libs.deviceNames

Expand Down
19 changes: 9 additions & 10 deletions app/proguard-rules-release-preprod.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,13 @@
native <methods>;
}

# app compat-v7
-keep class android.support.v7.widget.SearchView { *; }

# FragmentArgs
-keep class com.hannesdorfmann.fragmentargs.** { *; }

# Gson
-keep class sun.misc.Unsafe { *; }

# retrofit
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
-dontnote retrofit2.Platform
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
-dontwarn retrofit2.Platform$Java8
-keepattributes Signature
-keepattributes Exceptions

Expand Down Expand Up @@ -79,7 +70,6 @@

# glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
Expand All @@ -103,3 +93,12 @@

#Firebase Database
-keep class co.netguru.baby.monitor.client.data.communication.firebase.** { *; }

#Navigation component classes
-keep class androidx.navigation.** { *; }

#Navigation-related resources
-keep class **.R$* {
<fields>;
}

18 changes: 8 additions & 10 deletions app/proguard-rules-release.pro
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,13 @@
public static *** d(...);
}

# app compat-v7
-keep class android.support.v7.widget.SearchView { *; }

# FragmentArgs
-keep class com.hannesdorfmann.fragmentargs.** { *; }

# Gson
-keep class sun.misc.Unsafe { *; }

# retrofit
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
-dontnote retrofit2.Platform
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
-dontwarn retrofit2.Platform$Java8
-keepattributes Signature
-keepattributes Exceptions

Expand Down Expand Up @@ -87,7 +78,6 @@

# glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
Expand All @@ -111,3 +101,11 @@

#Firebase Database
-keep class co.netguru.baby.monitor.client.data.communication.firebase.** { *; }

#Navigation component classes
-keep class androidx.navigation.** { *; }

#Navigation-related resources
-keep class **.R$* {
<fields>;
}
18 changes: 8 additions & 10 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,13 @@
# TODO 07.09.2017 or all their members should be annotated with @SerializedName().
-keepclassmembernames class co.netguru.android.template.data.**.model.** { *; }

# app compat-v7
-keep class android.support.v7.widget.SearchView { *; }

# FragmentArgs
-keep class com.hannesdorfmann.fragmentargs.** { *; }

# Gson
-keep class sun.misc.Unsafe { *; }

# retrofit
-keepclasseswithmembers class * {
@retrofit2.http.* <methods>;
}
-dontnote retrofit2.Platform
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
-dontwarn retrofit2.Platform$Java8
-keepattributes Signature
-keepattributes Exceptions

Expand Down Expand Up @@ -84,7 +75,6 @@

# glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
Expand Down Expand Up @@ -116,3 +106,11 @@ public static ** valueOf(java.lang.String);
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception

#Navigation component classes
-keep class androidx.navigation.** { *; }

#Navigation-related resources
-keep class **.R$* {
<fields>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class DebugNotificationManager @Inject constructor(
service,
CRY_ACTION_REQUEST_CODE,
receiver.cryingBabyIntent(),
NO_FLAGS
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
)
.addAction(
Expand All @@ -83,7 +83,7 @@ class DebugNotificationManager @Inject constructor(
service,
LOW_BATTERY_ACTION_REQUEST_CODE,
receiver.lowBatteryIntent(),
NO_FLAGS
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
)
.addAction(
Expand All @@ -93,7 +93,7 @@ class DebugNotificationManager @Inject constructor(
service,
NOISE_ACTION_REQUEST_CODE,
receiver.noiseDetectedIntent(),
NO_FLAGS
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
)
)
.build()
Expand Down Expand Up @@ -123,7 +123,7 @@ class DebugNotificationManager @Inject constructor(
}
}

internal fun register(context: Context) {
fun register(context: Context) {
context.registerReceiver(this, IntentFilter(ACTION_DEBUG_NOTIFICATION))
}

Expand All @@ -132,13 +132,13 @@ class DebugNotificationManager @Inject constructor(
putExtra(KEY_DEBUG_NOTIFICATION_EXTRA, action)
}

internal fun cryingBabyIntent() =
fun cryingBabyIntent() =
intent(DebugNotificationAction.BABY_CRYING)

internal fun lowBatteryIntent() =
fun lowBatteryIntent() =
intent(DebugNotificationAction.LOW_BATTERY)

internal fun noiseDetectedIntent() =
fun noiseDetectedIntent() =
intent(DebugNotificationAction.NOISE_DETECTED)
}

Expand All @@ -154,7 +154,6 @@ class DebugNotificationManager @Inject constructor(
"co.netguru.baby.KEY_DEBUG_NOTIFICATION_EXTRA"
private const val DEBUG_NOTIFICATION_ID = 987
private const val NO_ICON = 0
private const val NO_FLAGS = 0
private const val CRY_ACTION_REQUEST_CODE = 1
private const val LOW_BATTERY_ACTION_REQUEST_CODE = 2
private const val NOISE_ACTION_REQUEST_CODE = 3
Expand Down