├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── themes.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ ├── xml │ │ │ │ ├── file_paths.xml │ │ │ │ ├── backup_rules.xml │ │ │ │ └── data_extraction_rules.xml │ │ │ ├── values-night │ │ │ │ └── themes.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ ├── fragment_main.xml │ │ │ │ └── item_file.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ └── drawable │ │ │ │ └── ic_launcher_background.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── khush │ │ │ │ └── sample │ │ │ │ ├── MainApplication.kt │ │ │ │ ├── Util.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ └── MainFragment.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── khush │ │ │ └── sample │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── khush │ │ └── sample │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── ketch ├── .gitignore ├── consumer-rules.pro ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── ketch │ │ │ │ ├── internal │ │ │ │ ├── utils │ │ │ │ │ ├── UserAction.kt │ │ │ │ │ ├── ExceptionConst.kt │ │ │ │ │ ├── DownloadLogger.kt │ │ │ │ │ ├── MapperUtil.kt │ │ │ │ │ ├── DownloadConst.kt │ │ │ │ │ ├── WorkUtil.kt │ │ │ │ │ ├── NotificationConst.kt │ │ │ │ │ ├── TextUtil.kt │ │ │ │ │ └── FileUtil.kt │ │ │ │ ├── database │ │ │ │ │ ├── DownloadDatabase.kt │ │ │ │ │ ├── DatabaseInstance.kt │ │ │ │ │ ├── DownloadEntity.kt │ │ │ │ │ └── DownloadDao.kt │ │ │ │ ├── download │ │ │ │ │ ├── DownloadRequest.kt │ │ │ │ │ ├── ApiResponseHeaderChecker.kt │ │ │ │ │ ├── DownloadTask.kt │ │ │ │ │ └── DownloadManager.kt │ │ │ │ ├── network │ │ │ │ │ ├── DownloadService.kt │ │ │ │ │ └── RetrofitInstance.kt │ │ │ │ ├── worker │ │ │ │ │ └── DownloadWorker.kt │ │ │ │ └── notification │ │ │ │ │ ├── NotificationReceiver.kt │ │ │ │ │ └── DownloadNotificationManager.kt │ │ │ │ ├── Status.kt │ │ │ │ ├── DownloadConfig.kt │ │ │ │ ├── Logger.kt │ │ │ │ ├── NotificationConfig.kt │ │ │ │ ├── DownloadModel.kt │ │ │ │ └── Ketch.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── ketch │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── ketch │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── assets ├── Ketch_hld.png ├── Ketch_logo.png ├── Sample_app.png └── Sample_notification.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── gradle.properties ├── gradlew.bat ├── gradlew └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /ketch/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /ketch/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/Ketch_hld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/assets/Ketch_hld.png -------------------------------------------------------------------------------- /assets/Ketch_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/assets/Ketch_logo.png -------------------------------------------------------------------------------- /assets/Sample_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/assets/Sample_app.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Ketch 3 | -------------------------------------------------------------------------------- /assets/Sample_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/assets/Sample_notification.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khushpanchal/Ketch/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FF000000 4 | #FFFFFFFF 5 | -------------------------------------------------------------------------------- /app/src/main/res/xml/file_paths.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ketch/src/main/java/com/ketch/internal/utils/UserAction.kt: -------------------------------------------------------------------------------- 1 | package com.ketch.internal.utils 2 | 3 | internal enum class UserAction { 4 | PAUSE, 5 | RESUME, 6 | CANCEL, 7 | RETRY, 8 | START, 9 | DEFAULT 10 | } 11 | -------------------------------------------------------------------------------- /ketch/src/main/java/com/ketch/internal/utils/ExceptionConst.kt: -------------------------------------------------------------------------------- 1 | package com.ketch.internal.utils 2 | 3 | internal object ExceptionConst { 4 | const val KEY_EXCEPTION = "key_exception" 5 | const val EXCEPTION_FAILED_DESERIALIZE = "WorkInputData failed to deserialize" 6 | } 7 | -------------------------------------------------------------------------------- /ketch/src/main/java/com/ketch/Status.kt: -------------------------------------------------------------------------------- 1 | package com.ketch 2 | 3 | enum class Status { 4 | 5 | QUEUED, 6 | 7 | STARTED, 8 | 9 | PROGRESS, 10 | 11 | SUCCESS, 12 | 13 | CANCELLED, 14 | 15 | FAILED, 16 | 17 | PAUSED, 18 | 19 | DEFAULT 20 | } 21 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat May 04 16:01:34 IST 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | /.idea 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .cxx 16 | local.properties 17 | -------------------------------------------------------------------------------- /ketch/src/main/java/com/ketch/internal/database/DownloadDatabase.kt: -------------------------------------------------------------------------------- 1 | package com.ketch.internal.database 2 | 3 | import androidx.room.Database 4 | import androidx.room.RoomDatabase 5 | 6 | @Database(entities = [DownloadEntity::class], version = 1) 7 | internal abstract class DownloadDatabase : RoomDatabase() { 8 | abstract fun downloadDao(): DownloadDao 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /ketch/src/main/java/com/ketch/DownloadConfig.kt: -------------------------------------------------------------------------------- 1 | package com.ketch 2 | 3 | import com.ketch.internal.utils.DownloadConst 4 | import kotlinx.serialization.Serializable 5 | 6 | @Serializable 7 | data class DownloadConfig( 8 | val connectTimeOutInMs: Long = DownloadConst.DEFAULT_VALUE_CONNECT_TIMEOUT_MS, 9 | val readTimeOutInMs: Long = DownloadConst.DEFAULT_VALUE_READ_TIMEOUT_MS 10 | ) 11 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | 16 | rootProject.name = "Ketch" 17 | include ':app' 18 | include ':ketch' 19 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 |