|
|
|
@ -27,15 +27,10 @@ import android.widget.RadioGroup; |
|
|
|
|
import android.widget.Toast; |
|
|
|
|
import butterknife.Bind; |
|
|
|
|
import com.arialyy.annotations.Download; |
|
|
|
|
import com.arialyy.annotations.DownloadGroup; |
|
|
|
|
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.DownloadTask; |
|
|
|
|
import com.arialyy.aria.core.inf.IEntity; |
|
|
|
|
import com.arialyy.aria.util.ALog; |
|
|
|
|
import com.arialyy.aria.util.CommonUtil; |
|
|
|
|
import com.arialyy.frame.util.show.L; |
|
|
|
|
import com.arialyy.frame.util.show.T; |
|
|
|
@ -53,17 +48,18 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
|
//"https://atom-installer.github.com/v1.13.0/AtomSetup.exe?s=1484074138&ext=.exe";
|
|
|
|
|
//"http://static.gaoshouyou.com/d/22/94/822260b849944492caadd2983f9bb624.apk";
|
|
|
|
|
//"http://sitcac.daxincf.cn/wp-content/uploads/swift_vido/01/element.mp4_1";
|
|
|
|
|
//"http://120.25.196.56:8000/filereq?id=15692406294&ipncid=105635&client=android&filename=20170819185541.avi";
|
|
|
|
|
//"http://down2.xiaoshuofuwuqi.com/d/file/filetxt/20170608/14/%BA%DA%CE%D7%CA%A6%E1%C8%C6%F0.txt";
|
|
|
|
|
//"http://tinghuaapp.oss-cn-shanghai.aliyuncs.com/20170612201739607815";
|
|
|
|
|
//"http://static.gaoshouyou.com/d/36/69/2d3699acfa69e9632262442c46516ad8.apk";
|
|
|
|
|
//"http://oqcpqqvuf.bkt.clouddn.com/ceshi.txt";
|
|
|
|
|
//"http://down8.androidgame-store.com/201706122321/97967927DD4E53D9905ECAA7874C8128/new/game1/19/45319/com.neuralprisma-2.5.2.174-2000174_1494784835.apk?f=web_1";
|
|
|
|
|
//不支持断点的链接
|
|
|
|
|
//"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://qudao.5535.cn/one/game.html?game=531&cpsuser=xiaoeryu2";
|
|
|
|
|
"https://bogoe-res.mytbz.com/tbzengsong/If You're Happy.mp3"; |
|
|
|
|
//"http://120.25.196.56:8000/filereq?id=15692406294&ipncid=105635&client=android&filename=20170819185541.avi";
|
|
|
|
|
//"http://down2.xiaoshuofuwuqi.com/d/file/filetxt/20170608/14/%BA%DA%CE%D7%CA%A6%E1%C8%C6%F0.txt";
|
|
|
|
|
//"http://tinghuaapp.oss-cn-shanghai.aliyuncs.com/20170612201739607815";
|
|
|
|
|
//"http://static.gaoshouyou.com/d/36/69/2d3699acfa69e9632262442c46516ad8.apk";
|
|
|
|
|
//"http://oqcpqqvuf.bkt.clouddn.com/ceshi.txt";
|
|
|
|
|
//"http://down8.androidgame-store.com/201706122321/97967927DD4E53D9905ECAA7874C8128/new/game1/19/45319/com.neuralprisma-2.5.2.174-2000174_1494784835.apk?f=web_1";
|
|
|
|
|
//不支持断点的链接
|
|
|
|
|
//"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://qudao.5535.cn/one/game.html?game=531&cpsuser=xiaoeryu2";
|
|
|
|
|
//"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.stop) Button mStop; |
|
|
|
|
@Bind(R.id.cancel) Button mCancel; |
|
|
|
@ -122,7 +118,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Download.onWait void onWait(DownloadTask task){ |
|
|
|
|
@Download.onWait void onWait(DownloadTask task) { |
|
|
|
|
Log.d(TAG, "wait ==> " + task.getDownloadEntity().getFileName()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -177,12 +173,12 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
|
mCancel.setEnabled(false); |
|
|
|
|
setBtState(true); |
|
|
|
|
getBinding().setSpeed(""); |
|
|
|
|
L.d(TAG, "path ==> " + task.getDownloadEntity().getDownloadPath()); |
|
|
|
|
L.d(TAG, "md5Code ==> " + CommonUtil.getFileMD5(new File(task.getDownloadPath()))); |
|
|
|
|
L.d(TAG, "data ==> " + Aria.download(this).getDownloadEntity(DOWNLOAD_URL)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Download.onNoSupportBreakPoint |
|
|
|
|
public void onNoSupportBreakPoint(DownloadTask task) { |
|
|
|
|
@Download.onNoSupportBreakPoint public void onNoSupportBreakPoint(DownloadTask task) { |
|
|
|
|
T.showShort(SingleTaskActivity.this, "该下载链接不支持断点"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -221,12 +217,14 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void startD(){ |
|
|
|
|
private void startD() { |
|
|
|
|
//Aria.get(this).setLogLevel(ALog.LOG_CLOSE);
|
|
|
|
|
//Aria.download(this).load("aaaa.apk");
|
|
|
|
|
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("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"); |
|
|
|
|
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("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) |
|
|
|
|
.load(DOWNLOAD_URL) |
|
|
|
|
//.addHeader("groupName", "value")
|
|
|
|
@ -234,8 +232,8 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> { |
|
|
|
|
//.setRequestMode(RequestEnum.POST)
|
|
|
|
|
.setDownloadPath(Environment.getExternalStorageDirectory().getPath() + "/ggsg1.apk") |
|
|
|
|
.resetState() |
|
|
|
|
//.start();
|
|
|
|
|
.add(); |
|
|
|
|
.start(); |
|
|
|
|
//.add();
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override protected void onDestroy() { |
|
|
|
|