@capawesome/capacitor-live-update 8.2.0 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,6 +69,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
69
69
  import java.util.concurrent.atomic.AtomicLong;
70
70
  import java.util.concurrent.atomic.AtomicReference;
71
71
  import net.lingala.zip4j.ZipFile;
72
+ import net.lingala.zip4j.model.FileHeader;
72
73
  import okhttp3.Call;
73
74
  import okhttp3.HttpUrl;
74
75
  import okhttp3.Response;
@@ -1432,7 +1433,13 @@ public class LiveUpdate {
1432
1433
  private File unzipFile(@NonNull File zipFile) throws IOException {
1433
1434
  File destination = buildTemporaryDirectory();
1434
1435
  String destinationPath = destination.getPath();
1435
- new ZipFile(zipFile).extractAll(destinationPath);
1436
+ ZipFile zip = new ZipFile(zipFile);
1437
+ // Clear stored Unix permissions to prevent EACCES errors on newer Android versions
1438
+ // where restrictive directory permissions from the zip block file creation.
1439
+ for (FileHeader fileHeader : zip.getFileHeaders()) {
1440
+ fileHeader.setExternalFileAttributes(null);
1441
+ }
1442
+ zip.extractAll(destinationPath);
1436
1443
  return destination;
1437
1444
  }
1438
1445
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/capacitor-live-update",
3
- "version": "8.2.0",
3
+ "version": "8.2.1",
4
4
  "description": "Capacitor plugin to update your app remotely in real-time.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",