fix: loading local patch bundle

This commit is contained in:
Canny 2022-11-21 19:12:43 +03:00 committed by GitHub
parent 1a89dd30f4
commit 8fff5241c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
}
}
}