diff --git a/app/build.gradle b/app/build.gradle index f5c1ccd..d97043c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -27,6 +27,6 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' // - api 'com.zhy:okhttputils:2.6.2' - api 'com.squareup.okhttp3:okhttp:3.2.0' + implementation project(':jdm3u8downloader') + } diff --git a/app/src/main/java/com/onedream/m3u8downloader/MainActivity.java b/app/src/main/java/com/onedream/m3u8downloader/MainActivity.java index 101f61a..8248cb7 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/MainActivity.java +++ b/app/src/main/java/com/onedream/m3u8downloader/MainActivity.java @@ -5,13 +5,14 @@ import androidx.appcompat.app.AppCompatActivity; -import com.onedream.m3u8downloader.bean.JDDownloadMessage; -import com.onedream.m3u8downloader.bean.JDDownloadProgress; -import com.onedream.m3u8downloader.bean.JDDownloadQueue; -import com.onedream.m3u8downloader.common.JDDownloadQueueState; -import com.onedream.m3u8downloader.listener.JDM3U8DownloaderContract; -import com.onedream.m3u8downloader.utils.JDM3U8FileCacheUtils; -import com.onedream.m3u8downloader.utils.JDM3U8LogHelper; +import com.onedream.jdm3u8downloader.JDM3U8Downloader; +import com.onedream.jdm3u8downloader.bean.JDDownloadMessage; +import com.onedream.jdm3u8downloader.bean.JDDownloadProgress; +import com.onedream.jdm3u8downloader.bean.JDDownloadQueue; +import com.onedream.jdm3u8downloader.common.JDDownloadQueueState; +import com.onedream.jdm3u8downloader.listener.JDM3U8DownloaderContract; +import com.onedream.jdm3u8downloader.utils.JDM3U8FileCacheUtils; +import com.onedream.jdm3u8downloader.utils.JDM3U8LogHelper; import java.io.File; @@ -22,6 +23,20 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // + initView(); + initData(); + initEvent(); + } + + private void initView() { + + } + + private void initData() { + + } + + private void initEvent() { findViewById(R.id.btn).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -34,11 +49,12 @@ public void onClick(View v) { private void startDownloadM3U8() { JDDownloadQueue downloadQueue = new JDDownloadQueue(); downloadQueue.setMovie_id(10); + downloadQueue.setSingleRate(false); downloadQueue.setMovie_download_url("http://yi.jingdianzuida.com/20190905/yM4FKbnk/index.m3u8"); downloadQueue.setMovie_title("摩羯阿婆"); downloadQueue.setMovie_num_index(1); downloadQueue.setMovie_num_title("第一集"); - downloadQueue.setState(JDDownloadQueueState.STATE_DOWNLOAD_QUEUE); + downloadQueue.setState(JDDownloadQueueState.STATE_DOWNLOAD_QUEUE);//这个比较终于要 String PATH_MOVIE = JDM3U8FileCacheUtils.createRootDownloadPath(MainActivity.this) + File.separator + "download" + File.separator + "movie" + File.separator; diff --git a/jdm3u8downloader/.gitignore b/jdm3u8downloader/.gitignore new file mode 100644 index 0000000..796b96d --- /dev/null +++ b/jdm3u8downloader/.gitignore @@ -0,0 +1 @@ +/build diff --git a/jdm3u8downloader/build.gradle b/jdm3u8downloader/build.gradle new file mode 100644 index 0000000..0eb3db3 --- /dev/null +++ b/jdm3u8downloader/build.gradle @@ -0,0 +1,37 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.3" + + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 29 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles 'consumer-rules.pro' + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'androidx.appcompat:appcompat:1.0.2' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.0' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' + // + api 'com.zhy:okhttputils:2.6.2' + api 'com.squareup.okhttp3:okhttp:3.2.0' +} diff --git a/jdm3u8downloader/consumer-rules.pro b/jdm3u8downloader/consumer-rules.pro new file mode 100644 index 0000000..e69de29 diff --git a/jdm3u8downloader/proguard-rules.pro b/jdm3u8downloader/proguard-rules.pro new file mode 100644 index 0000000..f1b4245 --- /dev/null +++ b/jdm3u8downloader/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/jdm3u8downloader/src/androidTest/java/com/onedream/jdm3u8downloader/ExampleInstrumentedTest.java b/jdm3u8downloader/src/androidTest/java/com/onedream/jdm3u8downloader/ExampleInstrumentedTest.java new file mode 100644 index 0000000..bb42ddb --- /dev/null +++ b/jdm3u8downloader/src/androidTest/java/com/onedream/jdm3u8downloader/ExampleInstrumentedTest.java @@ -0,0 +1,27 @@ +package com.onedream.jdm3u8downloader; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + + assertEquals("com.onedream.jdm3u8downloader.test", appContext.getPackageName()); + } +} diff --git a/jdm3u8downloader/src/main/AndroidManifest.xml b/jdm3u8downloader/src/main/AndroidManifest.xml new file mode 100644 index 0000000..5a1e9a1 --- /dev/null +++ b/jdm3u8downloader/src/main/AndroidManifest.xml @@ -0,0 +1,2 @@ + diff --git a/app/src/main/java/com/onedream/m3u8downloader/JDM3U8Downloader.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/JDM3U8Downloader.java similarity index 91% rename from app/src/main/java/com/onedream/m3u8downloader/JDM3U8Downloader.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/JDM3U8Downloader.java index 892c959..4d55311 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/JDM3U8Downloader.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/JDM3U8Downloader.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader; +package com.onedream.jdm3u8downloader; import android.os.AsyncTask; import android.os.ConditionVariable; @@ -6,19 +6,19 @@ import androidx.annotation.NonNull; -import com.onedream.m3u8downloader.base.JDM3U8BaseDownloader; -import com.onedream.m3u8downloader.bean.JDDownloadMessage; -import com.onedream.m3u8downloader.bean.JDDownloadProgress; -import com.onedream.m3u8downloader.bean.JDDownloadQueue; -import com.onedream.m3u8downloader.bean.JDM3U8SingleRateUrlBean; -import com.onedream.m3u8downloader.bean.JDM3U8TsBean; -import com.onedream.m3u8downloader.common.JDDownloadQueueState; -import com.onedream.m3u8downloader.common.JDM3U8DownloadHintMessage; -import com.onedream.m3u8downloader.common.JDM3U8TsDownloadState; -import com.onedream.m3u8downloader.listener.JDM3U8DownloaderContract; -import com.onedream.m3u8downloader.listener.JDM3U8DownloaderFileCallBack; -import com.onedream.m3u8downloader.utils.JDM3U8FileCacheUtils; -import com.onedream.m3u8downloader.utils.JDM3U8LogHelper; +import com.onedream.jdm3u8downloader.base.JDM3U8BaseDownloader; +import com.onedream.jdm3u8downloader.bean.JDDownloadMessage; +import com.onedream.jdm3u8downloader.bean.JDDownloadProgress; +import com.onedream.jdm3u8downloader.bean.JDDownloadQueue; +import com.onedream.jdm3u8downloader.bean.JDM3U8SingleRateUrlBean; +import com.onedream.jdm3u8downloader.bean.JDM3U8TsBean; +import com.onedream.jdm3u8downloader.common.JDDownloadQueueState; +import com.onedream.jdm3u8downloader.common.JDM3U8DownloadHintMessage; +import com.onedream.jdm3u8downloader.common.JDM3U8TsDownloadState; +import com.onedream.jdm3u8downloader.listener.JDM3U8DownloaderContract; +import com.onedream.jdm3u8downloader.listener.JDM3U8DownloaderFileCallBack; +import com.onedream.jdm3u8downloader.utils.JDM3U8FileCacheUtils; +import com.onedream.jdm3u8downloader.utils.JDM3U8LogHelper; import com.zhy.http.okhttp.OkHttpUtils; import com.zhy.http.okhttp.callback.StringCallback; @@ -283,6 +283,11 @@ public void pauseDownload() { } public void startDownload() { - super.startDownloadMultiRateM3U8(downloadQueue.getMovie_download_url()); + if (downloadQueue.isSingleRate()) { + super.startDownloadSingleRateM3U8(downloadQueue.getMovie_download_url()); + } else { + super.startDownloadMultiRateM3U8(downloadQueue.getMovie_download_url()); + } + } } diff --git a/app/src/main/java/com/onedream/m3u8downloader/JDM3U8TsFileDownloadTask.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/JDM3U8TsFileDownloadTask.java similarity index 88% rename from app/src/main/java/com/onedream/m3u8downloader/JDM3U8TsFileDownloadTask.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/JDM3U8TsFileDownloadTask.java index 0312bb0..d1264cd 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/JDM3U8TsFileDownloadTask.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/JDM3U8TsFileDownloadTask.java @@ -1,12 +1,12 @@ -package com.onedream.m3u8downloader; +package com.onedream.jdm3u8downloader; import android.os.AsyncTask; -import com.onedream.m3u8downloader.base.JDM3U8BaseDownloader; -import com.onedream.m3u8downloader.bean.JDM3U8SingleRateUrlBean; -import com.onedream.m3u8downloader.bean.JDM3U8TsBean; -import com.onedream.m3u8downloader.common.JDM3U8TsDownloadState; -import com.onedream.m3u8downloader.utils.JDM3U8LogHelper; +import com.onedream.jdm3u8downloader.base.JDM3U8BaseDownloader; +import com.onedream.jdm3u8downloader.bean.JDM3U8SingleRateUrlBean; +import com.onedream.jdm3u8downloader.bean.JDM3U8TsBean; +import com.onedream.jdm3u8downloader.common.JDM3U8TsDownloadState; +import com.onedream.jdm3u8downloader.utils.JDM3U8LogHelper; import java.util.List; diff --git a/app/src/main/java/com/onedream/m3u8downloader/base/JDM3U8BaseDownloader.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/base/JDM3U8BaseDownloader.java similarity index 93% rename from app/src/main/java/com/onedream/m3u8downloader/base/JDM3U8BaseDownloader.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/base/JDM3U8BaseDownloader.java index b726ca4..d77bca2 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/base/JDM3U8BaseDownloader.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/base/JDM3U8BaseDownloader.java @@ -1,16 +1,16 @@ -package com.onedream.m3u8downloader.base; +package com.onedream.jdm3u8downloader.base; import android.text.TextUtils; import androidx.annotation.NonNull; -import com.onedream.m3u8downloader.common.JDM3U8DownloadHintMessage; -import com.onedream.m3u8downloader.bean.JDM3U8SingleRateUrlBean; -import com.onedream.m3u8downloader.bean.JDM3U8TsBean; -import com.onedream.m3u8downloader.listener.JDM3U8DownloaderContract; -import com.onedream.m3u8downloader.utils.JDM3U8AnalysisUtils; -import com.onedream.m3u8downloader.utils.JDM3U8FileCacheUtils; +import com.onedream.jdm3u8downloader.common.JDM3U8DownloadHintMessage; +import com.onedream.jdm3u8downloader.bean.JDM3U8SingleRateUrlBean; +import com.onedream.jdm3u8downloader.bean.JDM3U8TsBean; +import com.onedream.jdm3u8downloader.listener.JDM3U8DownloaderContract; +import com.onedream.jdm3u8downloader.utils.JDM3U8AnalysisUtils; +import com.onedream.jdm3u8downloader.utils.JDM3U8FileCacheUtils; import java.io.File; import java.util.List; diff --git a/app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadMessage.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadMessage.java similarity index 93% rename from app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadMessage.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadMessage.java index 54b5bd3..5c375af 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadMessage.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadMessage.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.bean; +package com.onedream.jdm3u8downloader.bean; /** * @author jdallen diff --git a/app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadProgress.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadProgress.java similarity index 95% rename from app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadProgress.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadProgress.java index 720fc8e..9ede202 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadProgress.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadProgress.java @@ -1,6 +1,6 @@ -package com.onedream.m3u8downloader.bean; +package com.onedream.jdm3u8downloader.bean; -import com.onedream.m3u8downloader.common.JDDownloadQueueState; +import com.onedream.jdm3u8downloader.common.JDDownloadQueueState; /** * @author jdallen diff --git a/app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadQueue.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadQueue.java similarity index 88% rename from app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadQueue.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadQueue.java index 5d7b19d..26857b8 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/bean/JDDownloadQueue.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDDownloadQueue.java @@ -1,13 +1,15 @@ -package com.onedream.m3u8downloader.bean; +package com.onedream.jdm3u8downloader.bean; -import com.onedream.m3u8downloader.common.JDDownloadQueueState; +import com.onedream.jdm3u8downloader.common.JDDownloadQueueState; /** - * 下载队列实体 + * 下载队列实体 + * * @author jdallen * @since 2020/4/3 */ public class JDDownloadQueue { + private boolean isSingleRate = true;//默认为但码率的 private long movie_id; private int movie_num_index; private String movie_title; @@ -36,6 +38,14 @@ public JDDownloadQueue(long movie_id, int movie_num_index, String movie_title, S this.state = state; } + public boolean isSingleRate() { + return isSingleRate; + } + + public void setSingleRate(boolean singleRate) { + isSingleRate = singleRate; + } + public long getMovie_id() { return movie_id; } diff --git a/app/src/main/java/com/onedream/m3u8downloader/bean/JDM3U8SingleRateUrlBean.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDM3U8SingleRateUrlBean.java similarity index 90% rename from app/src/main/java/com/onedream/m3u8downloader/bean/JDM3U8SingleRateUrlBean.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDM3U8SingleRateUrlBean.java index 689701b..4be373a 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/bean/JDM3U8SingleRateUrlBean.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDM3U8SingleRateUrlBean.java @@ -1,11 +1,11 @@ -package com.onedream.m3u8downloader.bean; +package com.onedream.jdm3u8downloader.bean; import android.text.TextUtils; -import com.onedream.m3u8downloader.utils.JDM3U8FileCacheUtils; -import com.onedream.m3u8downloader.utils.JDM3U8AnalysisUtils; -import com.onedream.m3u8downloader.utils.JDM3U8LogHelper; +import com.onedream.jdm3u8downloader.utils.JDM3U8FileCacheUtils; +import com.onedream.jdm3u8downloader.utils.JDM3U8AnalysisUtils; +import com.onedream.jdm3u8downloader.utils.JDM3U8LogHelper; import java.io.File; import java.util.List; diff --git a/app/src/main/java/com/onedream/m3u8downloader/bean/JDM3U8TsBean.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDM3U8TsBean.java similarity index 91% rename from app/src/main/java/com/onedream/m3u8downloader/bean/JDM3U8TsBean.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDM3U8TsBean.java index f61971c..42d19d3 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/bean/JDM3U8TsBean.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/bean/JDM3U8TsBean.java @@ -1,8 +1,8 @@ -package com.onedream.m3u8downloader.bean; +package com.onedream.jdm3u8downloader.bean; -import com.onedream.m3u8downloader.utils.JDM3U8AnalysisUtils; -import com.onedream.m3u8downloader.utils.JDM3U8LogHelper; +import com.onedream.jdm3u8downloader.utils.JDM3U8AnalysisUtils; +import com.onedream.jdm3u8downloader.utils.JDM3U8LogHelper; /** * @author jdallen diff --git a/app/src/main/java/com/onedream/m3u8downloader/common/JDDownloadQueueState.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDDownloadQueueState.java similarity index 95% rename from app/src/main/java/com/onedream/m3u8downloader/common/JDDownloadQueueState.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDDownloadQueueState.java index 8a4f75e..10a1bc4 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/common/JDDownloadQueueState.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDDownloadQueueState.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.common; +package com.onedream.jdm3u8downloader.common; /** * @author jdallen diff --git a/app/src/main/java/com/onedream/m3u8downloader/common/JDM3U8DownloadHintMessage.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDM3U8DownloadHintMessage.java similarity index 94% rename from app/src/main/java/com/onedream/m3u8downloader/common/JDM3U8DownloadHintMessage.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDM3U8DownloadHintMessage.java index 15bf64c..4734a13 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/common/JDM3U8DownloadHintMessage.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDM3U8DownloadHintMessage.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.common; +package com.onedream.jdm3u8downloader.common; /** * @author jdallen diff --git a/app/src/main/java/com/onedream/m3u8downloader/common/JDM3U8TsDownloadState.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDM3U8TsDownloadState.java similarity index 92% rename from app/src/main/java/com/onedream/m3u8downloader/common/JDM3U8TsDownloadState.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDM3U8TsDownloadState.java index e6bab9c..02eff90 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/common/JDM3U8TsDownloadState.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/common/JDM3U8TsDownloadState.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.common; +package com.onedream.jdm3u8downloader.common; import androidx.annotation.IntDef; diff --git a/app/src/main/java/com/onedream/m3u8downloader/listener/JDM3U8DownloaderContract.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/listener/JDM3U8DownloaderContract.java similarity index 78% rename from app/src/main/java/com/onedream/m3u8downloader/listener/JDM3U8DownloaderContract.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/listener/JDM3U8DownloaderContract.java index 6c0fdc2..0f752b6 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/listener/JDM3U8DownloaderContract.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/listener/JDM3U8DownloaderContract.java @@ -1,9 +1,9 @@ -package com.onedream.m3u8downloader.listener; +package com.onedream.jdm3u8downloader.listener; -import com.onedream.m3u8downloader.bean.JDDownloadMessage; -import com.onedream.m3u8downloader.bean.JDDownloadProgress; -import com.onedream.m3u8downloader.bean.JDDownloadQueue; +import com.onedream.jdm3u8downloader.bean.JDDownloadMessage; +import com.onedream.jdm3u8downloader.bean.JDDownloadProgress; +import com.onedream.jdm3u8downloader.bean.JDDownloadQueue; import java.util.List; diff --git a/app/src/main/java/com/onedream/m3u8downloader/listener/JDM3U8DownloaderFileCallBack.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/listener/JDM3U8DownloaderFileCallBack.java similarity index 93% rename from app/src/main/java/com/onedream/m3u8downloader/listener/JDM3U8DownloaderFileCallBack.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/listener/JDM3U8DownloaderFileCallBack.java index 8f8e5b9..53bde91 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/listener/JDM3U8DownloaderFileCallBack.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/listener/JDM3U8DownloaderFileCallBack.java @@ -1,7 +1,7 @@ -package com.onedream.m3u8downloader.listener; +package com.onedream.jdm3u8downloader.listener; -import com.onedream.m3u8downloader.utils.JDM3U8CloseUtils; +import com.onedream.jdm3u8downloader.utils.JDM3U8CloseUtils; import com.zhy.http.okhttp.OkHttpUtils; import com.zhy.http.okhttp.callback.Callback; diff --git a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8AnalysisUtils.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8AnalysisUtils.java similarity index 98% rename from app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8AnalysisUtils.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8AnalysisUtils.java index 07410b1..8a2305e 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8AnalysisUtils.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8AnalysisUtils.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.utils; +package com.onedream.jdm3u8downloader.utils; import android.text.TextUtils; diff --git a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8CloseUtils.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8CloseUtils.java similarity index 88% rename from app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8CloseUtils.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8CloseUtils.java index 0042c85..87c50de 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8CloseUtils.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8CloseUtils.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.utils; +package com.onedream.jdm3u8downloader.utils; import java.io.Closeable; diff --git a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8FileCacheUtils.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8FileCacheUtils.java similarity index 99% rename from app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8FileCacheUtils.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8FileCacheUtils.java index fe7fc29..960d5d4 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8FileCacheUtils.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8FileCacheUtils.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.utils; +package com.onedream.jdm3u8downloader.utils; import android.content.Context; import android.os.Environment; diff --git a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8LogHelper.java b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8LogHelper.java similarity index 87% rename from app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8LogHelper.java rename to jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8LogHelper.java index 4ea3011..f8f8b14 100644 --- a/app/src/main/java/com/onedream/m3u8downloader/utils/JDM3U8LogHelper.java +++ b/jdm3u8downloader/src/main/java/com/onedream/jdm3u8downloader/utils/JDM3U8LogHelper.java @@ -1,4 +1,4 @@ -package com.onedream.m3u8downloader.utils; +package com.onedream.jdm3u8downloader.utils; import android.util.Log; diff --git a/jdm3u8downloader/src/main/res/values/strings.xml b/jdm3u8downloader/src/main/res/values/strings.xml new file mode 100644 index 0000000..27db020 --- /dev/null +++ b/jdm3u8downloader/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + JDM3U8downloader + diff --git a/jdm3u8downloader/src/test/java/com/onedream/jdm3u8downloader/ExampleUnitTest.java b/jdm3u8downloader/src/test/java/com/onedream/jdm3u8downloader/ExampleUnitTest.java new file mode 100644 index 0000000..d82de15 --- /dev/null +++ b/jdm3u8downloader/src/test/java/com/onedream/jdm3u8downloader/ExampleUnitTest.java @@ -0,0 +1,17 @@ +package com.onedream.jdm3u8downloader; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * Example local unit test, which will execute on the development machine (host). + * + * @see Testing documentation + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() { + assertEquals(4, 2 + 2); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index e0efffd..18968c3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ -include ':app' +include ':app', ':jdm3u8downloader' rootProject.name='M3U8Downloader'