You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
strip by ourselves
This commit is contained in:
@@ -34,7 +34,7 @@ androidComponents.onVariants { variant ->
|
|||||||
group = "module"
|
group = "module"
|
||||||
dependsOn(
|
dependsOn(
|
||||||
":loader:assemble$variantCapped",
|
":loader:assemble$variantCapped",
|
||||||
":zygiskd:cargoBuild",
|
":zygiskd:buildAndStrip",
|
||||||
)
|
)
|
||||||
into(moduleDir)
|
into(moduleDir)
|
||||||
from("${rootProject.projectDir}/README.md")
|
from("${rootProject.projectDir}/README.md")
|
||||||
@@ -65,6 +65,7 @@ androidComponents.onVariants { variant ->
|
|||||||
}
|
}
|
||||||
into("bin") {
|
into("bin") {
|
||||||
from(project(":zygiskd").buildDir.path + "/rustJniLibs/android")
|
from(project(":zygiskd").buildDir.path + "/rustJniLibs/android")
|
||||||
|
include("**/zygiskd")
|
||||||
}
|
}
|
||||||
into("lib") {
|
into("lib") {
|
||||||
from("${project(":loader").buildDir}/intermediates/stripped_native_libs/$variantLowered/out/lib")
|
from("${project(":loader").buildDir}/intermediates/stripped_native_libs/$variantLowered/out/lib")
|
||||||
|
|||||||
@@ -24,13 +24,11 @@ rustix = { version = "0.38", features = [ "fs", "process", "mount", "net", "thre
|
|||||||
tokio = { version = "1.28", features = ["full"] }
|
tokio = { version = "1.28", features = ["full"] }
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
# strip = true
|
strip = false
|
||||||
# split-debuginfo = "packed"
|
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
strip = true
|
strip = false
|
||||||
split-debuginfo = "packed"
|
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
opt-level = "z"
|
opt-level = "z"
|
||||||
lto = true
|
lto = true
|
||||||
|
|||||||
@@ -27,3 +27,33 @@ cargo {
|
|||||||
spec.environment("MIN_MAGISK_VERSION", minMagiskVersion)
|
spec.environment("MIN_MAGISK_VERSION", minMagiskVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
task<Task>("buildAndStrip") {
|
||||||
|
dependsOn(":zygiskd:cargoBuild")
|
||||||
|
doLast {
|
||||||
|
val dir = File(buildDir, "rustJniLibs/android")
|
||||||
|
val prebuilt = File(android.ndkDirectory, "toolchains/llvm/prebuilt").listFiles()!!.first()
|
||||||
|
val binDir = File(prebuilt, "bin")
|
||||||
|
println("binDir $binDir")
|
||||||
|
val suffix = if (prebuilt.name.contains("windows")) ".exe" else ""
|
||||||
|
val strip = File(binDir, "llvm-strip$suffix")
|
||||||
|
val objcopy = File(binDir, "llvm-objcopy$suffix")
|
||||||
|
dir.listFiles()!!.forEach {
|
||||||
|
if (!it.isDirectory) return@forEach
|
||||||
|
exec {
|
||||||
|
workingDir = it
|
||||||
|
commandLine(objcopy, "--only-keep-debug", "zygiskd", "zygiskd.debug")
|
||||||
|
}
|
||||||
|
exec {
|
||||||
|
workingDir = it
|
||||||
|
commandLine(strip, "--strip-all", "zygiskd")
|
||||||
|
}
|
||||||
|
exec {
|
||||||
|
workingDir = it
|
||||||
|
commandLine(objcopy, "--add-gnu-debuglink", "zygiskd.debug", "zygiskd")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user