You've already forked RN_Android_VersionUpgrade
							
							地址
This commit is contained in:
		@@ -8,6 +8,7 @@ import android.content.pm.PackageInfo;
 | 
				
			|||||||
import android.content.pm.PackageManager;
 | 
					import android.content.pm.PackageManager;
 | 
				
			||||||
import android.net.Uri;
 | 
					import android.net.Uri;
 | 
				
			||||||
import android.os.Build;
 | 
					import android.os.Build;
 | 
				
			||||||
 | 
					import android.os.Environment;
 | 
				
			||||||
import android.os.Handler;
 | 
					import android.os.Handler;
 | 
				
			||||||
import android.os.Message;
 | 
					import android.os.Message;
 | 
				
			||||||
import android.provider.Settings;
 | 
					import android.provider.Settings;
 | 
				
			||||||
@@ -120,7 +121,7 @@ public class UpgradeModule extends ReactContextBaseJavaModule {
 | 
				
			|||||||
                        byte[] buffer = new byte[2048];
 | 
					                        byte[] buffer = new byte[2048];
 | 
				
			||||||
                        int len = 0;
 | 
					                        int len = 0;
 | 
				
			||||||
                        long total = response.body().contentLength();
 | 
					                        long total = response.body().contentLength();
 | 
				
			||||||
                        File file = new File("update.apk");
 | 
					                        File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),"update.apk");
 | 
				
			||||||
                        fileOutputStream = new FileOutputStream(file);
 | 
					                        fileOutputStream = new FileOutputStream(file);
 | 
				
			||||||
                        long sum = 0;
 | 
					                        long sum = 0;
 | 
				
			||||||
                        while ((len = stream.read(buffer)) != -1) {
 | 
					                        while ((len = stream.read(buffer)) != -1) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user