Skip to content

Commit

Permalink
Removed file provider workaround to fix security issue
Browse files Browse the repository at this point in the history
Refs #644
  • Loading branch information
M66B committed Jan 7, 2025
1 parent 7813906 commit 1ea2a05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
14 changes: 2 additions & 12 deletions cropper/src/main/kotlin/com/canhub/cropper/BitmapUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -457,18 +457,8 @@ internal object BitmapUtils {
}
// We have this because of a HUAWEI path bug when we use getUriForFile
if (SDK_INT >= 29) {
try {
val file = File.createTempFile(
"cropped",
ext,
context.getExternalFilesDir(Environment.DIRECTORY_PICTURES),
)
getUriForFile(context, file)
} catch (e: Exception) {
Log.e("AIC", "${e.message}")
val file = File.createTempFile("cropped", ext, context.cacheDir)
getUriForFile(context, file)
}
val file = File.createTempFile("cropped", ext, context.cacheDir)
getUriForFile(context, file)
} else {
Uri.fromFile(File.createTempFile("cropped", ext, context.cacheDir))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.core.content.FileProvider
*
* See https://developer.android.com/guide/topics/manifest/provider-element.html for details.
*/
class CropFileProvider : FileProvider() {
// This class intentionally left blank.
class CropFileProvider() : FileProvider(R.xml.library_file_paths) {
// This class intentionally left blank.
// https://android-review.googlesource.com/c/platform/frameworks/support/+/1978527
}

0 comments on commit 1ea2a05

Please sign in to comment.