内部存储
This commit is contained in:
parent
b6f600e708
commit
e23d8e8db7
@ -119,14 +119,11 @@ public class UpgradeModule extends ReactContextBaseJavaModule {
|
||||
try {
|
||||
stream = response.body().byteStream();
|
||||
byte[] buffer = new byte[2048];
|
||||
int len = 0;
|
||||
long total = response.body().contentLength();
|
||||
File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),"update.apk");
|
||||
int len;
|
||||
File file = new File(Environment.getDataDirectory() ,"update.apk");
|
||||
fileOutputStream = new FileOutputStream(file);
|
||||
long sum = 0;
|
||||
while ((len = stream.read(buffer)) != -1) {
|
||||
fileOutputStream.write(buffer, 0, len);
|
||||
sum += len;
|
||||
}
|
||||
fileOutputStream.flush();
|
||||
} catch (IOException e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user