|
|
@ -27,15 +27,10 @@ import android.widget.RadioGroup; |
|
|
|
import android.widget.Toast; |
|
|
|
import android.widget.Toast; |
|
|
|
import butterknife.Bind; |
|
|
|
import butterknife.Bind; |
|
|
|
import com.arialyy.annotations.Download; |
|
|
|
import com.arialyy.annotations.Download; |
|
|
|
import com.arialyy.annotations.DownloadGroup; |
|
|
|
|
|
|
|
import com.arialyy.aria.core.Aria; |
|
|
|
import com.arialyy.aria.core.Aria; |
|
|
|
import com.arialyy.aria.core.common.RequestEnum; |
|
|
|
|
|
|
|
import com.arialyy.aria.core.download.DownloadEntity; |
|
|
|
|
|
|
|
import com.arialyy.aria.core.download.DownloadGroupTask; |
|
|
|
|
|
|
|
import com.arialyy.aria.core.download.DownloadTarget; |
|
|
|
import com.arialyy.aria.core.download.DownloadTarget; |
|
|
|
import com.arialyy.aria.core.download.DownloadTask; |
|
|
|
import com.arialyy.aria.core.download.DownloadTask; |
|
|
|
import com.arialyy.aria.core.inf.IEntity; |
|
|
|
import com.arialyy.aria.core.inf.IEntity; |
|
|
|
import com.arialyy.aria.util.ALog; |
|
|
|
|
|
|
|
import com.arialyy.aria.util.CommonUtil; |
|
|
|
import com.arialyy.aria.util.CommonUtil; |
|
|
|
import com.arialyy.frame.util.show.L; |
|
|
|
import com.arialyy.frame.util.show.L; |
|
|
|
import com.arialyy.frame.util.show.T; |
|
|
|
import com.arialyy.frame.util.show.T; |
|
|
@ -63,7 +58,8 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
//"http://ox.konsung.net:5555/ksdc-web/download/downloadFile/?fileName=ksdc_1.0.2.apk&rRange=0-";
|
|
|
|
//"http://ox.konsung.net:5555/ksdc-web/download/downloadFile/?fileName=ksdc_1.0.2.apk&rRange=0-";
|
|
|
|
//"http://gdown.baidu.com/data/wisegame/0904344dee4a2d92/QQ_718.apk";
|
|
|
|
//"http://gdown.baidu.com/data/wisegame/0904344dee4a2d92/QQ_718.apk";
|
|
|
|
//"http://qudao.5535.cn/one/game.html?game=531&cpsuser=xiaoeryu2";
|
|
|
|
//"http://qudao.5535.cn/one/game.html?game=531&cpsuser=xiaoeryu2";
|
|
|
|
"https://bogoe-res.mytbz.com/tbzengsong/If You're Happy.mp3"; |
|
|
|
//"https://bogoe-res.mytbz.com/tbzengsong/If You're Happy.mp3";
|
|
|
|
|
|
|
|
"http://ozr0ucjs5.bkt.clouddn.com/51_box-104_20180131202610.apk"; |
|
|
|
@Bind(R.id.start) Button mStart; |
|
|
|
@Bind(R.id.start) Button mStart; |
|
|
|
@Bind(R.id.stop) Button mStop; |
|
|
|
@Bind(R.id.stop) Button mStop; |
|
|
|
@Bind(R.id.cancel) Button mCancel; |
|
|
|
@Bind(R.id.cancel) Button mCancel; |
|
|
@ -177,12 +173,12 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
mCancel.setEnabled(false); |
|
|
|
mCancel.setEnabled(false); |
|
|
|
setBtState(true); |
|
|
|
setBtState(true); |
|
|
|
getBinding().setSpeed(""); |
|
|
|
getBinding().setSpeed(""); |
|
|
|
|
|
|
|
L.d(TAG, "path ==> " + task.getDownloadEntity().getDownloadPath()); |
|
|
|
L.d(TAG, "md5Code ==> " + CommonUtil.getFileMD5(new File(task.getDownloadPath()))); |
|
|
|
L.d(TAG, "md5Code ==> " + CommonUtil.getFileMD5(new File(task.getDownloadPath()))); |
|
|
|
L.d(TAG, "data ==> " + Aria.download(this).getDownloadEntity(DOWNLOAD_URL)); |
|
|
|
L.d(TAG, "data ==> " + Aria.download(this).getDownloadEntity(DOWNLOAD_URL)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Download.onNoSupportBreakPoint |
|
|
|
@Download.onNoSupportBreakPoint public void onNoSupportBreakPoint(DownloadTask task) { |
|
|
|
public void onNoSupportBreakPoint(DownloadTask task) { |
|
|
|
|
|
|
|
T.showShort(SingleTaskActivity.this, "该下载链接不支持断点"); |
|
|
|
T.showShort(SingleTaskActivity.this, "该下载链接不支持断点"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -225,8 +221,10 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
//Aria.get(this).setLogLevel(ALog.LOG_CLOSE);
|
|
|
|
//Aria.get(this).setLogLevel(ALog.LOG_CLOSE);
|
|
|
|
//Aria.download(this).load("aaaa.apk");
|
|
|
|
//Aria.download(this).load("aaaa.apk");
|
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
map.put("User-Agent", "Mozilla/5.0 (Linux; Android 4.4.4; Nexus 5 Build/KTU84P; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 Mobile MQQBrowser/6.2 TBS/043722 Safari/537.36"); |
|
|
|
map.put("User-Agent", |
|
|
|
map.put("Cookie", "BAIDUID=DFC7EF42C60AD1ACF0BA94389AA67F13:FG=1; H_WISE_SIDS=121192_104493_114745_121434_119046_100098_120212_121140_118882_118858_118850_118820_118792_121254_121534_121214_117588_117242_117431_119974_120597_121043_121422_120943_121175_121272_117552_120482_121013_119962_119145_120851_120841_120034_121325_116407_121109_120654_110085_120708; PSINO=7; BDORZ=AE84CDB3A529C0F8A2B9DCDD1D18B695"); |
|
|
|
"Mozilla/5.0 (Linux; Android 4.4.4; Nexus 5 Build/KTU84P; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.132 Mobile MQQBrowser/6.2 TBS/043722 Safari/537.36"); |
|
|
|
|
|
|
|
map.put("Cookie", |
|
|
|
|
|
|
|
"BAIDUID=DFC7EF42C60AD1ACF0BA94389AA67F13:FG=1; H_WISE_SIDS=121192_104493_114745_121434_119046_100098_120212_121140_118882_118858_118850_118820_118792_121254_121534_121214_117588_117242_117431_119974_120597_121043_121422_120943_121175_121272_117552_120482_121013_119962_119145_120851_120841_120034_121325_116407_121109_120654_110085_120708; PSINO=7; BDORZ=AE84CDB3A529C0F8A2B9DCDD1D18B695"); |
|
|
|
Aria.download(SingleTaskActivity.this) |
|
|
|
Aria.download(SingleTaskActivity.this) |
|
|
|
.load(DOWNLOAD_URL) |
|
|
|
.load(DOWNLOAD_URL) |
|
|
|
//.addHeader("groupName", "value")
|
|
|
|
//.addHeader("groupName", "value")
|
|
|
@ -234,8 +232,8 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
//.setRequestMode(RequestEnum.POST)
|
|
|
|
//.setRequestMode(RequestEnum.POST)
|
|
|
|
.setDownloadPath(Environment.getExternalStorageDirectory().getPath() + "/ggsg1.apk") |
|
|
|
.setDownloadPath(Environment.getExternalStorageDirectory().getPath() + "/ggsg1.apk") |
|
|
|
.resetState() |
|
|
|
.resetState() |
|
|
|
//.start();
|
|
|
|
.start(); |
|
|
|
.add(); |
|
|
|
//.add();
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override protected void onDestroy() { |
|
|
|
@Override protected void onDestroy() { |
|
|
|