SnapEnhance/app/build.gradle
2023-06-01 22:48:06 +02:00

105 lines
2.8 KiB
Groovy

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
def appVersionName = "0.1.1"
def appVersionCode = 3
android {
compileSdk 33
buildToolsVersion = "33.0.2"
defaultConfig {
applicationId "me.rhunk.snapenhance"
minSdk 28
targetSdk 33
versionCode appVersionCode
versionName appVersionName
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "app-${appVersionName}-${variant.flavorName}.apk"
}
}
flavorDimensions "release"
productFlavors {
armv8 {
getIsDefault().set(true)
ndk {
abiFilters "arm64-v8a"
}
dimension "release"
}
armv7 {
ndk {
abiFilters "armeabi-v7a"
}
dimension "release"
}
}
kotlinOptions {
jvmTarget = '1.8'
}
namespace 'me.rhunk.snapenhance'
}
afterEvaluate {
//auto install for debug purpose
getTasks().getByPath(":app:assembleArmv8Debug").doLast {
def apkDebugFile = android.applicationVariants.find { it.buildType.name == "debug" && it.flavorName == "armv8" }.outputs[0].outputFile
try {
println "Killing Snapchat"
exec {
commandLine "adb", "shell", "am", "force-stop", "com.snapchat.android"
}
println "Installing debug build"
exec() {
commandLine "adb", "install", "-r", "-d", apkDebugFile.absolutePath
}
println "Starting Snapchat"
exec {
commandLine "adb", "shell", "am", "start", "com.snapchat.android"
}
} catch (Throwable t) {
println "Failed to install debug build"
t.printStackTrace()
}
}
}
task getVersion {
doLast {
def version = new File('app/build/version.txt')
version.text = android.defaultConfig.versionName
}
}
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.8.21'
compileOnly files('libs/LSPosed-api-1.0-SNAPSHOT.jar')
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.arthenica:ffmpeg-kit-full-gpl:5.1.LTS'
implementation 'org.osmdroid:osmdroid-android:6.1.16'
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11'
}