Skip to content

Commit

Permalink
Added check for release build
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatkumardhamija committed Oct 31, 2020
1 parent 19d9dc0 commit 5def0fa
Show file tree
Hide file tree
Showing 12 changed files with 7 additions and 130 deletions.
1 change: 0 additions & 1 deletion .idea/gradle.xml

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

3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
debugImplementation(project(':rsod'))
releaseImplementation(project(':rsod-no-impl'))
implementation(project(':rsod'))
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand Down
1 change: 0 additions & 1 deletion rsod-no-impl/.gitignore

This file was deleted.

44 changes: 0 additions & 44 deletions rsod-no-impl/build.gradle

This file was deleted.

Empty file removed rsod-no-impl/consumer-rules.pro
Empty file.
21 changes: 0 additions & 21 deletions rsod-no-impl/proguard-rules.pro

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions rsod-no-impl/src/main/AndroidManifest.xml

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 6 additions & 4 deletions rsod/src/main/java/me/rajatdhamija/rsod/RedScreenOfDeath.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import android.content.Context
object RedScreenOfDeath {
@JvmStatic
fun init(application: Application) {
val crashListener =
UncaughtExceptionListener { t, e -> handleUncaughtException(application, t, e) }
val crashHandler = UncaughtExceptionHandler(crashListener)
Thread.setDefaultUncaughtExceptionHandler(crashHandler)
if (BuildConfig.DEBUG) {
val crashListener =
UncaughtExceptionListener { t, e -> handleUncaughtException(application, t, e) }
val crashHandler = UncaughtExceptionHandler(crashListener)
Thread.setDefaultUncaughtExceptionHandler(crashHandler)
}
}

private fun handleUncaughtException(context: Context, thread: Thread, throwable: Throwable) {
Expand Down
1 change: 0 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include ':rsod-no-impl'
include ':rsod'
include ':app'
rootProject.name = "RedScreen Of Death"

0 comments on commit 5def0fa

Please sign in to comment.