Skip to content

Commit

Permalink
Fix SandHook build
Browse files Browse the repository at this point in the history
  • Loading branch information
kotori2 committed Dec 11, 2020
1 parent b13c9ba commit 9c0a5d6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ allprojects {
templateLib64Path = templateRootPath + "/system/lib64/"
templateEtcPath = templateRootPath + "/system/etc/"
hiddenApiStubJarFilePath = project(":hiddenapi-stubs").buildDir.absolutePath + "/libs/framework-stub.jar"
zipPathMagiskReleasePath = project(":edxp-core").projectDir.path + "/build/tmp/release/magisk"
zipPathMagiskReleasePath = project(":edxp-core").projectDir.path + "/build/tmp/release/magisk/"
}
repositories {
google()
Expand Down
2 changes: 0 additions & 2 deletions edxp-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,9 @@ afterEvaluate {
def authorList = property("${backendLowered}" + "_authors")
def magiskModuleId = property("${backendLowered}" + "_module_id")

project.logger.lifecycle("delete file")
delete file(zipPathMagiskReleasePath)

def prepareJarsTask = task("prepareJars${backendCapped}${variantCapped}") {
project.logger.lifecycle("prepareJarsTask")
dependsOn cleanTemplate
dependsOn tasks.getByPath(":dexmaker:copyDex${variantCapped}")
dependsOn tasks.getByPath(":dalvikdx:copyDex${variantCapped}")
Expand Down
16 changes: 9 additions & 7 deletions edxp-sandhook/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,21 @@ afterEvaluate {
def variantNameLowered = variant.name.toLowerCase()
def myTemplatePath = "${projectDir}/template_override/"

task("copyDex${variantNameCapped}", type: Copy) {
task "copyDex${variantNameCapped}" {
dependsOn "assemble${variantNameCapped}"
dependsOn tasks.getByPath(":edxp-common:copyCommonProperties")
dependsOn tasks.getByPath(":sandhook-hooklib:copySandHook${variantNameCapped}LibraryToMagiskTemplate")
def dexOutPath = variant.name.contains("release") ?
"${buildDir}/intermediates/dex/${variantNameLowered}/minify${variantNameCapped}WithR8" :
"${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}"
from (dexOutPath){
rename("classes.dex", "edxp.dex")
}
destinationDir file(zipPathMagiskReleasePath + "/system/framework/")
outputs.upToDateWhen { false }
doLast {
doLast {
project.logger.lifecycle("copyDex${variantNameCapped}")
copy {
from(dexOutPath) {
rename "classes.dex", "edxp.dex"
}
into myTemplatePath + "system/framework/"
}
copy {
from file(myTemplatePath)
into file(zipPathMagiskReleasePath)
Expand Down
16 changes: 11 additions & 5 deletions edxp-yahfa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ afterEvaluate {
def variantNameCapped = variant.name.capitalize()
def variantNameLowered = variant.name.toLowerCase()

task("copyDex${variantNameCapped}", type: Copy) {
task "copyDex${variantNameCapped}" {
dependsOn "assemble${variantNameCapped}"
dependsOn tasks.getByPath(":edxp-common:copyCommonProperties")
def dexOutPath = variant.name.contains("release") ?
"${buildDir}/intermediates/dex/${variantNameLowered}/minify${variantNameCapped}WithR8" :
"${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}"
from (dexOutPath){
rename("classes.dex", "edxp.dex")
}
destinationDir file(templateRootPath + "system/framework/")

outputs.upToDateWhen { false }
doLast {
project.logger.lifecycle("copyDex${variantNameCapped}")
copy {
from (dexOutPath){
rename("classes.dex", "edxp.dex")
}
into file(zipPathMagiskReleasePath + "/system/framework/")
}
}
}

}
Expand Down

0 comments on commit 9c0a5d6

Please sign in to comment.