m3u8点播下载新增创建ts索引功能
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
<dGroup>
|
||||
|
||||
<!--组合任务下载队列最大任务数, 默认为2-->
|
||||
<maxTaskNum value="1"/>
|
||||
<maxTaskNum value="2"/>
|
||||
|
||||
<!--设置下载失败,重试次数,默认为10-->
|
||||
<reTryNum value="1"/>
|
||||
@@ -131,7 +131,7 @@
|
||||
<!-- =============================以下为子任务的配置====================================-->
|
||||
|
||||
<!--能同时下载的子任务最大任务数,默认3-->
|
||||
<subMaxTaskNum value="1"/>
|
||||
<subMaxTaskNum value="5"/>
|
||||
|
||||
<!--子任务下载失败时的重试次数,默认为5-->
|
||||
<subReTryNum value="5"/>
|
||||
|
||||
@@ -22,16 +22,11 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
import com.arialyy.annotations.Download;
|
||||
import com.arialyy.aria.core.Aria;
|
||||
import com.arialyy.aria.core.common.ftp.FtpInterceptHandler;
|
||||
import com.arialyy.aria.core.common.ftp.IFtpUploadInterceptor;
|
||||
import com.arialyy.aria.core.download.DownloadEntity;
|
||||
import com.arialyy.aria.core.upload.UploadEntity;
|
||||
import com.arialyy.aria.core.upload.UploadTask;
|
||||
import com.arialyy.frame.util.FileUtil;
|
||||
import com.arialyy.frame.util.show.T;
|
||||
import com.arialyy.simple.R;
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lyy on 2017/7/28. HTTP 文件下载demo
|
||||
@@ -64,7 +59,7 @@ public class FtpUpload extends Activity {
|
||||
//.addHeader(key, value) // 添加头
|
||||
//.asPost() //或 asGet()
|
||||
//.setParam() // 设置参数
|
||||
.start();
|
||||
.create();
|
||||
}
|
||||
break;
|
||||
case R.id.cancel:
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.arialyy.aria.core.download.DownloadTask;
|
||||
import com.arialyy.aria.util.CommonUtil;
|
||||
import com.arialyy.frame.core.AbsDialog;
|
||||
import com.arialyy.simple.R;
|
||||
import com.arialyy.simple.util.AppUtil;
|
||||
import com.arialyy.simple.widget.HorizontalProgressBarWithNumber;
|
||||
|
||||
/**
|
||||
@@ -40,7 +39,7 @@ public class DownloadDialog extends AbsDialog implements View.OnClickListener {
|
||||
private Button mCancel;
|
||||
private TextView mSize;
|
||||
private TextView mSpeed;
|
||||
private DownloadEntity mEntity;
|
||||
private long mTaskId = -1;
|
||||
|
||||
private static final String DOWNLOAD_URL =
|
||||
"http://static.gaoshouyou.com/d/4b/d7/e04b308d9cd7f0ad4cac18d1a514544c.apk";
|
||||
@@ -61,13 +60,14 @@ public class DownloadDialog extends AbsDialog implements View.OnClickListener {
|
||||
mCancel = findViewById(R.id.cancel);
|
||||
mSize = findViewById(R.id.size);
|
||||
mSpeed = findViewById(R.id.speed);
|
||||
mEntity = Aria.download(this).getFirstDownloadEntity(DOWNLOAD_URL);
|
||||
if (mEntity != null) {
|
||||
mSize.setText(CommonUtil.formatFileSize(mEntity.getFileSize()));
|
||||
int p = (int) (mEntity.getCurrentProgress() * 100 / mEntity.getFileSize());
|
||||
DownloadEntity entity = Aria.download(this).getFirstDownloadEntity(DOWNLOAD_URL);
|
||||
if (entity != null) {
|
||||
mSize.setText(CommonUtil.formatFileSize(entity.getFileSize()));
|
||||
int p = (int) (entity.getCurrentProgress() * 100 / entity.getFileSize());
|
||||
mPb.setProgress(p);
|
||||
int state = mEntity.getState();
|
||||
int state = entity.getState();
|
||||
setBtState(state != DownloadEntity.STATE_RUNNING);
|
||||
mTaskId = entity.getId();
|
||||
} else {
|
||||
setBtState(true);
|
||||
}
|
||||
@@ -79,28 +79,27 @@ public class DownloadDialog extends AbsDialog implements View.OnClickListener {
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.start:
|
||||
if (!AppUtil.chekEntityValid(mEntity)) {
|
||||
Aria.download(this)
|
||||
if (mTaskId == -1) {
|
||||
mTaskId = Aria.download(this)
|
||||
.load(DOWNLOAD_URL)
|
||||
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/飞机大战.apk")
|
||||
.start();
|
||||
.create();
|
||||
mStart.setText(getContext().getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
if (Aria.download(this).load(mEntity.getId()).isRunning()) {
|
||||
Aria.download(this).load(mEntity.getId()).stop();
|
||||
if (Aria.download(this).load(mTaskId).isRunning()) {
|
||||
Aria.download(this).load(mTaskId).stop();
|
||||
mStart.setText(getContext().getString(R.string.resume));
|
||||
} else {
|
||||
Aria.download(this).load(mEntity.getId()).resume();
|
||||
Aria.download(this).load(mTaskId).resume();
|
||||
mStart.setText(getContext().getString(R.string.stop));
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.cancel:
|
||||
if (AppUtil.chekEntityValid(mEntity)) {
|
||||
Aria.download(this).load(mEntity.getId()).cancel();
|
||||
mStart.setText(getContext().getString(R.string.start));
|
||||
}
|
||||
Aria.download(this).load(mTaskId).cancel();
|
||||
mTaskId = -1;
|
||||
mStart.setText(getContext().getString(R.string.start));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ import com.arialyy.simple.util.AppUtil;
|
||||
Aria.download(getContext())
|
||||
.load(DOWNLOAD_URL)
|
||||
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/放置江湖.apk")
|
||||
.start();
|
||||
.create();
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import com.arialyy.aria.core.inf.IEntity;
|
||||
import com.arialyy.aria.util.CommonUtil;
|
||||
import com.arialyy.frame.core.AbsPopupWindow;
|
||||
import com.arialyy.simple.R;
|
||||
import com.arialyy.simple.util.AppUtil;
|
||||
import com.arialyy.simple.widget.HorizontalProgressBarWithNumber;
|
||||
|
||||
/**
|
||||
@@ -43,7 +42,7 @@ public class DownloadPopupWindow extends AbsPopupWindow implements View.OnClickL
|
||||
private Button mCancel;
|
||||
private TextView mSize;
|
||||
private TextView mSpeed;
|
||||
private DownloadEntity mEntity;
|
||||
private long mTaskId = -1;
|
||||
|
||||
private static final String DOWNLOAD_URL =
|
||||
"http://static.gaoshouyou.com/d/25/57/2e25bd9d4557ba31e9beebacfaf9e804.apk";
|
||||
@@ -67,15 +66,16 @@ public class DownloadPopupWindow extends AbsPopupWindow implements View.OnClickL
|
||||
mStart.setOnClickListener(this);
|
||||
mCancel.setOnClickListener(this);
|
||||
|
||||
mEntity = Aria.download(this).getFirstDownloadEntity(DOWNLOAD_URL);
|
||||
if (mEntity != null) {
|
||||
mPb.setProgress(mEntity.getPercent());
|
||||
mSize.setText(CommonUtil.formatFileSize(mEntity.getFileSize()));
|
||||
if (mEntity.getState() == IEntity.STATE_RUNNING) {
|
||||
DownloadEntity entity = Aria.download(this).getFirstDownloadEntity(DOWNLOAD_URL);
|
||||
if (entity != null) {
|
||||
mPb.setProgress(entity.getPercent());
|
||||
mSize.setText(CommonUtil.formatFileSize(entity.getFileSize()));
|
||||
if (entity.getState() == IEntity.STATE_RUNNING) {
|
||||
mStart.setText(getContext().getString(R.string.stop));
|
||||
} else {
|
||||
mStart.setText(getContext().getString(R.string.resume));
|
||||
}
|
||||
mTaskId = entity.getId();
|
||||
} else {
|
||||
mStart.setText(getContext().getString(R.string.start));
|
||||
}
|
||||
@@ -86,28 +86,28 @@ public class DownloadPopupWindow extends AbsPopupWindow implements View.OnClickL
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.start:
|
||||
if (!AppUtil.chekEntityValid(mEntity)) {
|
||||
if (mTaskId != -1) {
|
||||
Aria.download(this)
|
||||
.load(DOWNLOAD_URL)
|
||||
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/消消乐.apk")
|
||||
.start();
|
||||
.create();
|
||||
mStart.setText(getContext().getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
if (Aria.download(this).load(mEntity.getId()).isRunning()) {
|
||||
Aria.download(this).load(mEntity.getId()).stop();
|
||||
if (Aria.download(this).load(mTaskId).isRunning()) {
|
||||
Aria.download(this).load(mTaskId).stop();
|
||||
mStart.setText(getContext().getString(R.string.resume));
|
||||
} else {
|
||||
Aria.download(this).load(mEntity.getId()).resume();
|
||||
Aria.download(this).load(mTaskId).resume();
|
||||
mStart.setText(getContext().getString(R.string.stop));
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.cancel:
|
||||
if (AppUtil.chekEntityValid(mEntity)) {
|
||||
|
||||
Aria.download(this).load(mEntity.getId()).cancel();
|
||||
}
|
||||
Aria.download(this).load(mTaskId).cancel();
|
||||
mStart.setText(getContext().getResources().getString(R.string.start));
|
||||
mTaskId = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class FtpDownloadActivity extends BaseActivity<ActivityFtpDownloadBinding
|
||||
.option()
|
||||
.login("8L8e", "8guD")
|
||||
.controller(ControllerType.START_CONTROLLER)
|
||||
.start();
|
||||
.create();
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public class FtpDownloadActivity extends BaseActivity<ActivityFtpDownloadBinding
|
||||
}
|
||||
|
||||
@Download.onTaskStart() void taskStart(DownloadTask task) {
|
||||
L.d(TAG, "ftp task start");
|
||||
L.d(TAG, "ftp task create");
|
||||
}
|
||||
|
||||
@Download.onTaskRunning() protected void running(DownloadTask task) {
|
||||
|
||||
@@ -283,7 +283,7 @@ class KotlinDownloadActivity : BaseActivity<ActivitySingleKotlinBinding>() {
|
||||
//.addHeader("Cookie", "BAIDUID=648E5FF020CC69E8DD6F492D1068AAA9:FG=1; BIDUPSID=648E5FF020CC69E8DD6F492D1068AAA9; PSTM=1519099573; BD_UPN=12314753; locale=zh; BDSVRTM=0")
|
||||
.useServerFileName(true)
|
||||
.setFilePath(mFilePath!!, true)
|
||||
.start()
|
||||
.create()
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
|
||||
@@ -54,11 +54,11 @@
|
||||
// Aria.download(this).register();
|
||||
// }
|
||||
//
|
||||
// public void start() {
|
||||
// public void create() {
|
||||
// Aria.download(this)
|
||||
// .load(DOWNLOAD_URL)
|
||||
// .setFilePath(Environment.getExternalStorageDirectory() + "/Download/消灭星星.apk")
|
||||
// .start();
|
||||
// .create();
|
||||
// }
|
||||
//
|
||||
// public void stop() {
|
||||
|
||||
@@ -306,7 +306,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
|
||||
.option()
|
||||
.addHeader("1", "@")
|
||||
.controller(ControllerType.START_CONTROLLER)
|
||||
.start();
|
||||
.create();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.arialyy.aria.util.CommonUtil;
|
||||
import com.arialyy.frame.core.AbsFragment;
|
||||
import com.arialyy.simple.R;
|
||||
import com.arialyy.simple.databinding.FragmentDownloadBinding;
|
||||
import com.arialyy.simple.util.AppUtil;
|
||||
|
||||
/**
|
||||
* Created by lyy on 2017/1/4.
|
||||
@@ -38,7 +37,7 @@ public class DownloadFragment extends AbsFragment<FragmentDownloadBinding>
|
||||
implements View.OnClickListener {
|
||||
Button mStart;
|
||||
Button mCancel;
|
||||
private DownloadEntity mEntity;
|
||||
private long mTaskId = -1;
|
||||
|
||||
private static final String DOWNLOAD_URL =
|
||||
"https://res5.d.cn/2137e42d610b3488d9420c6421529386eee5bdbfd9be1fafe0a05d6dabaec8c156ddbd00581055bbaeac03904fb63310e80010680235d16bd4c040b50096a0c20dd1c4b0854529a1.apk";
|
||||
@@ -49,16 +48,17 @@ public class DownloadFragment extends AbsFragment<FragmentDownloadBinding>
|
||||
mStart.setOnClickListener(this);
|
||||
mCancel.setOnClickListener(this);
|
||||
|
||||
mEntity = Aria.download(this).getFirstDownloadEntity(DOWNLOAD_URL);
|
||||
if (mEntity != null) {
|
||||
getBinding().setFileSize(CommonUtil.formatFileSize(mEntity.getFileSize()));
|
||||
int state = mEntity.getState();
|
||||
getBinding().setProgress(mEntity.getPercent());
|
||||
if (mEntity.getState() == IEntity.STATE_RUNNING) {
|
||||
DownloadEntity entity = Aria.download(this).getFirstDownloadEntity(DOWNLOAD_URL);
|
||||
if (entity != null) {
|
||||
getBinding().setFileSize(CommonUtil.formatFileSize(entity.getFileSize()));
|
||||
int state = entity.getState();
|
||||
getBinding().setProgress(entity.getPercent());
|
||||
if (entity.getState() == IEntity.STATE_RUNNING) {
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
} else {
|
||||
getBinding().setStateStr(getString(R.string.resume));
|
||||
}
|
||||
mTaskId = entity.getId();
|
||||
} else {
|
||||
getBinding().setStateStr(getString(R.string.start));
|
||||
}
|
||||
@@ -68,27 +68,27 @@ public class DownloadFragment extends AbsFragment<FragmentDownloadBinding>
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.start:
|
||||
if (!AppUtil.chekEntityValid(mEntity)) {
|
||||
Aria.download(this)
|
||||
if (mTaskId == -1) {
|
||||
mTaskId = Aria.download(this)
|
||||
.load(DOWNLOAD_URL)
|
||||
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/王者军团.apk")
|
||||
.start();
|
||||
.create();
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
if (Aria.download(this).load(mEntity.getId()).isRunning()) {
|
||||
Aria.download(this).load(mEntity.getId()).stop();
|
||||
if (Aria.download(this).load(mTaskId).isRunning()) {
|
||||
Aria.download(this).load(mTaskId).stop();
|
||||
getBinding().setStateStr(getString(R.string.resume));
|
||||
} else {
|
||||
Aria.download(this).load(mEntity.getId()).resume();
|
||||
Aria.download(this).load(mTaskId).resume();
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.cancel:
|
||||
if (AppUtil.chekEntityValid(mEntity)) {
|
||||
Aria.download(this).load(mEntity.getId()).cancel();
|
||||
}
|
||||
Aria.download(this).load(mTaskId).cancel();
|
||||
getBinding().setStateStr(getString(R.string.start));
|
||||
mTaskId = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class DownloadGroupActivity extends BaseActivity<ActivityDownloadGroupBin
|
||||
})
|
||||
.setFileSize(114981416)
|
||||
//.updateUrls(temp)
|
||||
.start();
|
||||
.create();
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ public class DownloadGroupActivity extends BaseActivity<ActivityDownloadGroupBin
|
||||
|
||||
@DownloadGroup.onTaskStart() void taskStart(DownloadGroupTask task) {
|
||||
getBinding().setFileSize(task.getConvertFileSize());
|
||||
L.d(TAG, "group task start");
|
||||
L.d(TAG, "group task create");
|
||||
}
|
||||
|
||||
@DownloadGroup.onTaskRunning() protected void running(DownloadGroupTask task) {
|
||||
|
||||
@@ -80,7 +80,7 @@ public class FTPDirDownloadActivity extends BaseActivity<ActivityDownloadGroupBi
|
||||
.option()
|
||||
.login("8L8e", "8guD")
|
||||
.controller(ControllerType.START_CONTROLLER)
|
||||
.start();
|
||||
.create();
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ public class M3U8LiveDLoadActivity extends BaseActivity<ActivityM3u8LiveBinding>
|
||||
// return newUrls;
|
||||
// }
|
||||
//})
|
||||
.start();
|
||||
.create();
|
||||
}
|
||||
|
||||
@Override protected void dataCallback(int result, Object data) {
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.arialyy.aria.core.download.DownloadTask;
|
||||
import com.arialyy.aria.core.download.m3u8.IBandWidthUrlConverter;
|
||||
import com.arialyy.aria.core.download.m3u8.ITsMergeHandler;
|
||||
import com.arialyy.aria.core.download.m3u8.IVodTsUrlConverter;
|
||||
import com.arialyy.aria.core.download.m3u8.M3U8KeyInfo;
|
||||
import com.arialyy.aria.core.download.m3u8.M3U8Entity;
|
||||
import com.arialyy.aria.core.inf.IEntity;
|
||||
import com.arialyy.aria.util.ALog;
|
||||
import com.arialyy.aria.util.CommonUtil;
|
||||
@@ -169,7 +169,7 @@ public class M3U8VodDLoadActivity extends BaseActivity<ActivityM3u8VodBinding> {
|
||||
|
||||
@M3U8.onPeerStart
|
||||
void onPeerStart(String m3u8Url, String peerPath, int peerIndex) {
|
||||
//ALog.d(TAG, "peer start, path: " + peerPath + ", index: " + peerIndex);
|
||||
//ALog.d(TAG, "peer create, path: " + peerPath + ", index: " + peerIndex);
|
||||
}
|
||||
|
||||
@M3U8.onPeerComplete
|
||||
@@ -335,13 +335,14 @@ public class M3U8VodDLoadActivity extends BaseActivity<ActivityM3u8VodBinding> {
|
||||
}
|
||||
})
|
||||
.setMergeHandler(new ITsMergeHandler() {
|
||||
public boolean merge(@Nullable M3U8KeyInfo keyInfo, List<String> tsPath) {
|
||||
public boolean merge(@Nullable M3U8Entity m3U8Entity, List<String> tsPath) {
|
||||
ALog.d(TAG, "合并TS....");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.generateIndexFile()
|
||||
.controller(ControllerType.START_CONTROLLER)
|
||||
.start();
|
||||
.create();
|
||||
}
|
||||
|
||||
private Class<StartController> c = StartController.class;
|
||||
|
||||
@@ -41,7 +41,11 @@ public class VideoPlayerFragment extends BaseFragment<FragmentVideoPlayerBinding
|
||||
VideoPlayerFragment(int peerIndex, DownloadEntity entity) {
|
||||
mEntity = entity;
|
||||
mPeerIndex = peerIndex;
|
||||
List<M3U8Entity.PeerInfo> peerInfos = entity.getM3U8Entity().getCompletedPeer();
|
||||
M3U8Entity m3U8Entity = entity.getM3U8Entity();
|
||||
if (m3U8Entity == null) {
|
||||
return;
|
||||
}
|
||||
List<M3U8Entity.PeerInfo> peerInfos = m3U8Entity.getCompletedPeer();
|
||||
if (peerInfos != null) {
|
||||
for (M3U8Entity.PeerInfo info : peerInfos) {
|
||||
mPlayers.put(info.peerId, info.peerPath);
|
||||
@@ -72,7 +76,9 @@ public class VideoPlayerFragment extends BaseFragment<FragmentVideoPlayerBinding
|
||||
}
|
||||
}
|
||||
});
|
||||
getBinding().seekBar.setMax(mEntity.getM3U8Entity().getPeerNum());
|
||||
if (mEntity.getM3U8Entity() != null) {
|
||||
getBinding().seekBar.setMax(mEntity.getM3U8Entity().getPeerNum());
|
||||
}
|
||||
getBinding().seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
|
||||
@@ -141,8 +147,6 @@ public class VideoPlayerFragment extends BaseFragment<FragmentVideoPlayerBinding
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置下一个分片
|
||||
*/
|
||||
|
||||
@@ -294,16 +294,16 @@ public class DownloadAdapter extends AbsRVAdapter<AbsEntity, DownloadAdapter.Sim
|
||||
private void start(AbsEntity entity) {
|
||||
switch (entity.getTaskType()) {
|
||||
case AbsTaskWrapper.D_FTP:
|
||||
//Aria.download(getContext()).loadFtp((DownloadEntity) entity).login("lao", "123456").start();
|
||||
Aria.download(getContext()).loadFtp(entity.getKey()).start();
|
||||
//Aria.download(getContext()).loadFtp((DownloadEntity) entity).login("lao", "123456").create();
|
||||
Aria.download(getContext()).loadFtp(entity.getKey()).create();
|
||||
break;
|
||||
case AbsTaskWrapper.D_FTP_DIR:
|
||||
break;
|
||||
case AbsTaskWrapper.D_HTTP:
|
||||
Aria.download(getContext()).load(entity.getKey()).start();
|
||||
Aria.download(getContext()).load(entity.getKey()).create();
|
||||
break;
|
||||
case AbsTaskWrapper.DG_HTTP:
|
||||
Aria.download(getContext()).loadGroup(((DownloadGroupEntity) entity).getUrls()).start();
|
||||
Aria.download(getContext()).loadGroup(((DownloadGroupEntity) entity).getUrls()).create();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,12 +74,12 @@ final class FileListAdapter extends AbsRVAdapter<FileListEntity, FileListAdapter
|
||||
.setDirPath(item.downloadPath)
|
||||
.setGroupAlias(item.name)
|
||||
.unknownSize()
|
||||
.start();
|
||||
.create();
|
||||
} else {
|
||||
Aria.download(getContext())
|
||||
.load(item.key)
|
||||
.setFilePath(item.downloadPath)
|
||||
.start();
|
||||
.create();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -139,8 +139,10 @@ public class MultiDownloadActivity extends BaseActivity<ActivityMultiDownloadBin
|
||||
}
|
||||
|
||||
@DownloadGroup.onTaskFail void groupTaskFail(DownloadGroupTask task) {
|
||||
ALog.d(TAG, String.format("group【%s】fail", task.getTaskName()));
|
||||
mAdapter.updateState(task.getEntity());
|
||||
if (task != null) {
|
||||
ALog.d(TAG, String.format("group【%s】fail", task.getTaskName()));
|
||||
mAdapter.updateState(task.getEntity());
|
||||
}
|
||||
}
|
||||
|
||||
@DownloadGroup.onTaskComplete void groupTaskComplete(DownloadGroupTask task) {
|
||||
|
||||
@@ -49,7 +49,7 @@ public class DownloadService extends Service {
|
||||
Aria.download(this)
|
||||
.load(DOWNLOAD_URL)
|
||||
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/service_task.apk")
|
||||
.start();
|
||||
.create();
|
||||
}
|
||||
|
||||
@Override public void onDestroy() {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class AnyRunActivity extends BaseActivity<ActivityTestBinding> {
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.start:
|
||||
//module.start(URL);
|
||||
//module.create(URL);
|
||||
module.startFtp(URL);
|
||||
break;
|
||||
case R.id.stop:
|
||||
@@ -62,7 +62,7 @@ public class AnyRunActivity extends BaseActivity<ActivityTestBinding> {
|
||||
// .updateUrl(newUrl)
|
||||
// .login("lao", "123456")
|
||||
// .setFilePath(Environment.getExternalStorageDirectory().getPath() + "/")
|
||||
// .start();
|
||||
// .create();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class FtpUploadActivity extends BaseActivity<ActivityFtpUploadBinding> {
|
||||
.option()
|
||||
.login("8L8e", "8guD")
|
||||
.controller(ControllerType.START_CONTROLLER)
|
||||
.start();
|
||||
.create();
|
||||
getBinding().setStateStr(getString(R.string.stop));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class HttpUploadActivity extends BaseActivity<ActivityUploadBinding> {
|
||||
"http://lib-test.xzxyun.com:8042/Api/upload?data={\"type\":\"1\",\"fileType\":\".apk\"}")
|
||||
//.setTempUrl("http://192.168.1.6:8080/upload/sign_file/").setAttachment("file")
|
||||
//.addHeader("iplanetdirectorypro", "11a09102fb934ad0bc206f9c611d7933")
|
||||
.start();
|
||||
.create();
|
||||
}
|
||||
|
||||
void stop() {
|
||||
@@ -95,7 +95,7 @@ public class HttpUploadActivity extends BaseActivity<ActivityUploadBinding> {
|
||||
}
|
||||
|
||||
@Upload.onTaskStart public void taskStart(UploadTask task) {
|
||||
L.d(TAG, "upload start,md5:" + FileUtil.getFileMD5(new File(task.getEntity().getFilePath())));
|
||||
L.d(TAG, "upload create,md5:" + FileUtil.getFileMD5(new File(task.getEntity().getFilePath())));
|
||||
getBinding().setFileSize(task.getConvertFileSize());
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public class AnyRunnModule {
|
||||
.load(url)
|
||||
.setFilePath(path)
|
||||
.resetState()
|
||||
.start();
|
||||
.create();
|
||||
} else {
|
||||
Aria.download(this).load(mEntity.getId()).resume();
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public class AnyRunnModule {
|
||||
.setAlias("www.laoyuyu.me")
|
||||
.setStorePass("123456")
|
||||
.controller(ControllerType.START_CONTROLLER)
|
||||
.start();
|
||||
.create();
|
||||
} else {
|
||||
Aria.download(this).load(mEntity.getId()).resume();
|
||||
}
|
||||
|
||||
@@ -22,11 +22,12 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import androidx.core.content.FileProvider;
|
||||
import android.text.TextUtils;
|
||||
import androidx.core.content.FileProvider;
|
||||
import com.arialyy.aria.core.inf.AbsEntity;
|
||||
import com.arialyy.aria.util.ALog;
|
||||
import com.arialyy.aria.util.CommonUtil;
|
||||
import com.arialyy.aria.util.FileUtil;
|
||||
import com.arialyy.simple.BuildConfig;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -51,7 +52,7 @@ public class AppUtil {
|
||||
String path = String.format("%s/code/%s", context.getFilesDir().getPath(), fileName);
|
||||
File ftpCode = new File(path);
|
||||
if (!ftpCode.exists()) {
|
||||
CommonUtil.createFile(path);
|
||||
FileUtil.createFile(path);
|
||||
CommonUtil.createFileFormInputStream(context.getAssets()
|
||||
.open(String.format("help_code/%s", fileName)),
|
||||
path);
|
||||
|
||||
@@ -106,16 +106,13 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="group_urls">
|
||||
<!--<item>https://res5.d.cn/5a6a3384c1b2be1a65d84b914e6a6fef697637578b6db2eb1056d50b09cf1dcf289d4045df7ef95746e498e3d6a848ab84c89b77aa60194e2c48e5a7cb748265.apk</item>-->
|
||||
<!--<item>https://res5.d.cn/5a6a3384c1b2be1a52034c72752e8475414630ebc69318b84ef584115ebf5eaaab945ae07b7fe3596afc72a7940ff328d4a9553f6ae92d6c09ba4bfb533137f6.apk</item>-->
|
||||
<!--<item>https://res5.d.cn/5a6a3384c1b2be1a426f06bfc69034d69c44ae1a01da180cab8e59bd1a5e1a784bac46ba0c64579d14f0e80a4ce4f068af89b0369a393456f4f449a8829cad5c.apk</item>-->
|
||||
<item>http://static.gaoshouyou.com/d/12/0d/7f120f50c80d2e7b8c4ba24ece4f9cdd.apk</item>
|
||||
<!--<item>http://static.ilongyuan.cn/rayark/RayarkFZ_2.0.7.apk</item>-->
|
||||
<item>https://downs.muzhiwan.com/2019/06/19/com.and.games505.TerrariaPaid5d0a074e451c0.gpk</item>
|
||||
<item>https://downs.muzhiwan.com/2017/03/28/com.xyzstudio_58da07426e959.apk</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="group_urls_1">
|
||||
<item>http://hzdown.muzhiwan.com/2017/05/08/nl.noio.kingdom_59104935e56f0.apk</item>
|
||||
<item>https://atom-installer.github.com/v1.13.0/AtomSetup.exe1</item>
|
||||
<!--<item>https://atom-installer.github.com/v1.13.0/AtomSetup.exe1</item>-->
|
||||
<item>http://hzdown.muzhiwan.com/2017/09/05/com.mir.iphone.empire83jie.mzw_59ae6d5a3638d.apk</item>
|
||||
</string-array>
|
||||
|
||||
@@ -125,8 +122,8 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="group_urls_3">
|
||||
<item>http://apk500.bce.baidu-mgame.com/game/883000/883227/20170828102306_oem_5502845.apk?r=1</item>
|
||||
<item>http://static.gaoshouyou.com/d/92/12/5592a647b8126755647abbe8074fde39.apk</item>
|
||||
<item>https://downs.muzhiwan.com/2019/07/23/com.amazid.me_5d36bade614d9.apk</item>
|
||||
<item>https://downs.muzhiwan.com/2019/07/30/com.counter.terrorist.attack.fps.sniper.fight_5d3fe8f0a7edf.apk</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="group_url4">
|
||||
@@ -135,8 +132,8 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="group_names">
|
||||
<item>王者荣耀.apk</item>
|
||||
<item>战斗吧剑灵.apk</item>
|
||||
<item>泰拉瑞亚.apk</item>
|
||||
<item>疯狂屁股.apk</item>
|
||||
<!--<item>天魔幻想.apk</item>-->
|
||||
</string-array>
|
||||
|
||||
@@ -151,8 +148,8 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="group_names_3">
|
||||
<item>部落冲突.apk</item>
|
||||
<item>城堡争霸.apk</item>
|
||||
<item>神奇的绳索英雄.apk</item>
|
||||
<item>自由火力反击.apk</item>
|
||||
</string-array>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user