更新 taskInfo.java

master
wangsiyuan 2023-08-09 20:14:29 +08:00
parent f921ea70b4
commit a4bacd9f6a
1 changed files with 9 additions and 4 deletions

View File

@ -23,7 +23,6 @@ public class taskInfo {
public static void getTask() {
String packageName = "";
String apkPath = "";
int code = -1;
// 检查目录是否存在
File directory = new File("/sdcard/apks/");
@ -47,13 +46,19 @@ public class taskInfo {
JSONObject json = new JSONObject(sb.toString());
code = json.getInt("code");
if (code == 1){
apkPath = json.getString("apkPath");
String apkPath = json.getString("apkPath");
packageName = json.getString("packageName");
Log.i(TAG, "getTask apkPath: "+apkPath);
Log.i(TAG, "getTask packageName: "+packageName);
// 拼接URL并启动下载
String downloadUrl = "http://39.103.73.250/tt/upload/ddj/" + apkPath;
downloadFile(downloadUrl, "/sdcard/apks/" + apkPath);
// 拼接URL并启动下载
new Thread(new Runnable() {
@Override
public void run() {
downloadFile(downloadUrl, "" + apkPath);
// 执行其他下载操作
}
}).start();
}
}
} catch (Exception e) {