Skip to content

Commit 85bebb3

Browse files
author
CraZyLegenD
committed
build: updated dependencies and removed kotlin-android-extensions since it'll be deprecated soon, made some of the utils internal and added time to check when the library was initialized as a var
1 parent ca39627 commit 85bebb3

File tree

8 files changed

+18
-11
lines changed

8 files changed

+18
-11
lines changed

app/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
43

54
android {
65
compileSdkVersion 30
@@ -40,10 +39,10 @@ android {
4039
dependencies {
4140
implementation fileTree(dir: "libs", include: ["*.jar"])
4241
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
43-
implementation 'androidx.core:core-ktx:1.5.0-alpha03'
42+
implementation 'androidx.core:core-ktx:1.5.0-alpha04'
4443
implementation 'androidx.appcompat:appcompat:1.2.0'
45-
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
46-
testImplementation 'junit:junit:4.13'
44+
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
45+
testImplementation 'junit:junit:4.13.1'
4746
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
4847
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
4948

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ task clean(type: Delete) {
2323

2424
ext {
2525
//tests
26-
junitVersion = '4.13'
26+
junitVersion = '4.13.1'
2727
hamcrestVersion = '1.3'
2828
androidXTestCoreVersion = '1.3.0'
2929
androidXTestExtKotlinRunnerVersion = '1.1.2'

crashyreporter/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3-
apply plugin: 'kotlin-android-extensions'
43

54
android {
65
compileSdkVersion 30
@@ -40,7 +39,7 @@ dependencies {
4039
implementation fileTree(dir: "libs", include: ["*.jar"])
4140
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
4241

43-
implementation 'androidx.core:core-ktx:1.3.1'
42+
implementation 'androidx.core:core-ktx:1.3.2'
4443

4544
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
4645
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

crashyreporter/src/main/java/com/crazylegend/crashyreporter/CrashyReporter.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ import java.util.*
1818
*/
1919
object CrashyReporter {
2020

21+
/**
22+
* Checks what time the library was initialized
23+
* -1 if not initialized
24+
*/
25+
var initializeTime: Long = -1
26+
private set
27+
2128
private lateinit var applicationContext: Context
2229

2330
//paths
@@ -61,6 +68,7 @@ object CrashyReporter {
6168
fun initialize(context: Context) {
6269
applicationContext = context
6370
setupExceptionHandler()
71+
initializeTime = System.currentTimeMillis()
6472
}
6573

6674

crashyreporter/src/main/java/com/crazylegend/crashyreporter/utils/ApplicationUtils.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import java.util.*
1010
* Created by crazy on 7/19/20 to long live and prosper !
1111
*/
1212

13-
object ApplicationUtils {
13+
internal object ApplicationUtils {
1414

1515
internal fun appendApplicationInfo(context: Context): String {
1616
return "*********** Application info ***********\n" +
@@ -27,6 +27,7 @@ object ApplicationUtils {
2727
"Last updated: ${CrashyReporter.dateFormat.format(Date(context.lastUpdateTime))}\n" +
2828
"Requested permissions: ${context.requestedPermissions?.mapWithoutNewLine().notAvailableIfNull()}\n" +
2929
"Default prefs: ${SharedPreferencesUtil.collect(context).notAvailableIfNull()}\n" +
30+
"Default prefs: ${SharedPreferencesUtil.collect(context).notAvailableIfNull()}\n" +
3031
"\n" +
3132
"*********** END of Application info ***********" +
3233
"\n" +

crashyreporter/src/main/java/com/crazylegend/crashyreporter/utils/CPUInfo.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import java.io.IOException
88
/**
99
* Created by crazy on 7/19/20 to long live and prosper !
1010
*/
11-
object CPUInfo {
11+
internal object CPUInfo {
1212

1313
fun getNumberOfCores() = Runtime.getRuntime().availableProcessors()
1414

crashyreporter/src/main/java/com/crazylegend/crashyreporter/utils/RootUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import java.io.InputStreamReader
99
* Created by crazy on 2/6/19 to long live and prosper !
1010
*/
1111

12-
object RootUtils {
12+
internal object RootUtils {
1313

1414
internal val isDeviceRooted: Boolean
1515
get() = checkRootMethod1() || checkRootMethod2() || checkRootMethod3()

crashyreporter/src/main/java/com/crazylegend/crashyreporter/utils/SharedPreferencesUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import com.crazylegend.crashyreporter.extensions.mapWithoutNewLine
88
/**
99
* Created by crazy on 7/20/20 to long live and prosper !
1010
*/
11-
object SharedPreferencesUtil {
11+
internal object SharedPreferencesUtil {
1212

1313
fun collect(context: Context) =
1414
PreferenceManager.getDefaultSharedPreferences(context).all.iterator().asSequence().map {

0 commit comments

Comments
 (0)