From bacb5fa462bcf01438963395b4b8643ff2ee1f11 Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Tue, 6 Oct 2020 01:31:13 +0800 Subject: [PATCH] Truncate existing file when openOutputStream --- .../java/com/topjohnwu/magisk/core/utils/MediaStoreUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/core/utils/MediaStoreUtils.kt b/app/src/main/java/com/topjohnwu/magisk/core/utils/MediaStoreUtils.kt index d564b7a09..d28f9b880 100644 --- a/app/src/main/java/com/topjohnwu/magisk/core/utils/MediaStoreUtils.kt +++ b/app/src/main/java/com/topjohnwu/magisk/core/utils/MediaStoreUtils.kt @@ -101,7 +101,7 @@ object MediaStoreUtils { fun Uri.inputStream() = cr.openInputStream(this) ?: throw FileNotFoundException() - fun Uri.outputStream() = cr.openOutputStream(this) ?: throw FileNotFoundException() + fun Uri.outputStream() = cr.openOutputStream(this, "rwt") ?: throw FileNotFoundException() val Uri.displayName: String get() { if (scheme == "file") {