diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-07-16 17:04:23 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-07-22 15:30:08 +0300 |
commit | 69bcdd23b94dab9e0ef67bd480e7f875b06dc71d (patch) | |
tree | 54c88f2de0967ad8503440ce668d2156a649d5f1 /src/adb_comp.c | |
parent | 7af34db6cfed5792b8acd4a4fd4da56de8381673 (diff) | |
download | apk-tools-69bcdd23b94dab9e0ef67bd480e7f875b06dc71d.tar.gz apk-tools-69bcdd23b94dab9e0ef67bd480e7f875b06dc71d.tar.bz2 apk-tools-69bcdd23b94dab9e0ef67bd480e7f875b06dc71d.tar.xz apk-tools-69bcdd23b94dab9e0ef67bd480e7f875b06dc71d.zip |
adbsign: support compressed adb files
Diffstat (limited to 'src/adb_comp.c')
-rw-r--r-- | src/adb_comp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/adb_comp.c b/src/adb_comp.c index 8aed95d..d1f5bb2 100644 --- a/src/adb_comp.c +++ b/src/adb_comp.c @@ -11,7 +11,7 @@ struct apk_istream *adb_decompress(struct apk_istream *is, adb_comp_t *compression) { - adb_comp_t c = ADB_COMP_NONE; + adb_comp_t c = -1; if (IS_ERR_OR_NULL(is)) return is; @@ -22,9 +22,11 @@ struct apk_istream *adb_decompress(struct apk_istream *is, adb_comp_t *compressi break; case 'd': c = ADB_COMP_DEFLATE; + apk_istream_get(is, 4); is = apk_istream_deflate(is); break; - default: + } + if (c == -1) { apk_istream_close(is); return ERR_PTR(-APKE_ADB_COMPRESSION); } |