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();