custom theme: fix libziparchive loading of custom themes

Change-Id: Ia23a9dcd24fcbb61cb5e1df366a4325d20d777b2
This commit is contained in:
bigbiff
2021-10-22 21:19:28 +00:00
parent 850fa28798
commit 83298f5375
4 changed files with 11 additions and 15 deletions
+1 -2
View File
@@ -58,13 +58,12 @@ int Resource::ExtractResource(ZipArchiveHandle pZip, std::string folderName, std
std::string src = folderName + "/" + fileName + fileExtn;
ZipEntry binary_entry;
if (FindEntry(pZip, src, &binary_entry) != 0) {
if (FindEntry(pZip, src, &binary_entry) == 0) {
android::base::unique_fd fd(
open(destFile.c_str(), O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC, 0666));
if (fd == -1) {
return -1;
}
// if (!pZip->ExtractEntry(src, destFile, 0666))
int32_t err = ExtractEntryToFile(pZip, &binary_entry, fd);
if (err != 0)
return -1;