89 lines
3.0 KiB
Groovy
89 lines
3.0 KiB
Groovy
apply plugin: 'com.android.application'
|
|
|
|
android {
|
|
compileSdkVersion rootProject.ext.androidCompileSdkVersion
|
|
defaultConfig {
|
|
applicationId "org.lsposed.lspatch"
|
|
minSdkVersion rootProject.ext.androidMinSdkVersion
|
|
targetSdkVersion rootProject.ext.androidTargetSdkVersion
|
|
versionCode rootProject.ext.verCode
|
|
versionName rootProject.ext.verName
|
|
|
|
multiDexEnabled false
|
|
|
|
signingConfigs {
|
|
config {
|
|
if (project.hasProperty('androidStoreFile') && !androidStoreFile.isEmpty()) {
|
|
storeFile = file(androidStoreFile)
|
|
storePassword = androidStorePassword
|
|
keyAlias = androidKeyAlias
|
|
keyPassword = androidKeyPassword
|
|
}
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_11
|
|
targetCompatibility JavaVersion.VERSION_11
|
|
}
|
|
|
|
}
|
|
buildTypes {
|
|
debug {
|
|
debuggable true
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
signingConfig = signingConfigs.config.storeFile == null ? signingConfigs.debug : signingConfigs.config
|
|
}
|
|
release {
|
|
debuggable false
|
|
minifyEnabled false
|
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
|
signingConfig = signingConfigs.config.storeFile == null ? signingConfigs.debug : signingConfigs.config
|
|
}
|
|
}
|
|
lintOptions {
|
|
abortOnError false
|
|
}
|
|
applicationVariants.all { variant ->
|
|
def buildType = variant.name.capitalize()
|
|
def variantLowered = variant.name.toLowerCase()
|
|
|
|
variant.outputs.all {
|
|
outputFileName = "${variant.getFlavorName()}-${variant.versionName}.apk"
|
|
}
|
|
|
|
task "copyDex$buildType"(type: Copy) {
|
|
dependsOn("assemble$buildType")
|
|
def dexFilePath = "$buildDir/intermediates/dex/${variantLowered}/mergeDex${buildType}/classes.dex"
|
|
from dexFilePath
|
|
rename "classes.dex", "lsp.dex"
|
|
into "$rootProject.projectDir/out/dexes"
|
|
}
|
|
|
|
task "copySo$buildType"(type: Copy) {
|
|
dependsOn("assemble$buildType")
|
|
from "$buildDir/intermediates/merged_native_libs/${variantLowered}/out/lib"
|
|
into "$rootProject.projectDir/out/so"
|
|
}
|
|
|
|
task "copy$buildType"() {
|
|
dependsOn("copySo$buildType")
|
|
dependsOn("copyDex$buildType")
|
|
|
|
doLast {
|
|
System.out.println("Dex and so files has been copy to ${rootProject.projectDir}${File.separator}out")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
implementation project(path: ':lspcore')
|
|
implementation project(path: ':hiddenapi-bridge')
|
|
compileOnly project(":hiddenapi-stubs")
|
|
implementation project(':share')
|
|
implementation project(':imanager')
|
|
}
|