apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdkVersion.toInteger() defaultConfig { minSdkVersion androidMinSdkVersion.toInteger() targetSdkVersion androidTargetSdkVersion.toInteger() versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } ndkVersion androidCompileNdkVersion } dependencies { compileOnly project(':hiddenapi-stubs') api project(':xposed-bridge') compileOnly project(':dexmaker') compileOnly 'com.android.support:support-annotations:28.0.0' implementation project(':apk-parser:library') } preBuild.doLast { def imlFile = file(project.name + ".iml") try { def parsedXml = (new groovy.util.XmlParser()).parse(imlFile) def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' } parsedXml.component[1].remove(jdkNode) def sdkString = "Android API " + android.compileSdkVersion.substring("android-".length()) + " Platform" new groovy.util.Node(parsedXml.component[1], 'orderEntry', ['type': 'jdk', 'jdkName': sdkString, 'jdkType': 'Android SDK']) groovy.xml.XmlUtil.serialize(parsedXml, new FileOutputStream(imlFile)) } catch (FileNotFoundException e) { // nop, iml not found } } afterEvaluate { tasks.withType(JavaCompile) { options.compilerArgs.add("-Xbootclasspath/p:${hiddenApiStubJarFilePath}") } task("copyCommonProperties", type: Copy) { from file("${projectDir}/template_override/") into file(templateRootPath) } }