2022-11-18 23:02:22 +01:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
2021-10-25 15:01:10 +02:00
|
|
|
apply plugin: 'com.android.application'
|
|
|
|
apply plugin: 'kotlin-android'
|
2021-10-30 03:13:58 +02:00
|
|
|
apply plugin: 'kotlin-kapt'
|
|
|
|
apply plugin: 'com.google.gms.google-services'
|
2021-10-25 15:01:10 +02:00
|
|
|
|
|
|
|
android {
|
2022-11-18 23:07:15 +01:00
|
|
|
compileSdkVersion 33
|
2021-10-25 15:01:10 +02:00
|
|
|
|
|
|
|
defaultConfig {
|
2024-10-23 13:43:27 +02:00
|
|
|
applicationId "foundation.e.ntfy"
|
2024-09-19 10:55:15 +02:00
|
|
|
minSdkVersion 23
|
2022-11-18 23:07:15 +01:00
|
|
|
targetSdkVersion 33
|
2021-11-03 21:24:36 +01:00
|
|
|
|
2023-03-03 02:55:49 +01:00
|
|
|
versionCode 33
|
|
|
|
versionName "1.17.0"
|
2021-10-25 15:01:10 +02:00
|
|
|
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
2021-11-12 04:14:28 +01:00
|
|
|
|
|
|
|
/* Required for Room schema migrations */
|
|
|
|
javaCompileOptions {
|
|
|
|
annotationProcessorOptions {
|
|
|
|
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
|
|
|
}
|
|
|
|
}
|
2021-10-25 15:01:10 +02:00
|
|
|
}
|
|
|
|
|
2024-09-11 13:47:27 +02:00
|
|
|
buildFeatures {
|
|
|
|
viewBinding = true
|
|
|
|
}
|
|
|
|
|
2021-10-25 15:01:10 +02:00
|
|
|
buildTypes {
|
|
|
|
release {
|
2021-11-01 19:28:57 +01:00
|
|
|
minifyEnabled true
|
|
|
|
debuggable false
|
2021-11-21 14:56:24 +01:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
2021-11-01 19:28:57 +01:00
|
|
|
}
|
|
|
|
debug {
|
2021-10-25 15:01:10 +02:00
|
|
|
minifyEnabled false
|
2021-11-01 19:28:57 +01:00
|
|
|
debuggable true
|
2021-11-21 14:56:24 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
flavorDimensions "store"
|
|
|
|
productFlavors {
|
2021-11-24 22:12:51 +01:00
|
|
|
play {
|
|
|
|
buildConfigField 'boolean', 'FIREBASE_AVAILABLE', 'true'
|
2022-01-20 05:40:03 +01:00
|
|
|
buildConfigField 'boolean', 'RATE_APP_AVAILABLE', 'true'
|
2022-12-06 02:24:05 +01:00
|
|
|
buildConfigField 'boolean', 'INSTALL_PACKAGES_AVAILABLE', 'false'
|
2021-11-21 14:56:24 +01:00
|
|
|
}
|
2021-11-24 22:12:51 +01:00
|
|
|
fdroid {
|
|
|
|
buildConfigField 'boolean', 'FIREBASE_AVAILABLE', 'false'
|
2022-01-20 05:40:03 +01:00
|
|
|
buildConfigField 'boolean', 'RATE_APP_AVAILABLE', 'false'
|
2022-12-06 02:24:05 +01:00
|
|
|
buildConfigField 'boolean', 'INSTALL_PACKAGES_AVAILABLE', 'true'
|
2021-10-25 15:01:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
|
|
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
2022-11-19 01:54:32 +01:00
|
|
|
freeCompilerArgs += [
|
|
|
|
'-Xjvm-default=all-compatibility' // https://stackoverflow.com/a/71234042/1440785
|
|
|
|
]
|
2021-10-25 15:01:10 +02:00
|
|
|
}
|
2024-10-23 13:43:27 +02:00
|
|
|
namespace "io.heckel.ntfy"
|
2021-10-25 15:01:10 +02:00
|
|
|
}
|
|
|
|
|
2022-12-06 02:24:05 +01:00
|
|
|
// Disables GoogleServices tasks for F-Droid variant
|
2022-11-08 19:14:25 +01:00
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
def shouldProcessGoogleServices = variant.flavorName == "play"
|
|
|
|
def googleTask = tasks.findByName("process${variant.name.capitalize()}GoogleServices")
|
|
|
|
googleTask.enabled = shouldProcessGoogleServices
|
|
|
|
}
|
|
|
|
|
2022-12-06 02:24:05 +01:00
|
|
|
// Strips out REQUEST_INSTALL_PACKAGES permission for Google Play variant
|
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
def shouldStripInstallPermission = variant.flavorName == "play"
|
|
|
|
if (shouldStripInstallPermission) {
|
|
|
|
variant.outputs.each { output ->
|
|
|
|
def processManifest = output.getProcessManifestProvider().get()
|
|
|
|
processManifest.doLast { task ->
|
|
|
|
def outputDir = task.getMultiApkManifestOutputDirectory().get().asFile
|
|
|
|
def manifestOutFile = file("$outputDir/AndroidManifest.xml")
|
|
|
|
def newFileContents = manifestOutFile.collect { s -> s.contains("android.permission.REQUEST_INSTALL_PACKAGES") ? "" : s }.join("\n")
|
|
|
|
manifestOutFile.write(newFileContents, 'UTF-8')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-10-25 15:01:10 +02:00
|
|
|
dependencies {
|
2022-01-21 20:15:53 +01:00
|
|
|
// AndroidX, The Basics
|
2023-05-20 02:19:19 +02:00
|
|
|
implementation "androidx.appcompat:appcompat:1.6.1"
|
|
|
|
implementation "androidx.core:core-ktx:1.10.1"
|
2022-06-18 02:16:49 +02:00
|
|
|
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
|
2023-05-20 02:19:19 +02:00
|
|
|
implementation "androidx.activity:activity-ktx:1.7.1"
|
|
|
|
implementation "androidx.fragment:fragment-ktx:1.5.7"
|
|
|
|
implementation "androidx.work:work-runtime-ktx:2.8.1"
|
2022-01-28 20:40:09 +01:00
|
|
|
implementation 'androidx.preference:preference-ktx:1.2.0'
|
2021-11-12 01:41:29 +01:00
|
|
|
|
2022-01-21 20:15:53 +01:00
|
|
|
// JSON serialization
|
2022-11-18 23:02:22 +01:00
|
|
|
implementation 'com.google.code.gson:gson:2.10'
|
2022-01-21 20:15:53 +01:00
|
|
|
|
2021-11-01 14:57:05 +01:00
|
|
|
// Room (SQLite)
|
2023-05-20 02:19:19 +02:00
|
|
|
def room_version = "2.5.1"
|
2022-01-21 20:15:53 +01:00
|
|
|
implementation "androidx.room:room-ktx:$room_version"
|
|
|
|
kapt "androidx.room:room-compiler:$room_version"
|
2021-10-30 03:13:58 +02:00
|
|
|
|
2021-11-12 01:41:29 +01:00
|
|
|
// OkHttp (HTTP library)
|
2022-11-19 02:08:24 +01:00
|
|
|
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
|
2021-11-01 14:57:05 +01:00
|
|
|
|
2021-11-21 14:56:24 +01:00
|
|
|
// Firebase, sigh ... (only Google Play)
|
2023-05-20 02:19:19 +02:00
|
|
|
playImplementation 'com.google.firebase:firebase-messaging:23.1.2'
|
2021-10-30 03:13:58 +02:00
|
|
|
|
2021-10-25 15:01:10 +02:00
|
|
|
// RecyclerView
|
2023-05-20 02:19:19 +02:00
|
|
|
implementation "androidx.recyclerview:recyclerview:1.3.0"
|
2021-10-25 15:01:10 +02:00
|
|
|
|
2021-11-14 20:20:30 +01:00
|
|
|
// Swipe down to refresh
|
|
|
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
|
|
|
|
2021-10-25 15:01:10 +02:00
|
|
|
// Material design
|
2023-05-20 02:19:19 +02:00
|
|
|
implementation "com.google.android.material:material:1.9.0"
|
2021-10-25 15:01:10 +02:00
|
|
|
|
|
|
|
// LiveData
|
2023-05-20 02:19:19 +02:00
|
|
|
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.6.1"
|
2021-10-28 04:25:02 +02:00
|
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
2022-01-10 21:36:50 +01:00
|
|
|
|
|
|
|
// Image viewer
|
|
|
|
implementation 'com.github.stfalcon-studio:StfalconImageViewer:v1.0.1'
|
2024-09-11 13:47:27 +02:00
|
|
|
|
|
|
|
implementation 'foundation.e:elib:0.0.1-alpha11'
|
2021-10-25 15:01:10 +02:00
|
|
|
}
|