Skip to content

Commit cc8844a

Browse files
committed
Update to Android 14
1 parent ace9198 commit cc8844a

File tree

10 files changed

+70
-41
lines changed

10 files changed

+70
-41
lines changed

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/build.gradle

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
apply plugin: "com.android.application"
2020

2121
apply plugin: "kotlin-android"
22-
apply plugin: "kotlin-android-extensions"
2322

2423
apply plugin: "com.gladed.androidgitversion"
2524

@@ -31,10 +30,10 @@ ext {
3130
* Android variables
3231
********************
3332
*/
34-
compile_sdk_version = 30
33+
compile_sdk_version = 34
3534
min_sdk_version = 21
36-
target_sdk_version = 30
37-
build_tools_version = "30.0.2"
35+
target_sdk_version = 34
36+
build_tools_version = "34.0.0"
3837
}
3938

4039
android {
@@ -89,7 +88,7 @@ android {
8988
}
9089
}
9190

92-
sourceSets.all {
91+
sourceSets.configureEach {
9392
java.srcDirs += "src/${name}/kotlin"
9493
}
9594

@@ -109,13 +108,13 @@ dependencies {
109108

110109
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
111110

112-
implementation "androidx.appcompat:appcompat:1.2.0"
113-
implementation "androidx.core:core-ktx:1.3.2"
114-
implementation "androidx.constraintlayout:constraintlayout:2.0.4"
111+
implementation "androidx.appcompat:appcompat:1.6.1"
112+
implementation "androidx.core:core-ktx:1.10.1"
113+
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
115114

116115
testImplementation "junit:junit:4.13.2"
117116

118-
androidTestImplementation "androidx.test:runner:1.3.0"
119-
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
120-
implementation "com.google.android.material:material:1.3.0"
117+
androidTestImplementation "androidx.test:runner:1.5.2"
118+
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
119+
implementation "com.google.android.material:material:1.9.0"
121120
}

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
android:theme="@style/AppTheme"
3131
tools:ignore="GoogleAppIndexingWarning">
3232

33-
<activity android:name="com.hyperdevs.appupdateshelper.app.MainActivity">
33+
<activity android:name="com.hyperdevs.appupdateshelper.app.MainActivity" android:exported="true">
3434
<intent-filter>
3535
<action android:name="android.intent.action.MAIN"/>
3636
<category android:name="android.intent.category.LAUNCHER"/>

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@
1717
// Top-level build file where you can add configuration options common to all sub-projects/modules.
1818

1919
buildscript {
20-
ext.kotlin_version = "1.4.32"
20+
ext.kotlin_version = "1.8.22"
2121

2222
repositories {
2323
google()
24-
jcenter()
2524
mavenCentral()
2625
maven { url "https://plugins.gradle.org/m2/" }
2726
}
2827
dependencies {
29-
classpath "com.android.tools.build:gradle:4.1.3"
28+
classpath "com.android.tools.build:gradle:7.4.2"
3029
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
3130
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
3231
classpath "com.gladed.androidgitversion:gradle-android-git-version:0.4.14"
@@ -36,11 +35,12 @@ buildscript {
3635
allprojects {
3736
repositories {
3837
google()
39-
jcenter()
38+
mavenCentral()
39+
maven { url "https://plugins.gradle.org/m2/" }
4040
}
4141

4242
ext {
43-
kotlin_version = "1.4.32"
43+
kotlin_version = "1.8.22"
4444
}
4545
}
4646

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip

lib/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ ext {
3131
* Android variables
3232
********************
3333
*/
34-
compile_sdk_version = 30
34+
compile_sdk_version = 34
3535
min_sdk_version = 21
36-
target_sdk_version = 30
37-
build_tools_version = "30.0.2"
36+
target_sdk_version = 34
37+
build_tools_version = "34.0.0"
3838
}
3939

4040
android {
@@ -66,16 +66,16 @@ android {
6666
dependencies {
6767
implementation fileTree(dir: "libs", include: ["*.jar"])
6868

69-
implementation "androidx.annotation:annotation:1.2.0"
70-
implementation "androidx.appcompat:appcompat:1.2.0"
69+
implementation "androidx.annotation:annotation:1.6.0"
70+
implementation "androidx.appcompat:appcompat:1.6.1"
7171

7272
// Needed for the in-app updates API
73-
api "com.google.android.play:core:1.8.2"
73+
api "com.google.android.play:app-update:2.1.0"
7474

7575
testImplementation "junit:junit:4.13.2"
7676

77-
androidTestImplementation "androidx.test:runner:1.3.0"
78-
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
77+
androidTestImplementation "androidx.test:runner:1.5.2"
78+
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
7979
}
8080

8181
// Build a jar with source files

lib/src/main/java/com/hyperdevs/appupdateshelper/AppUpdatesHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@
2626
import android.util.Log;
2727
import android.view.View;
2828

29+
import com.google.android.gms.tasks.OnCompleteListener;
30+
import com.google.android.gms.tasks.Task;
2931
import com.google.android.play.core.appupdate.AppUpdateInfo;
3032
import com.google.android.play.core.appupdate.AppUpdateManager;
3133
import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
3234
import com.google.android.play.core.install.InstallState;
3335
import com.google.android.play.core.install.InstallStateUpdatedListener;
3436
import com.google.android.play.core.install.model.AppUpdateType;
35-
import com.google.android.play.core.tasks.OnCompleteListener;
36-
import com.google.android.play.core.tasks.Task;
3737

3838
import androidx.annotation.NonNull;
3939
import androidx.fragment.app.Fragment;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.hyperdevs.appupdateshelper;
2+
3+
import android.content.Context;
4+
import android.os.Build;
5+
6+
public class ContextUtils {
7+
/**
8+
* Constant to use in [registerReceiver] to declare that a registered receiver is not exported.
9+
* <p>
10+
* This is needed as the constant does not exist in Android < 34
11+
*/
12+
public static int getReceiverNotExported() {
13+
int value;
14+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
15+
value = Context.RECEIVER_NOT_EXPORTED;
16+
} else {
17+
value = 0;
18+
}
19+
return value;
20+
}
21+
22+
/**
23+
* Constant to use in [registerReceiver] to declare that a registered receiver is exported.
24+
* <p>
25+
* This is needed as the constant does not exist in Android < 34
26+
*/
27+
public static int getReceiverExported() {
28+
int value;
29+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
30+
value = Context.RECEIVER_EXPORTED;
31+
} else {
32+
value = 0;
33+
}
34+
return value;
35+
}
36+
}

0 commit comments

Comments
 (0)