feat: Support Via Download task, require via version 5.5.0 or above(Android) (#412) (#419)

This commit is contained in:
Zack authored and GitHub committed 2024-03-27 21:58:16 +08:00
1 parent c696b59c4b
commit 27011fb96b
2 files changed
+8 -1

No files matched your search

@@ -71,6 +71,13 @@
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity> </activity>
<!-- Add android:stopWithTask option only when necessary. --> <!-- Add android:stopWithTask option only when necessary. -->
@@ -274,7 +274,7 @@ class AppController extends GetxController with WindowListener, TrayListener {
} }
Future<void> _toCreate(Uri uri) async { Future<void> _toCreate(Uri uri) async {
final path = uri.scheme == "magnet" final path = (uri.scheme == "magnet" || uri.scheme == "http" || uri.scheme == "https")
? uri.toString() ? uri.toString()
: (await toFile(uri.toString())).path; : (await toFile(uri.toString())).path;
await Get.rootDelegate.offAndToNamed(Routes.CREATE, arguments: path); await Get.rootDelegate.offAndToNamed(Routes.CREATE, arguments: path);