Files
Inure/app/build.gradle
2025-05-15 23:12:24 +05:30

306 lines
9.7 KiB
Groovy

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'project-report'
id 'org.jetbrains.kotlin.android'
id 'com.google.devtools.ksp'
id 'kotlin-kapt'
id 'dev.rikka.tools.refine' version '4.4.0'
}
static def loadProperties(filePath) {
def properties = new Properties()
def file = new File(filePath)
if (file.exists()) {
properties.load(new FileInputStream(file))
} else {
println("Properties file not found: $filePath")
}
return properties
}
static def findKeystoreFile(properties) {
def path = System.getProperty("user.home") + "/work/_temp/keystore/"
def fallbackPath = properties.get("KEYSTORE_PATH")
def keystoreFileName = "key.jks"
def keystoreFile = new File(path, keystoreFileName)
if (!keystoreFile.exists() && fallbackPath != null) {
keystoreFile = new File(fallbackPath)
}
return keystoreFile
}
static def getEnvOrProperty(envKey, properties) {
return System.getenv(envKey) ?: properties.get(envKey)
}
android {
compileSdk 35
buildFeatures {
viewBinding false
aidl true
buildConfig true
compose false
}
defaultConfig {
applicationId "app.simple.inure"
minSdkVersion 23
targetSdkVersion 35
versionCode 10501
versionName "build105.0.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// buildConfigField 'string', "VIRUS_TOTAL_API_KEY", "${properties.getProperty("VIRUS_TOTAL_API_KEY").toString()}"
resValue "string", "versionName", versionName
externalNativeBuild {
cmake {
cppFlags ""
}
}
javaCompileOptions {
ksp {
arg("room.schemaLocation", "$projectDir/schemas".toString())
}
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
bundle {
language {
enableSplit = false
}
}
packagingOptions {
jniLibs {
keepDebugSymbols += ['**/*.so']
}
}
externalNativeBuild {
cmake {
path "src/main/jni/CMakeLists.txt"
}
}
signingConfigs {
release {
def properties = loadProperties("local.properties")
def keystoreFile = findKeystoreFile(properties)
if (keystoreFile.exists()) {
storeFile = keystoreFile
storePassword = getEnvOrProperty("SIGNING_STORE_PASSWORD", properties)
keyAlias = getEnvOrProperty("SIGNING_KEY_ALIAS", properties)
keyPassword = getEnvOrProperty("SIGNING_KEY_PASSWORD", properties)
} else {
storeFile = null
logger.error("Keystore file not found, signing disabled.")
}
}
}
flavorDimensions.add("version")
productFlavors {
github { // GitHub build
dimension "version"
if (signingConfigs.release != null && signingConfigs.release.storeFile != null) {
signingConfig signingConfigs.release
}
}
play { // Play Store build
dimension "version"
applicationIdSuffix ".play"
if (signingConfigs.release != null && signingConfigs.release.storeFile != null) {
signingConfig signingConfigs.release
}
}
pre {
dimension "version"
versionNameSuffix "-pre"
if (signingConfigs.release != null && signingConfigs.release.storeFile != null) {
signingConfig signingConfigs.release
}
// Include all github flavor files
sourceSets {
pre {
java.srcDirs += 'src/github/java'
res.srcDirs += 'src/github/res'
resources.srcDirs += 'src/github/resources'
}
}
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
dependenciesInfo {
includeInApk false
includeInBundle false
}
}
debug {
versionNameSuffix "_debug"
debuggable true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
dependenciesInfo {
includeInApk false
includeInBundle false
}
if (signingConfigs.release != null && signingConfigs.release.storeFile != null) {
signingConfig signingConfigs.release
}
}
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
ndkVersion '25.2.9519653'
namespace 'app.simple.inure'
tasks.register('generateVersionTxt') {
doLast {
file("./version.txt").text = android.defaultConfig.versionName
}
}
lint {
disable 'Instantiatable'
}
}
dependencies {
compileOnly project(':stub')
// Android Tools
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
implementation 'com.android.tools.build:apksig:4.0.2'
// Jar Libs, all included in the libs folder
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Test
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
// Kotlin
runtimeOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0'
// AndroidX
implementation 'androidx.core:core-ktx:1.16.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' // We use LocalBroadcastManager, Lol!!
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
implementation 'androidx.fragment:fragment-ktx:1.8.6'
implementation 'androidx.activity:activity-ktx:1.10.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.9.0'
implementation 'androidx.recyclerview:recyclerview:1.4.0'
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
implementation 'androidx.webkit:webkit:1.13.0'
implementation 'androidx.documentfile:documentfile:1.1.0'
implementation 'androidx.media:media:1.7.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0'
implementation 'androidx.dynamicanimation:dynamicanimation-ktx:1.1.0'
implementation 'androidx.work:work-runtime-ktx:2.10.1'
implementation 'androidx.transition:transition-ktx:1.6.0'
// Google
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.google.code.gson:gson:2.11.0'
implementation 'com.google.android.flexbox:flexbox:3.0.0'
playImplementation 'com.google.android.play:review:2.0.2'
playImplementation 'com.google.android.play:review-ktx:2.0.2'
// Glide
implementation 'com.github.bumptech.glide:glide:4.16.0'
implementation 'com.github.bumptech.glide:okhttp3-integration:4.16.0'
//noinspection KaptUsageInsteadOfKsp
ksp 'com.github.bumptech.glide:ksp:4.16.0'
// Toolkit
implementation 'com.github.android:renderscript-intrinsics-replacement-toolkit:b6363490c3'
// Third Party
implementation 'net.dongliu:apk-parser:2.6.10'
implementation 'com.caverock:androidsvg-aar:1.4'
implementation 'com.anggrayudi:storage:1.5.5'
implementation 'com.github.duanhong169:drawabletoolbox:1.0.7'
implementation "com.github.AppDevNext:AndroidChart:3.1.0.25"
implementation 'net.lingala.zip4j:zip4j:2.11.5'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
implementation 'org.lsposed.hiddenapibypass:hiddenapibypass:4.3'
// TODO : Update to latest version when available
// https://github.com/REAndroid/ARSCLib
implementation 'com.github.REAndroid:ARSCLib:95af206081'
implementation 'io.noties.markwon:core:4.6.2'
githubImplementation 'com.squareup.okhttp3:okhttp:4.12.0'
preImplementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'dev.spght:encryptedprefs-ktx:1.0.1'
// root
def libsuVersion = '6.0.0'
implementation "com.github.topjohnwu.libsu:core:${libsuVersion}"
implementation "com.github.topjohnwu.libsu:service:${libsuVersion}"
implementation "com.github.topjohnwu.libsu:nio:${libsuVersion}"
// Shizuku
def shizukuVersion = '13.1.5'
//noinspection GradleDependency
implementation "dev.rikka.shizuku:api:${shizukuVersion}"
//noinspection GradleDependency
implementation "dev.rikka.shizuku:provider:${shizukuVersion}"
// Refine
kapt "dev.rikka.tools.refine:annotation-processor:4.4.0"
//noinspection GradleDependency
compileOnly "dev.rikka.tools.refine:annotation:4.3.0"
// Hidden API
implementation "dev.rikka.hidden:compat:4.3.3"
// Room
implementation 'androidx.room:room-ktx:2.7.1'
//noinspection KaptUsageInsteadOfKsp
kapt 'androidx.room:room-compiler:2.7.1'
androidTestImplementation 'androidx.room:room-testing:2.7.1'
// debugImplementation because LeakCanary should only run in debug builds.
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.11'
}