Match less intents for receiving files

Be liberal when accepting SEND intents, but restrict to text files
for VIEW intents.
This commit is contained in:
Fredrik Fornwall
2016-04-16 23:01:19 +02:00
parent 9e70ebc2a6
commit 2a056aeb2e

View File

@@ -49,8 +49,8 @@
android:taskAffinity="com.termux.filereceiver"
android:excludeFromRecents="true"
android:noHistory="true">
<!-- Accept multiple file types when sending. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/*" />
@@ -61,6 +61,16 @@
<data android:mimeType="text/*" />
<data android:mimeType="video/*" />
</intent-filter>
<!-- Be more restrictive for viewing files, restricting ourselves to text files. -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
<data android:mimeType="application/json" />
<data android:mimeType="application/*xml*" />
<data android:mimeType="application/*latex*" />
<data android:mimeType="application/javascript" />
</intent-filter>
</activity>
<activity