File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed
.github/AAR Source (Android)/java/com/yasirkula/unity
Plugins/SimpleFileBrowser Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -108,13 +108,21 @@ public static String GetExternalDrives( Context context )
108
108
}
109
109
110
110
// This is the only working method on some Android 11+ devices (when Storage Access Framework isn't used)
111
- if ( android .os .Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .N )
111
+ if ( android .os .Build .VERSION .SDK_INT >= 30 )
112
+ {
113
+ for ( StorageVolume volume : ( (StorageManager ) context .getSystemService ( Context .STORAGE_SERVICE ) ).getStorageVolumes () )
114
+ {
115
+ File volumeDirectory = volume .getDirectory ();
116
+ if ( volumeDirectory != null )
117
+ potentialDrives .add ( volumeDirectory .toString () );
118
+ }
119
+ }
120
+ else if ( android .os .Build .VERSION .SDK_INT >= android .os .Build .VERSION_CODES .N )
112
121
{
113
122
try
114
123
{
115
124
Method getPath = StorageVolume .class .getMethod ( "getPath" );
116
- StorageManager storageManager = (StorageManager ) context .getSystemService ( Context .STORAGE_SERVICE );
117
- for ( StorageVolume volume : storageManager .getStorageVolumes () )
125
+ for ( StorageVolume volume : ( (StorageManager ) context .getSystemService ( Context .STORAGE_SERVICE ) ).getStorageVolumes () )
118
126
potentialDrives .add ( (String ) getPath .invoke ( volume ) );
119
127
}
120
128
catch ( Exception e )
Original file line number Diff line number Diff line change 1
- = Simple File Browser (v1.6.0 ) =
1
+ = Simple File Browser (v1.6.1 ) =
2
2
3
3
Online documentation & example code available at: https://github.com/yasirkula/UnitySimpleFileBrowser
4
4
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " com.yasirkula.simplefilebrowser" ,
3
3
"displayName" : " Simple File Browser" ,
4
- "version" : " 1.6.0 " ,
4
+ "version" : " 1.6.1 " ,
5
5
"documentationUrl" : " https://github.com/yasirkula/UnitySimpleFileBrowser" ,
6
6
"changelogUrl" : " https://github.com/yasirkula/UnitySimpleFileBrowser/releases" ,
7
7
"licensesUrl" : " https://github.com/yasirkula/UnitySimpleFileBrowser/blob/master/LICENSE.txt" ,
You can’t perform that action at this time.
0 commit comments