diff --git a/cropper/src/main/AndroidManifest.xml b/cropper/src/main/AndroidManifest.xml index 674ba03a..17ffc46b 100644 --- a/cropper/src/main/AndroidManifest.xml +++ b/cropper/src/main/AndroidManifest.xml @@ -1,4 +1,14 @@ - - + + + + + + diff --git a/cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImage.java b/cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImage.java index ba8b807b..0041da7f 100644 --- a/cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImage.java +++ b/cropper/src/main/java/com/theartofdev/edmodo/cropper/CropImage.java @@ -44,6 +44,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.RequiresApi; +import androidx.core.content.FileProvider; import androidx.fragment.app.Fragment; /** @@ -343,7 +344,8 @@ public static Uri getCaptureImageOutputUri(@NonNull Context context) { Uri outputFileUri = null; File getImage = context.getExternalCacheDir(); if (getImage != null) { - outputFileUri = Uri.fromFile(new File(getImage.getPath(), "pickImageResult.jpeg")); + File pickImageFile = new File(getImage.getPath(), "pickImageResult.jpeg"); + outputFileUri = FileProvider.getUriForFile(context, context.getPackageName() + ".fileprovider", pickImageFile); } return outputFileUri; } diff --git a/cropper/src/main/java/com/theartofdev/edmodo/cropper/ImageCropperFileProvider.java b/cropper/src/main/java/com/theartofdev/edmodo/cropper/ImageCropperFileProvider.java new file mode 100644 index 00000000..4a739e05 --- /dev/null +++ b/cropper/src/main/java/com/theartofdev/edmodo/cropper/ImageCropperFileProvider.java @@ -0,0 +1,10 @@ +package com.theartofdev.edmodo.cropper; + +import androidx.core.content.FileProvider; + +/** + * Dummy file provider + */ +public class ImageCropperFileProvider extends FileProvider +{ +} diff --git a/cropper/src/main/res/xml/provider_paths.xml b/cropper/src/main/res/xml/provider_paths.xml new file mode 100644 index 00000000..9b94741c --- /dev/null +++ b/cropper/src/main/res/xml/provider_paths.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file