diff --git a/app/build.gradle b/app/build.gradle index 2632539..c938837 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,19 +3,19 @@ plugins { } dependencies { - implementation 'androidx.core:core:1.6.0' + implementation 'androidx.core:core:1.9.0' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' } android { - compileSdkVersion 32 + compileSdkVersion 33 defaultConfig { applicationId "org.purplei2p.i2pd" - targetSdkVersion 32 + targetSdkVersion 33 minSdkVersion 16 - versionCode 2450001 - versionName "2.45.0.1" + versionCode 2450020 + versionName "2.45.0.2" archivesBaseName += "-$versionName" ndkVersion "23.2.8568313" @@ -73,6 +73,7 @@ android { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } + namespace 'org.purplei2p.i2pd' } ext.abiCodes = ['armeabi-v7a': 1, 'x86': 2, 'arm64-v8a': 3, 'x86_64': 4] @@ -83,7 +84,7 @@ android.applicationVariants.all { variant -> def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI)) if (baseAbiVersionCode != null) { - output.versionCodeOverride = baseAbiVersionCode * 10 + variant.versionCode + output.versionCodeOverride = baseAbiVersionCode + variant.versionCode } } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 03d5ee7..9e2edce 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,11 +1,14 @@ - - - + + + @@ -42,13 +45,14 @@ android:label="NetworkChangeReceiver" android:exported="true" > - + + android:exported="true" > diff --git a/app/src/main/java/org/purplei2p/i2pd/ForegroundService.java b/app/src/main/java/org/purplei2p/i2pd/ForegroundService.java index 17bab87..c6b87e6 100644 --- a/app/src/main/java/org/purplei2p/i2pd/ForegroundService.java +++ b/app/src/main/java/org/purplei2p/i2pd/ForegroundService.java @@ -1,5 +1,7 @@ package org.purplei2p.i2pd; +import static android.app.PendingIntent.FLAG_IMMUTABLE; + import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; @@ -139,19 +141,19 @@ public class ForegroundService extends Service { // The PendingIntent to launch our activity if the user selects this notification PendingIntent contentIntent = PendingIntent.getActivity(this, 0, - new Intent(this, I2PDActivity.class), 0); + new Intent(this, I2PDActivity.class), + Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? FLAG_IMMUTABLE : 0); // If earlier version channel ID is not used // https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#NotificationCompat.Builder(android.content.Context) - String channelId = Build.VERSION.SDK_INT >= 26 ? createNotificationChannel() : ""; + String channelId = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? createNotificationChannel() : ""; // Set the info for the views that show in the notification panel. NotificationCompat.Builder builder = new NotificationCompat.Builder(this, channelId) .setOngoing(true) .setSmallIcon(R.drawable.ic_notification_icon); // the status icon - if (Build.VERSION.SDK_INT >= 16) - builder = builder.setPriority(Notification.PRIORITY_DEFAULT); - if (Build.VERSION.SDK_INT >= 21) + builder = builder.setPriority(Notification.PRIORITY_DEFAULT); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) builder = builder.setCategory(Notification.CATEGORY_SERVICE); Notification notification = builder .setTicker(text) // the status text diff --git a/build.gradle b/build.gradle index d0562b6..c7da454 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,17 @@ buildscript { repositories { - jcenter() + mavenCentral() google() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' + classpath 'com.android.tools.build:gradle:7.3.1' } } allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a2e01c0..1debed0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=f581709a9c35e9cb92e16f585d2c4bc99b2b1a5f85d2badbd3dc6bff59e1e6dd -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionSha256Sum=8cc27038d5dbd815759851ba53e70cf62e481b87494cc97cfd97982ada5ba634 +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists