Commit 637bbe00 by amateur

1

1 parent e6a1380e
......@@ -32,12 +32,12 @@ import java.io.File;
public class UpdateDialog extends DialogFragment implements View.OnClickListener {
public static UpdateDialog show(FragmentManager mgr, UpdateVersion info) {
if (null == info) {
info = new UpdateVersion();
info.setIsForce("0");
info.setvNumber("2.1.1");
info.setLocation("https://cos.pgyer.com/319735d279de31ab4aea67d07c0706e3.apk?sign=34fa92d8e78cc084322dc868a10299ab&t=1634904770&response-content-disposition=attachment%3Bfilename%3DNAFMII%E4%B9%8B%E7%AA%97-qp_2.1.apk");
}
// if (null == info) {
// info = new UpdateVersion();
// info.setIsForce("0");
// info.setvNumber("2.1.1");
// info.setLocation("https://cos.pgyer.com/319735d279de31ab4aea67d07c0706e3.apk?sign=34fa92d8e78cc084322dc868a10299ab&t=1634904770&response-content-disposition=attachment%3Bfilename%3DNAFMII%E4%B9%8B%E7%AA%97-qp_2.1.apk");
// }
UpdateDialog dialog = new UpdateDialog();
Bundle bundle = new Bundle();
bundle.putString("data", JSON.toJSONString(info));
......@@ -164,6 +164,13 @@ public class UpdateDialog extends DialogFragment implements View.OnClickListener
void download() {
this.updateProgress(0);
String url = this.versionInfo.getLocation();
if (TextUtils.isEmpty(url)) {
showFailTips();
return;
}
if (!url.startsWith("http")) {
url = BuildConfig.IMG_API + url;
}
String version = this.versionInfo.getvNumber();
String name = String.format("nafmii-%s.apk", version);
File file = new File(FileUtils.getSysDownLoadDir(), name);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!