282 lines
8.9 KiB
Groovy
282 lines
8.9 KiB
Groovy
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
|
|
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 = 36
|
|
|
|
buildFeatures {
|
|
viewBinding = false
|
|
aidl = true
|
|
buildConfig = true
|
|
compose = false
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId "app.simple.inure"
|
|
minSdkVersion 23
|
|
targetSdkVersion 35
|
|
versionCode 10642
|
|
versionName "build106.4.2"
|
|
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
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget = JvmTarget.JVM_17
|
|
// freeCompilerArgs.add("-XXLanguage:+PropertyParamAnnotationDefaultTargetMode")
|
|
}
|
|
}
|
|
|
|
ndkVersion = '29.0.13599879 rc2'
|
|
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:8.13.1'
|
|
|
|
// 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.3.0'
|
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
|
|
|
|
// Kotlin
|
|
runtimeOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'
|
|
|
|
// AndroidX
|
|
implementation 'androidx.core:core-ktx:1.17.0'
|
|
implementation 'androidx.appcompat:appcompat:1.7.1'
|
|
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.9'
|
|
implementation 'androidx.activity:activity-ktx:1.11.0'
|
|
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.4'
|
|
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.9.4'
|
|
implementation 'androidx.recyclerview:recyclerview:1.4.0'
|
|
implementation 'androidx.webkit:webkit:1.14.0'
|
|
implementation 'androidx.documentfile:documentfile:1.1.0'
|
|
implementation 'androidx.media:media:1.7.1'
|
|
implementation 'androidx.viewpager2:viewpager2:1.1.0'
|
|
implementation 'androidx.dynamicanimation:dynamicanimation-ktx:1.1.0'
|
|
implementation 'androidx.transition:transition-ktx:1.6.0'
|
|
|
|
// Google
|
|
implementation 'com.google.android.material:material:1.13.0'
|
|
implementation 'com.google.code.gson:gson:2.13.2'
|
|
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:5.0.5'
|
|
implementation 'com.github.bumptech.glide:okhttp3-integration:5.0.5'
|
|
//noinspection KaptUsageInsteadOfKsp
|
|
ksp 'com.github.bumptech.glide:ksp:5.0.5'
|
|
|
|
// Toolkit
|
|
implementation 'com.github.Hamza417:renderscript-intrinsics-replacement-toolkit:4ae2409809'
|
|
|
|
// Third Party
|
|
implementation 'net.dongliu:apk-parser:2.6.10'
|
|
implementation 'com.caverock:androidsvg-aar:1.4'
|
|
implementation 'com.anggrayudi:storage:2.2.0'
|
|
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:6.1'
|
|
implementation 'io.github.reandroid:ARSCLib:1.3.8' // https://github.com/REAndroid/ARSCLib
|
|
implementation 'io.noties.markwon:core:4.6.2'
|
|
|
|
githubImplementation 'com.squareup.okhttp3:okhttp:5.3.1'
|
|
|
|
implementation 'dev.spght:encryptedprefs-ktx:1.1.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'
|
|
implementation "dev.rikka.shizuku:api:${shizukuVersion}"
|
|
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.4.0"
|
|
|
|
// Hidden API
|
|
implementation "dev.rikka.hidden:compat:4.4.0"
|
|
|
|
// Room
|
|
implementation 'androidx.room:room-ktx:2.8.3'
|
|
//noinspection KaptUsageInsteadOfKsp
|
|
kapt 'androidx.room:room-compiler:2.8.3'
|
|
androidTestImplementation 'androidx.room:room-testing:2.8.3'
|
|
|
|
// debugImplementation because LeakCanary should only run in debug builds.
|
|
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.11'
|
|
}
|