Fix read file error in extract_apks

Bug: 301409551
Test: build
Change-Id: I353efea233e524c838298447b08743eeeedbb263
This commit is contained in:
Ray Chin 2023-09-21 20:32:06 +08:00
parent 53b33d07b1
commit 0523ee828a

View file

@ -76,8 +76,8 @@ func (apkSet *ApkSet) getToc() (Toc, error) {
if err != nil {
return nil, err
}
bytes := make([]byte, tocFile.FileHeader.UncompressedSize64)
if _, err := rc.Read(bytes); err != nil && err != io.EOF {
bytes, err := io.ReadAll(rc)
if err != nil {
return nil, err
}
rc.Close()