From 495e5dadd76d56d5fd94003794c14617a9583390 Mon Sep 17 00:00:00 2001 From: hank121314 Date: Thu, 6 Apr 2023 00:51:05 +0800 Subject: [PATCH] citra_android: fix config is getting overwritten by default (#6408) --- .../citra/citra_emu/features/settings/utils/SettingsFile.java | 2 +- .../src/main/java/org/citra/citra_emu/utils/DocumentsTree.java | 2 +- .../app/src/main/java/org/citra/citra_emu/utils/FileUtil.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/utils/SettingsFile.java b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/utils/SettingsFile.java index 908d7eae7..ab815d441 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/features/settings/utils/SettingsFile.java +++ b/src/android/app/src/main/java/org/citra/citra_emu/features/settings/utils/SettingsFile.java @@ -233,7 +233,7 @@ public final class SettingsFile { writeSection(writer, section); } inputStream.close(); - OutputStream outputStream = context.getContentResolver().openOutputStream(ini.getUri()); + OutputStream outputStream = context.getContentResolver().openOutputStream(ini.getUri(), "wt"); writer.store(outputStream); outputStream.flush(); outputStream.close(); diff --git a/src/android/app/src/main/java/org/citra/citra_emu/utils/DocumentsTree.java b/src/android/app/src/main/java/org/citra/citra_emu/utils/DocumentsTree.java index 22e4baf60..99d85aa44 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/utils/DocumentsTree.java +++ b/src/android/app/src/main/java/org/citra/citra_emu/utils/DocumentsTree.java @@ -144,7 +144,7 @@ public class DocumentsTree { document.isDirectory = destination.isDirectory(); document.loaded = true; InputStream input = context.getContentResolver().openInputStream(sourceNode.uri); - OutputStream output = context.getContentResolver().openOutputStream(destination.getUri()); + OutputStream output = context.getContentResolver().openOutputStream(destination.getUri(), "wt"); byte[] buffer = new byte[1024]; int len; while ((len = input.read(buffer)) != -1) { diff --git a/src/android/app/src/main/java/org/citra/citra_emu/utils/FileUtil.java b/src/android/app/src/main/java/org/citra/citra_emu/utils/FileUtil.java index b99a35bc0..7de6f118f 100644 --- a/src/android/app/src/main/java/org/citra/citra_emu/utils/FileUtil.java +++ b/src/android/app/src/main/java/org/citra/citra_emu/utils/FileUtil.java @@ -273,7 +273,7 @@ public class FileUtil { } if (destination == null) return false; InputStream input = context.getContentResolver().openInputStream(sourceUri); - OutputStream output = context.getContentResolver().openOutputStream(destination.getUri()); + OutputStream output = context.getContentResolver().openOutputStream(destination.getUri(), "wt"); byte[] buffer = new byte[1024]; int len; while ((len = input.read(buffer)) != -1) {