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 } } } } 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 "(.*).dex", "lsploader.dex" into "$rootProject.projectDir/out/list-assets" } task "copySo$buildType"(type: Copy) { dependsOn("assemble$buildType") from "$buildDir/intermediates/merged_native_libs/${variantLowered}/out/lib" into "$rootProject.projectDir/out/list-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') compileOnly project(":hiddenapi-stubs") implementation project(':share') }