diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa9bb447a..3dfc78a9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: uses: android-actions/setup-android@v3 - name: Install Android SDK run: | - sdkmanager "platforms;android-23" + sdkmanager "platforms;android-26" # Testing - name: Gradle Check diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle index 94beb432c..83fe952cd 100644 --- a/build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle +++ b/build-logic/src/main/groovy/org.igniterealtime.smack.android-conventions.gradle @@ -3,7 +3,7 @@ plugins { id 'org.igniterealtime.smack.global-conventions' } dependencies { - signature "net.sf.androidscents.signature:android-api-level-${smackMinAndroidSdk}:6.0_r3@signature" + signature "net.sf.androidscents.signature:android-api-level-${smackMinAndroidSdk}:8.0.0_r2@signature" } animalsniffer { sourceSets = [sourceSets.main] diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle index 5bd92c7ee..751178ed0 100644 --- a/build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle +++ b/build-logic/src/main/groovy/org.igniterealtime.smack.global-conventions.gradle @@ -1,7 +1,7 @@ ext { javaVersion = JavaVersion.VERSION_11 javaMajor = javaVersion.getMajorVersion() - smackMinAndroidSdk = 23 + smackMinAndroidSdk = 26 androidBootClasspath = { getAndroidRuntimeJar() } } diff --git a/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java b/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java index 0315629c8..145098281 100644 --- a/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java +++ b/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java @@ -173,7 +173,13 @@ public final class ServerPingWithAlarmManager extends Manager { */ public static void onCreate(Context context) { sContext = context; - context.registerReceiver(ALARM_BROADCAST_RECEIVER, new IntentFilter(PING_ALARM_ACTION)); + + int receiverFlags = 0; + if (Build.VERSION.SDK_INT >= 34) { + receiverFlags |= 4; // RECEIVER_NOT_EXPORTED + } + context.registerReceiver(ALARM_BROADCAST_RECEIVER, new IntentFilter(PING_ALARM_ACTION), receiverFlags); + sAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); int pendingIntentFlags = 0; if (Build.VERSION.SDK_INT >= 23) {