From aaa086705baa36568ee5c76e4e9697f00e330280 Mon Sep 17 00:00:00 2001 From: Magical Yang Date: Mon, 4 Dec 2023 11:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E6=A0=B9=E6=8D=AEDownload=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E4=B8=8B=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8useMedia(?= =?UTF-8?q?=E7=9B=AE=E5=BD=95/=E6=96=87=E4=BB=B6)=E6=9D=A5=E5=86=B3?= =?UTF-8?q?=E5=AE=9A=E6=98=AF=E5=90=A6=E4=BD=BF=E7=94=A8Media=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xposed/quickenergy/util/FileUtils.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/pansong291/xposed/quickenergy/util/FileUtils.java b/app/src/main/java/pansong291/xposed/quickenergy/util/FileUtils.java index 824caed10..b38ecabf1 100644 --- a/app/src/main/java/pansong291/xposed/quickenergy/util/FileUtils.java +++ b/app/src/main/java/pansong291/xposed/quickenergy/util/FileUtils.java @@ -50,13 +50,17 @@ private static void copyFile(File srcDir, File dstDir, String filename) { @SuppressWarnings("deprecation") public static File getMainDirectoryFile() { if (mainDirectory == null) { - String storageDirStr = - Environment.getExternalStorageDirectory() + File.separator + "Android" + File.separator + "media" + - File.separator + ClassMember.PACKAGE_NAME; - File storageDir = new File(storageDirStr); + File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); if (!storageDir.exists()) { storageDir.mkdirs(); } + File useMedia = new File(storageDir, "useMedia"); + if (useMedia.exists()) { + String storageDirStr = Environment.getExternalStorageDirectory() + File.separator + "Android" + + File.separator + "media" + File.separator + ClassMember.PACKAGE_NAME; + storageDir = new File(storageDirStr); + } + mainDirectory = new File(storageDir, "xqe"); if (!mainDirectory.exists()) { mainDirectory.mkdirs();