From 15a7e9af57f1c6cb3efca173f1c3326c97a8580c Mon Sep 17 00:00:00 2001 From: canyie Date: Fri, 20 Jan 2023 13:59:06 +0800 Subject: [PATCH] Fix ResourcesProvider being closed --- .../src/main/java/com/topjohnwu/magisk/DownloadActivity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java b/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java index 6fb1e5fa0..da6276baf 100644 --- a/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java +++ b/stub/src/main/java/com/topjohnwu/magisk/DownloadActivity.java @@ -178,9 +178,8 @@ public class DownloadActivity extends Activity { decryptResources(new FileOutputStream(fd)); Os.lseek(fd, 0, OsConstants.SEEK_SET); var loader = new ResourcesLoader(); - try (var pfd = ParcelFileDescriptor.dup(fd); - var provider = ResourcesProvider.loadFromTable(pfd, null)) { - loader.addProvider(provider); + try (var pfd = ParcelFileDescriptor.dup(fd)) { + loader.addProvider(ResourcesProvider.loadFromTable(pfd, null)); getResources().addLoaders(loader); } } finally {