From 8fff5241c2f14e584f0b1dd6bc6d828d9419e747 Mon Sep 17 00:00:00 2001 From: Canny <94744045+Canny1913@users.noreply.github.com> Date: Mon, 21 Nov 2022 19:12:43 +0300 Subject: [PATCH] fix: loading local patch bundle --- .../revanced/manager/ui/viewmodel/SourceSelectorViewModel.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/revanced/manager/ui/viewmodel/SourceSelectorViewModel.kt b/app/src/main/java/app/revanced/manager/ui/viewmodel/SourceSelectorViewModel.kt index 29a6e06..ea44ee7 100644 --- a/app/src/main/java/app/revanced/manager/ui/viewmodel/SourceSelectorViewModel.kt +++ b/app/src/main/java/app/revanced/manager/ui/viewmodel/SourceSelectorViewModel.kt @@ -14,7 +14,7 @@ import java.nio.file.StandardCopyOption class SourceSelectorViewModel(val app: Application, val patcherUtils: PatcherUtils) : ViewModel() { fun loadBundle(uri: Uri) { try { - val patchesFile = app.cacheDir.resolve(File(uri.path!!).name) + val patchesFile = app.cacheDir.resolve("patches.jar") Files.copy( app.contentResolver.openInputStream(uri), patchesFile.toPath(), @@ -29,4 +29,4 @@ class SourceSelectorViewModel(val app: Application, val patcherUtils: PatcherUti Sentry.captureException(e) } } -} \ No newline at end of file +}