Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

fix(mobile): accept mislabeled shared images

tianma-if8018ffa78dbb
diff --git a/bun.lock b/bun.lock
index 9163a76b..8384fdfc 100644
--- a/bun.lock
+++ b/bun.lock
@@ -236,6 +236,7 @@
},
},
"patchedDependencies": {
},
"packages": {
diff --git a/package.json b/package.json
index 44cfc5ee..ada59728 100644
--- a/package.json
+++ b/package.json
@@ -188,6 +188,7 @@
"wrangler": "^4.112.0"
},
"patchedDependencies": {
}
}
diff --git a/patches/[email protected] b/patches/[email protected]
new file mode 100644
index 00000000..301f3405
--- /dev/null
+++ b/patches/[email protected]
@@ -0,0 +1,42 @@
+diff --git a/android/src/main/java/expo/modules/sharing/dataParsers/SimpleShareIntentDataParser.kt b/android/src/main/java/expo/modules/sharing/dataParsers/SimpleShareIntentDataParser.kt
+index 8dd50e8f..396ebf35 100644
+--- a/android/src/main/java/expo/modules/sharing/dataParsers/SimpleShareIntentDataParser.kt
++++ b/android/src/main/java/expo/modules/sharing/dataParsers/SimpleShareIntentDataParser.kt
+@@ -20 +20,4 @@ internal class SimpleShareIntentDataParser {
+- return if (type == "text/plain") {
++ val uri = intent.getParcelableExtraCompat<Uri>(Intent.EXTRA_STREAM)
++ return if (uri != null) {
++ listOf(createUriPayload(context, uri, type))
++ } else if (type == "text/plain") {
+@@ -31,4 +34 @@ internal class SimpleShareIntentDataParser {
+- } else {
+- val uri = intent.getParcelableExtraCompat<Uri>(Intent.EXTRA_STREAM)
+- listOfNotNull(uri?.let { createUriPayload(context, it, type) })
+- }
++ } else emptyList()
+@@ -43 +43,3 @@ internal class SimpleShareIntentDataParser {
+- val specificType = context.contentResolver.getType(uri) ?: defaultType
++ val specificType = context.contentResolver.getType(uri)
++ ?: defaultType.takeUnless { it == "text/plain" }
++ ?: "image/*"
+diff --git a/android/src/main/java/expo/modules/sharing/dataParsers/ResolvingShareIntentDataParser.kt b/android/src/main/java/expo/modules/sharing/dataParsers/ResolvingShareIntentDataParser.kt
+index 5f4d9423..8555d93a 100644
+--- a/android/src/main/java/expo/modules/sharing/dataParsers/ResolvingShareIntentDataParser.kt
++++ b/android/src/main/java/expo/modules/sharing/dataParsers/ResolvingShareIntentDataParser.kt
+@@ -28 +28,4 @@ class ResolvingShareIntentDataParser {
+- return if (type == "text/plain") {
++ val uri = intent.getParcelableExtraCompat<Uri>(Intent.EXTRA_STREAM)
++ return if (uri != null) {
++ listOf(resolveUri(context, uri, type))
++ } else if (type == "text/plain") {
+@@ -30,4 +33 @@ class ResolvingShareIntentDataParser {
+- } else {
+- val uri = intent.getParcelableExtraCompat<Uri>(Intent.EXTRA_STREAM)
+- listOfNotNull(uri?.let { resolveUri(context, it, type) })
+- }
++ } else emptyList()
+@@ -61 +61,3 @@ class ResolvingShareIntentDataParser {
+- val specificMimeType = contentResolver.getType(uri) ?: mimeType
++ val specificMimeType = contentResolver.getType(uri)
++ ?: mimeType.takeUnless { it == "text/plain" }
++ ?: "image/*"