File tree Expand file tree Collapse file tree 6 files changed +33
-6
lines changed Expand file tree Collapse file tree 6 files changed +33
-6
lines changed Original file line number Diff line number Diff line change 3
3
<uses-permission android : name =" android.permission.INTERNET" />
4
4
<uses-permission android : name =" ANDROID.PERMISSION.READ_EXTERNAL_STORAGE" />
5
5
<uses-permission android : name =" ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE" />
6
+ <uses-permission android : name =" android.permission.READ_MEDIA_AUDIO" />
7
+ <uses-permission android : name =" android.permission.READ_MEDIA_VIDEO" />
8
+
9
+ <uses-permission android : name =" android.permission.READ_EXTERNAL_STORAGE" />
10
+ <uses-permission android : name =" android.permission.WRITE_EXTERNAL_STORAGE" />
6
11
7
12
<application
8
13
android : name =" ${applicationName}"
Original file line number Diff line number Diff line change 58
58
<true />
59
59
<key >UIApplicationSupportsIndirectInputEvents </key >
60
60
<true />
61
+ <key >NSAppTransportSecurity </key >
62
+ <dict >
63
+ <key >NSAllowsArbitraryLoads </key >
64
+ <true />
65
+ </dict >
66
+
61
67
</dict >
62
68
</plist >
Original file line number Diff line number Diff line change 1
1
import 'dart:io' ;
2
2
3
3
import 'package:dantotsu/api/Mangayomi/Model/settings.dart' ;
4
+ import 'package:flutter/services.dart' ;
4
5
import 'package:isar/isar.dart' ;
5
6
import 'package:path/path.dart' as path;
6
7
import 'package:path_provider/path_provider.dart' ;
@@ -13,18 +14,33 @@ import 'api/Mangayomi/Model/chapter.dart';
13
14
14
15
class StorageProvider {
15
16
Future <bool > requestPermission () async {
16
- Permission permission = Permission .manageExternalStorage;
17
17
if (Platform .isAndroid) {
18
- if (await permission.isGranted) {
18
+ if (await Permission .videos.isDenied ||
19
+ await Permission .videos.isPermanentlyDenied) {
20
+ final state = await Permission .videos.request ();
21
+ if (! state.isGranted) {
22
+ await SystemNavigator .pop ();
23
+ }
24
+ }
25
+ // Audio permissions.
26
+ if (await Permission .audio.isDenied ||
27
+ await Permission .audio.isPermanentlyDenied) {
28
+ final state = await Permission .audio.request ();
29
+ if (! state.isGranted) {
30
+ await SystemNavigator .pop ();
31
+ }
32
+ }
33
+ if (await Permission .manageExternalStorage.isGranted) {
19
34
return true ;
20
35
} else {
21
- final result = await permission .request ();
36
+ final result = await Permission .manageExternalStorage .request ();
22
37
if (result == PermissionStatus .granted) {
23
38
return true ;
24
39
}
25
40
return false ;
26
41
}
27
42
}
43
+
28
44
return true ;
29
45
}
30
46
Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ void main(List<String> args) async {
45
45
}
46
46
47
47
Future init () async {
48
- MediaKit .ensureInitialized ();
49
48
await PrefManager .init ();
50
49
initializeMediaServices ();
51
50
isar = await StorageProvider ().initDB (null );
52
51
await StorageProvider ().requestPermission ();
52
+ MediaKit .ensureInitialized ();
53
53
await windowManager.ensureInitialized ();
54
54
TypeFactory .registerAllTypes ();
55
55
GetMediaIDs .getData ();
Original file line number Diff line number Diff line change 3
3
<plist version =" 1.0" >
4
4
<dict >
5
5
<key >com.apple.security.app-sandbox</key >
6
- <true />
6
+ <false />
7
7
<key >com.apple.security.cs.allow-jit</key >
8
8
<true />
9
9
<key >com.apple.security.network.server</key >
Original file line number Diff line number Diff line change 5
5
<key >com.apple.security.network.client</key >
6
6
<true />
7
7
<key >com.apple.security.app-sandbox</key >
8
- <true />
8
+ <false />
9
9
</dict >
10
10
</plist >
You can’t perform that action at this time.
0 commit comments