From 44480300d941e888313eb9e5bc986c9e18d563a4 Mon Sep 17 00:00:00 2001 From: Norman Breau Date: Fri, 25 Oct 2024 13:09:03 -0300 Subject: [PATCH] fix(android): Isolate provider access to a subdirectory (#901) --- src/android/CameraLauncher.java | 5 ++++- src/android/xml/camera_provider_paths.xml | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/android/CameraLauncher.java b/src/android/CameraLauncher.java index 5b2a9a9..6dfe3cb 100644 --- a/src/android/CameraLauncher.java +++ b/src/android/CameraLauncher.java @@ -367,7 +367,10 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect throw new IllegalArgumentException("Invalid Encoding Type: " + encodingType); } - return new File(getTempDirectoryPath(), fileName); + File cacheDir = new File(getTempDirectoryPath(), "org.apache.cordova.camera"); + cacheDir.mkdir(); + + return new File(cacheDir, fileName); } diff --git a/src/android/xml/camera_provider_paths.xml b/src/android/xml/camera_provider_paths.xml index 3266748..7c3584c 100644 --- a/src/android/xml/camera_provider_paths.xml +++ b/src/android/xml/camera_provider_paths.xml @@ -17,5 +17,5 @@ --> - - \ No newline at end of file + +