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:
@@ -27,3 +27,33 @@ cargo {
|
||||
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