Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@
<data android:mimeType="*/*" />
</intent-filter>

<intent-filter android:label="@string/intent_save_as" tools:ignore="AppLinkUrlError">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" android:mimeType="*/*" />
</intent-filter>

<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,15 @@ private void checkForExternalIntent(Intent intent) {
* http://teamamaze.xyz/open_file?path=path-to-file
*/
path = Utils.sanitizeInput(uri.getQueryParameter("path"));
} else if (uri != null && ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TranceLove shouldn't we probably sanitize the links here? WDYT?

// save a single file to filesystem
List<Uri> uris = new ArrayList<>();
uris.add(uri);
showSaveSnackbar(uris);

// disable screen rotation just for convenience purpose
// TODO: Support screen rotation when saving a file
Utils.disableScreenRotation(this);
} else {
LOG.warn(getString(R.string.error_cannot_find_way_open));
}
Expand Down
Loading