react-native-blob-util 0.19.9 → 0.19.11
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 +24 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilFS.java +3 -3
- package/android/src/main/java/com/ReactNativeBlobUtil/ReactNativeBlobUtilImpl.java +1 -1
- package/android/src/newarch/java/com/ReactNativeBlobUtil/ReactNativeBlobUtil.java +1 -1
- package/android/src/oldarch/java/com/ReactNativeBlobUtil/ReactNativeBlobUtil.java +2 -2
- package/index.d.ts +871 -872
- package/ios/ReactNativeBlobUtil/ReactNativeBlobUtil.mm +1 -2
- package/ios/ReactNativeBlobUtilFS.mm +94 -7
- package/ios/ReactNativeBlobUtilRequest.h +2 -2
- package/ios/ReactNativeBlobUtilRequest.mm +89 -44
- package/package.json +1 -1
- package/react-native-blob-util.podspec +1 -1
package/README.md
CHANGED
|
@@ -951,6 +951,30 @@ public class MainApplication extends Application implements ReactApplication {
|
|
|
951
951
|
}
|
|
952
952
|
````
|
|
953
953
|
|
|
954
|
+
#### Kotlin
|
|
955
|
+
````kotlin
|
|
956
|
+
....
|
|
957
|
+
import com.ReactNativeBlobUtil.ReactNativeBlobUtilUtils;
|
|
958
|
+
import javax.net.ssl.X509TrustManager
|
|
959
|
+
...
|
|
960
|
+
|
|
961
|
+
public class MainApplication extends Application implements ReactApplication {
|
|
962
|
+
...
|
|
963
|
+
public void onCreate() {
|
|
964
|
+
...
|
|
965
|
+
ReactNativeBlobUtilUtils.sharedTrustManager = object : X509TrustManager {
|
|
966
|
+
override fun checkClientTrusted(chain: Array<java.security.cert.X509Certificate>, authType: String) {}
|
|
967
|
+
|
|
968
|
+
override fun checkServerTrusted(chain: Array<java.security.cert.X509Certificate>, authType: String) {}
|
|
969
|
+
|
|
970
|
+
override fun getAcceptedIssuers(): Array<java.security.cert.X509Certificate> {
|
|
971
|
+
return arrayOf()
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
...
|
|
975
|
+
}
|
|
976
|
+
````
|
|
977
|
+
|
|
954
978
|
```js
|
|
955
979
|
ReactNativeBlobUtil.config({
|
|
956
980
|
trusty: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ReactNativeBlobUtil">
|
|
2
2
|
|
|
3
3
|
<!-- Required to download files from Google Play -->
|
|
4
4
|
<uses-permission android:name="android.permission.INTERNET" />
|
|
@@ -678,7 +678,7 @@ class ReactNativeBlobUtilFS {
|
|
|
678
678
|
* @param end End byte offset
|
|
679
679
|
* @param encode NOT IMPLEMENTED
|
|
680
680
|
*/
|
|
681
|
-
static void slice(String path, String dest,
|
|
681
|
+
static void slice(String path, String dest, long start, long end, String encode, Promise promise) {
|
|
682
682
|
try {
|
|
683
683
|
dest = ReactNativeBlobUtilUtils.normalizePath(dest);
|
|
684
684
|
|
|
@@ -696,13 +696,13 @@ class ReactNativeBlobUtilFS {
|
|
|
696
696
|
return;
|
|
697
697
|
}
|
|
698
698
|
FileOutputStream out = new FileOutputStream(new File(dest));
|
|
699
|
-
|
|
699
|
+
long skipped = in.skip(start);
|
|
700
700
|
if (skipped != start) {
|
|
701
701
|
promise.reject("EUNSPECIFIED", "Skipped " + skipped + " instead of the specified " + start + " bytes");
|
|
702
702
|
return;
|
|
703
703
|
}
|
|
704
704
|
byte[] buffer = new byte[10240];
|
|
705
|
-
int remain = end - start;
|
|
705
|
+
int remain = (int) (end - start);
|
|
706
706
|
while (remain > 0) {
|
|
707
707
|
int read = in.read(buffer, 0, 10240);
|
|
708
708
|
if (read <= 0) {
|
|
@@ -294,7 +294,7 @@ class ReactNativeBlobUtilImpl {
|
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
public void slice(String src, String dest,
|
|
297
|
+
public void slice(String src, String dest, long start, long end, Promise promise) {
|
|
298
298
|
ReactNativeBlobUtilFS.slice(src, dest, start, end, "", promise);
|
|
299
299
|
}
|
|
300
300
|
|
|
@@ -198,7 +198,7 @@ public class ReactNativeBlobUtil extends NativeBlobUtilsSpec {
|
|
|
198
198
|
|
|
199
199
|
@Override
|
|
200
200
|
public void slice(String src, String dest, double start, double end, Promise promise) {
|
|
201
|
-
delegate.slice(src, dest, (
|
|
201
|
+
delegate.slice(src, dest, (long) start, (long) end, promise);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
@Override
|
|
@@ -174,8 +174,8 @@ public class ReactNativeBlobUtil extends ReactContextBaseJavaModule {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
@ReactMethod
|
|
177
|
-
public void slice(String src, String dest,
|
|
178
|
-
delegate.slice(src, dest, start, end, promise);
|
|
177
|
+
public void slice(String src, String dest, double start, double end, Promise promise) {
|
|
178
|
+
delegate.slice(src, dest, (long) start, (long) end, promise);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
@ReactMethod
|