diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 71b9766d7d..e9ca147940 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -137,29 +137,6 @@ - - - - - - - - - - - - - - - - - - - - - - - + android:parentActivityName=".ActivityView"> + + + + + + + + + + + + + + + + + + + + + + + uris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM); - if (uris == null) - intent.removeExtra(Intent.EXTRA_STREAM); - else { - ArrayList processed = new ArrayList<>(); - for (Uri uri : uris) - processed.add(processUri(uri)); - intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, processed); - } - } else { - Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM); - if (uri == null) - intent.removeExtra(Intent.EXTRA_STREAM); - else - intent.putExtra(Intent.EXTRA_STREAM, processUri(uri)); - } - } - } - - private Uri processUri(Uri uri) { - try { - String fname = null; - try { - DocumentFile dfile = DocumentFile.fromSingleUri(ActivityMain.this, uri); - if (dfile != null) - fname = dfile.getName(); - } catch (SecurityException ex) { - Log.e(ex); - } - - if (TextUtils.isEmpty(fname)) - fname = uri.getLastPathSegment(); - - if (TextUtils.isEmpty(fname)) - return uri; - - File dir = new File(getCacheDir(), "shared"); - if (!dir.exists()) - dir.mkdir(); - File file = new File(dir, fname); - - Log.i("Copying shared file to " + file); - Helper.copy(getContentResolver().openInputStream(uri), new FileOutputStream(file)); - - return FileProvider.getUriForFile(ActivityMain.this, BuildConfig.APPLICATION_ID, file); - } catch (Throwable ex) { - Log.w(ex); - return uri; - } - } }; if (Helper.shouldAuthenticate(this)) diff --git a/app/src/main/java/eu/faircode/email/Shortcuts.java b/app/src/main/java/eu/faircode/email/Shortcuts.java index e1dae75d08..0249f07ba7 100644 --- a/app/src/main/java/eu/faircode/email/Shortcuts.java +++ b/app/src/main/java/eu/faircode/email/Shortcuts.java @@ -170,7 +170,7 @@ class Shortcuts { boolean identicons = prefs.getBoolean("identicons", false); boolean circular = prefs.getBoolean("circular", true); - Intent intent = new Intent(context, ActivityMain.class); + Intent intent = new Intent(context, ActivityCompose.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); intent.setAction(Intent.ACTION_SEND); intent.addCategory(Intent.CATEGORY_DEFAULT); diff --git a/app/src/main/res/xml/fileprovider_paths.xml b/app/src/main/res/xml/fileprovider_paths.xml index 6341acf938..2cebe8595b 100644 --- a/app/src/main/res/xml/fileprovider_paths.xml +++ b/app/src/main/res/xml/fileprovider_paths.xml @@ -12,9 +12,6 @@ -