Compare commits
1 commit
bdf39d741b
...
4462d569f2
Author | SHA1 | Date | |
---|---|---|---|
4462d569f2 |
1 changed files with 9 additions and 10 deletions
|
@ -82,18 +82,17 @@ private fun buildMagiskModule(target: Project) = buildZipFile {
|
|||
}
|
||||
}
|
||||
|
||||
private fun buildZipFile(builderAction: MutableMap<String, (ZipEntry) -> ByteArray>.() -> Unit): ByteArray {
|
||||
private fun buildZipFile(builderAction: MutableMap<String, ZipEntry.() -> ByteArray>.() -> Unit): ByteArray {
|
||||
val out = ByteArrayOutputStream()
|
||||
val zip = ZipOutputStream(out)
|
||||
ZipOutputStream(out).use {
|
||||
for ((name, invoke) in buildMap(builderAction)) {
|
||||
val entry = ZipEntry(name)
|
||||
entry.time = 0 // reproducible builds
|
||||
zip.putNextEntry(entry)
|
||||
zip.write(invoke(entry))
|
||||
zip.closeEntry()
|
||||
it.putNextEntry(entry)
|
||||
it.write(entry.invoke())
|
||||
it.closeEntry()
|
||||
}
|
||||
}
|
||||
zip.close()
|
||||
out.close()
|
||||
return out.toByteArray()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue