From 1f5d8b0e90624f925817d7737e722b910422028e Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Fri, 3 Jul 2026 16:35:36 -0400 Subject: [PATCH 1/3] fix(android): explicitly grant URI permissions for legacy camera capture Android 18 removes automatic URI permission grants for ACTION_IMAGE_CAPTURE intents. The deprecated LegacyCameraFlow.openCamera() sent no grant flags at all for its FileProvider output URI, unlike the edit intents elsewhere in this file which already do. RMET-5241 --- .../java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java | 1 + 1 file changed, 1 insertion(+) diff --git a/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java b/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java index 95abb35..038a3bf 100644 --- a/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java +++ b/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java @@ -270,6 +270,7 @@ public void openCamera(final PluginCall call) { // TODO: Verify provider config exists imageFileUri = FileProvider.getUriForFile(activity, appId + ".fileprovider", photoFile); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageFileUri); + takePictureIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); } catch (Exception ex) { call.reject(IMAGE_FILE_SAVE_ERROR, ex); return; From 9f7600ccbbcf6beb2c3ff9e02ee7f548bd2e16f3 Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Tue, 7 Jul 2026 10:31:41 -0400 Subject: [PATCH 2/3] fix(camera): bump ioncamera-android to 1.0.2 for Android 18 URI grant fix RMET-5241 --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 35171c5..aabfe54 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -75,7 +75,7 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'io.ionic.libs:ioncamera-android:1.0.1' + implementation 'io.ionic.libs:ioncamera-android:1.0.2' if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") { implementation "com.capacitorjs:core:$capacitorVersion" From 06773881e59dd5f22fdb26a2c8af6c16fc9f3256 Mon Sep 17 00:00:00 2001 From: Alexandre Jacinto Date: Wed, 8 Jul 2026 10:06:10 -0400 Subject: [PATCH 3/3] chore(android): fix linting --- .../java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java b/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java index 038a3bf..7922106 100644 --- a/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java +++ b/android/src/main/java/com/capacitorjs/plugins/camera/LegacyCameraFlow.java @@ -544,7 +544,7 @@ private void writePhoto(File outFile, InputStream is) throws IOException { private File getTempFile(Uri uri) { String filename = Uri.parse(Uri.decode(uri.toString())).getLastPathSegment(); if (!filename.contains(".jpg") && !filename.contains(".jpeg")) { - filename += "." + (new java.util.Date()).getTime() + ".jpeg"; + filename += "." + new java.util.Date().getTime() + ".jpeg"; } File cacheDir = context.getCacheDir(); return new File(cacheDir, filename);