@capacitor/filesystem 5.1.3 → 5.1.4-nightly-20230919T150513.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/android/build.gradle +3 -3
- package/ios/Plugin/Filesystem.swift +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ If using <a href="#directory">`Directory.Documents`</a> or <a href="#directory">
|
|
|
29
29
|
|
|
30
30
|
Read about [Setting Permissions](https://capacitorjs.com/docs/android/configuration#setting-permissions) in the [Android Guide](https://capacitorjs.com/docs/android) for more information on setting Android permissions.
|
|
31
31
|
|
|
32
|
-
Note that <a href="#directory">`Directory.ExternalStorage`</a> is only available on Android 9 or older and <a href="#directory">`Directory.Documents`</a> only allows to access the files/
|
|
32
|
+
Note that <a href="#directory">`Directory.ExternalStorage`</a> is only available on Android 9 or older and <a href="#directory">`Directory.Documents`</a> only allows to access the files/folders created by your app on Android on Android 11 and newer.
|
|
33
33
|
|
|
34
34
|
Working with large files may require you to add `android:largeHeap="true"` to the `<application>` tag in `AndroidManifest.xml`.
|
|
35
35
|
|
package/android/build.gradle
CHANGED
|
@@ -15,7 +15,7 @@ buildscript {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
dependencies {
|
|
18
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
18
|
+
classpath 'com.android.tools.build:gradle:8.1.1'
|
|
19
19
|
if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
20
20
|
classpath 'io.github.gradle-nexus:publish-plugin:1.3.0'
|
|
21
21
|
}
|
|
@@ -31,10 +31,10 @@ if (System.getenv("CAP_PLUGIN_PUBLISH") == "true") {
|
|
|
31
31
|
|
|
32
32
|
android {
|
|
33
33
|
namespace "com.capacitorjs.plugins.filesystem"
|
|
34
|
-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
34
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
|
|
35
35
|
defaultConfig {
|
|
36
36
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
37
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
37
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
|
|
38
38
|
versionCode 1
|
|
39
39
|
versionName "1.0"
|
|
40
40
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -25,11 +25,14 @@ import Capacitor
|
|
|
25
25
|
public typealias ProgressEmitter = (_ bytes: Int64, _ contentLength: Int64) -> Void
|
|
26
26
|
|
|
27
27
|
public func readFile(at fileUrl: URL, with encoding: String?) throws -> String {
|
|
28
|
+
fileUrl.startAccessingSecurityScopedResource()
|
|
28
29
|
if encoding != nil {
|
|
29
30
|
let data = try String(contentsOf: fileUrl, encoding: .utf8)
|
|
31
|
+
fileUrl.stopAccessingSecurityScopedResource()
|
|
30
32
|
return data
|
|
31
33
|
} else {
|
|
32
34
|
let data = try Data(contentsOf: fileUrl)
|
|
35
|
+
fileUrl.stopAccessingSecurityScopedResource()
|
|
33
36
|
return data.base64EncodedString()
|
|
34
37
|
}
|
|
35
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/filesystem",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4-nightly-20230919T150513.0",
|
|
4
4
|
"description": "The Filesystem API provides a NodeJS-like API for working with files on the device.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|