GeezerVison is showing github.com — Added native PermissionFreeMode flag on Android to skip permission di… · yasirkula/UnityNativeFilePicker@de516b9
File tree
Expand file treeCollapse file tree
Open diff view settings
.github/AAR Source (Android)/java/com/yasirkula/unity
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/AAR Source (Android)/java/com/yasirkula/unity/NativeFilePicker.java +4-2Lines changed: 4 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
13 | 13 | import android.provider.Settings; |
14 | 14 | import android.webkit.MimeTypeMap; |
15 | 15 |
|
16 | | -import java.io.BufferedReader; |
17 | | -import java.io.InputStreamReader; |
18 | 16 | import java.util.ArrayList; |
19 | 17 | import java.util.Locale; |
20 | 18 |
|
21 | 19 | public class NativeFilePicker |
22 | 20 | { |
23 | 21 | public static boolean UseDefaultFilePickerApp = false; // false: Intent.createChooser is used to select the file picker app |
| 22 | + public static boolean PermissionFreeMode = false; // true: No permission will be asked (use at your own risk) |
24 | 23 |
|
25 | 24 | public static void PickFiles( Context context, final NativeFilePickerResultReceiver resultReceiver, final boolean selectMultiple, final String savePath, final String[] mimes, final String title ) |
26 | 25 | { |
@@ -74,6 +73,9 @@ public static void ExportFiles( Context context, final NativeFilePickerResultRec |
74 | 73 | @TargetApi( Build.VERSION_CODES.M ) |
75 | 74 | public static int CheckPermission( Context context, final boolean readPermissionOnly ) |
76 | 75 | { |
| 76 | + if( PermissionFreeMode ) |
| 77 | + return 1; |
| 78 | + |
77 | 79 | if( Build.VERSION.SDK_INT < Build.VERSION_CODES.M ) |
78 | 80 | return 1; |
79 | 81 |
|
|
Collapse file
Copy file name to clipboard Collapse file
Copy file name to clipboardExpand all lines: Plugins/NativeFilePicker/README.txt +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -= Native File Picker for Android & iOS (v1.3.4) = |
| 1 | += Native File Picker for Android & iOS (v1.3.5) = |
2 | 2 |
|
3 | 3 | Documentation: https://github.com/yasirkula/UnityNativeFilePicker |
4 | 4 | FAQ: https://github.com/yasirkula/UnityNativeFilePicker#faq |
|
Collapse file
Copy file name to clipboardExpand all lines: package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "name": "com.yasirkula.nativefilepicker", |
3 | 3 | "displayName": "Native File Picker", |
4 | | - "version": "1.3.4", |
| 4 | + "version": "1.3.5", |
5 | 5 | "documentationUrl": "https://github.com/yasirkula/UnityNativeFilePicker", |
6 | 6 | "changelogUrl": "https://github.com/yasirkula/UnityNativeFilePicker/releases", |
7 | 7 | "licensesUrl": "https://github.com/yasirkula/UnityNativeFilePicker/blob/master/LICENSE.txt", |
|