Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit MIME type declaration on querying available packages for opening files #3020

Open
wants to merge 3 commits into
base: release/3.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<data android:mimeType="*/*" />
</intent>
</queries>

<uses-feature
android:name="android.hardware.touchscreen"
Expand All @@ -60,7 +66,8 @@
android:launchMode="singleInstance"
android:name=".ui.activities.MainActivity"
android:theme="@style/appCompatBlack"
android:configChanges="uiMode" >
android:configChanges="uiMode"
android:exported="true">

<intent-filter android:label="@string/appbar_name">
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -127,7 +134,8 @@
android:configChanges="orientation|screenSize|uiMode"
android:label="@string/setting"
android:name=".ui.activities.PreferencesActivity"
android:theme="@style/appCompatBlack">
android:theme="@style/appCompatBlack"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
Expand All @@ -138,7 +146,8 @@
android:label="@string/textreader"
android:name=".ui.activities.texteditor.TextEditorActivity"
android:configChanges="uiMode"
android:theme="@style/appCompatBlack">
android:theme="@style/appCompatBlack"
android:exported="true">
<intent-filter
tools:ignore="AppLinkUrlError"
android:label="Amaze Text Editor">
Expand All @@ -152,6 +161,7 @@

</activity>
<activity
android:exported="true"
android:label="@string/databasereader"
android:name=".ui.activities.DatabaseViewerActivity"
android:theme="@style/appCompatBlack"
Expand All @@ -163,6 +173,7 @@
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="db/*" />
<data android:mimeType="application/vnd.sqlite3" />
</intent-filter>

</activity>
Expand Down Expand Up @@ -212,7 +223,8 @@
<service android:name=".asynchronous.services.ftp.FtpTileService"
android:icon="@drawable/ic_ftp_dark"
android:label="@string/ftp"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
android:exported="false">
<intent-filter>
<action
android:name="android.service.quicksettings.action.QS_TILE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public class FileUtils {
private static final String TAG = FileUtils.class.getSimpleName();

private static final String[] COMPRESSED_FILE_EXTENSIONS =
new String[] {"zip", "cab", "bz2", "ace", "bz", "gz", "7z", "jar", "apk", "xz", "lzma", "Z"};
new String[] {
"zip", "cab", "bz2", "ace", "bz", "gz", "7z", "jar", "apk", "xz", "lzma", "Z", "rar"
};

public static final String FILE_PROVIDER_PREFIX = "storage_root";
public static final String NOMEDIA_FILE = ".nomedia";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ public final class MimeTypes {
MIME_TYPES.put("ksh", "text/plain");
MIME_TYPES.put("sh", "application/x-sh");

MIME_TYPES.put("db", "application/octet-stream");
MIME_TYPES.put("db3", "application/octet-stream");
MIME_TYPES.put("db", "application/vnd.sqlite3");
MIME_TYPES.put("db3", "application/vnd.sqlite3");
MIME_TYPES.put("sqlite", "application/vnd.sqlite3");
MIME_TYPES.put("sqlite3", "application/vnd.sqlite3");

MIME_TYPES.put("otf", "application/x-font-otf");
MIME_TYPES.put("ttf", "application/x-font-ttf");
Expand Down