From bf283e67751ececf42496d3e76c68a1b5080b5c3 Mon Sep 17 00:00:00 2001 From: Muhamad Wahyudin Date: Tue, 20 Aug 2024 13:51:30 +0700 Subject: [PATCH 1/2] chore: upgrade gradle plugin & target api 34 --- app/build.gradle | 18 +++++++-------- app/src/main/AndroidManifest.xml | 4 ++-- .../recentapps/thumbnailhiding/sample/App.kt | 2 -- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 4 ++-- lib/build.gradle | 22 ++++++++++--------- .../thumbnailhiding/HardwareKeyWatcher.java | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2b32f4f..50ccd31 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,13 +3,13 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 - buildToolsVersion "30.0.2" + namespace "co.nimblehq.recentapps.thumbnailhiding.sample" + compileSdk 34 defaultConfig { applicationId "co.nimblehq.recentapps.thumbnailhiding.sample" - minSdkVersion 14 - targetSdkVersion 29 + minSdkVersion 21 + targetSdkVersion 34 versionCode 1 versionName "1.0" multiDexEnabled true @@ -30,11 +30,11 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'androidx.constraintlayout:constraintlayout:2.0.2' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9b34ae2..a69061b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -10,14 +10,14 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + - + diff --git a/app/src/main/java/co/nimblehq/recentapps/thumbnailhiding/sample/App.kt b/app/src/main/java/co/nimblehq/recentapps/thumbnailhiding/sample/App.kt index 0ff057d..6f69fd6 100644 --- a/app/src/main/java/co/nimblehq/recentapps/thumbnailhiding/sample/App.kt +++ b/app/src/main/java/co/nimblehq/recentapps/thumbnailhiding/sample/App.kt @@ -2,7 +2,6 @@ package co.nimblehq.recentapps.thumbnailhiding.sample import android.app.Application import android.content.Context -import androidx.multidex.MultiDex import co.nimblehq.recentapps.thumbnailhiding.RecentAppsThumbnailHidingLifecycleTracker class App : Application() { @@ -14,6 +13,5 @@ class App : Application() { override fun attachBaseContext(base: Context?) { super.attachBaseContext(base) - MultiDex.install(this) } } diff --git a/build.gradle b/build.gradle index e647301..3390e99 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.4.0" + ext.kotlin_version = "1.7.20" repositories { google() jcenter() } dependencies { - classpath "com.android.tools.build:gradle:4.0.1" + classpath 'com.android.tools.build:gradle:8.4.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dbcf637..5af5d03 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Oct 08 13:23:03 ICT 2020 +#Tue Aug 20 13:25:55 WIB 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/lib/build.gradle b/lib/build.gradle index c1c8e1c..3d11bcb 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -3,19 +3,21 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 29 - buildToolsVersion "30.0.2" + namespace "co.nimblehq.recentapps.thumbnailhiding" + compileSdk 34 defaultConfig { - minSdkVersion 14 - targetSdkVersion 29 - versionCode 1 - versionName "1.0" + minSdkVersion 21 + targetSdkVersion 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" } + buildFeatures { + buildConfig = true + } + buildTypes { release { minifyEnabled false @@ -25,9 +27,9 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.3.1' - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + implementation 'androidx.appcompat:appcompat:1.5.1' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } diff --git a/lib/src/main/java/co/nimblehq/recentapps/thumbnailhiding/HardwareKeyWatcher.java b/lib/src/main/java/co/nimblehq/recentapps/thumbnailhiding/HardwareKeyWatcher.java index e01a65a..a21fde0 100644 --- a/lib/src/main/java/co/nimblehq/recentapps/thumbnailhiding/HardwareKeyWatcher.java +++ b/lib/src/main/java/co/nimblehq/recentapps/thumbnailhiding/HardwareKeyWatcher.java @@ -34,7 +34,7 @@ public void setOnHardwareKeysPressedListenerListener(OnHardwareKeysPressedListen public void startWatch() { if (mReceiver != null) { logForDebugging("startWatch on " + mContext); - mContext.registerReceiver(mReceiver, mFilter); + mContext.registerReceiver(mReceiver, mFilter, Context.RECEIVER_EXPORTED); } } From af3702fb7a94c733ed81a24f10fb738f5559a7a1 Mon Sep 17 00:00:00 2001 From: Muhamad Wahyudin Date: Tue, 20 Aug 2024 14:05:14 +0700 Subject: [PATCH 2/2] chore: add jitpack yaml config to override jdk version --- build.gradle | 2 +- jitpack.yml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 jitpack.yml diff --git a/build.gradle b/build.gradle index 3390e99..9016740 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:8.4.2' + classpath 'com.android.tools.build:gradle:8.5.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..f29a667 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,5 @@ +jdk: + - openjdk17 +before_install: + - sdk install java 17.0.1-open + - sdk use java 17.0.1-open \ No newline at end of file