mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-21 18:49:42 +00:00
Only compress kernel and ramdisk if input not compressed
This commit is contained in:
@@ -14,14 +14,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
int64_t decompress(format_t type, int fd, const void *from, size_t size) {
|
||||
return unique_ptr<Compression>(get_decoder(type))->one_step(fd, from, size);
|
||||
}
|
||||
|
||||
int64_t compress(format_t type, int fd, const void *from, size_t size) {
|
||||
return unique_ptr<Compression>(get_encoder(type))->one_step(fd, from, size);
|
||||
}
|
||||
|
||||
static bool read_file(FILE *fp, const function<void (void *, size_t)> &fn) {
|
||||
char buf[4096];
|
||||
size_t len;
|
||||
@@ -164,13 +156,6 @@ Compression *get_decoder(format_t type) {
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Compression::one_step(int outfd, const void *in, size_t size) {
|
||||
set_out(make_unique<FDOutStream>(outfd));
|
||||
if (!write(in, size))
|
||||
return -1;
|
||||
return finalize();
|
||||
}
|
||||
|
||||
GZStream::GZStream(int mode) : mode(mode), strm({}) {
|
||||
switch(mode) {
|
||||
case 0:
|
||||
|
Reference in New Issue
Block a user