Skip to content

Commit

Permalink
Fix bug in android 10 not permitted download in root external dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Dev4Mod committed May 3, 2024
1 parent 6de6b28 commit ee56a75
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void onCreatePreferences(@Nullable Bundle savedInstanceState, @Nullable S
mContract.launch(null);
return true;
});
localPref.setSummary(mPrefs.getString("localdownload", Environment.getExternalStorageDirectory().getPath()));
localPref.setSummary(mPrefs.getString("localdownload", Environment.getExternalStorageDirectory().getPath()+"/Download"));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private static String getPathDestination(SharedPreferences sharedPreferences, @N

@NonNull
private static String getStatusFolderPath(SharedPreferences sharedPreferences, boolean isVideo, boolean isImage, boolean isAudio) {
String folderPath = sharedPreferences.getString("localdownload", Environment.getExternalStorageDirectory().getAbsolutePath());
String folderPath = sharedPreferences.getString("localdownload", Environment.getExternalStorageDirectory().getAbsolutePath()+"/Download");
if (isVideo) {
folderPath += "/WhatsApp/Wa Enhancer/Status Videos/";
} else if (isImage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public String getPluginName() {
}

public static String getDestination(SharedPreferences prefs, File file) {
var folderPath = prefs.getString("localdownload", Environment.getExternalStorageDirectory().getAbsolutePath()) + "/WhatsApp/Wa Enhancer/View Once/";
var folderPath = prefs.getString("localdownload", Environment.getExternalStorageDirectory().getAbsolutePath()+"/Download") + "/WhatsApp/Wa Enhancer/View Once/";
var filePath = new File(folderPath);
if (!filePath.exists()) filePath.mkdirs();
return filePath.getAbsolutePath() + "/" + file.getName();
Expand Down

0 comments on commit ee56a75

Please sign in to comment.