diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index 87fea133d..26aac19fa 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -156,9 +156,6 @@ dependencies {
//HTTP Clients
implementation("com.squareup.okhttp3:okhttp:4.12.0")
- //Fetch - Downloader
- implementation("androidx.tonyodev.fetch2:xfetch2:3.1.6")
-
//EventBus
implementation("org.greenrobot:eventbus:3.3.1")
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b09d0debf..a648d4eac 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -97,11 +97,6 @@
android:exported="false"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
-
-
-
-
-
-
-
-
diff --git a/app/src/main/java/com/aurora/store/AuroraApplication.kt b/app/src/main/java/com/aurora/store/AuroraApplication.kt
index f6dfdf591..96ca17199 100644
--- a/app/src/main/java/com/aurora/store/AuroraApplication.kt
+++ b/app/src/main/java/com/aurora/store/AuroraApplication.kt
@@ -25,14 +25,11 @@ import androidx.core.content.ContextCompat
import androidx.hilt.work.HiltWorkerFactory
import androidx.work.Configuration
import com.aurora.extensions.isPAndAbove
-import com.aurora.store.data.downloader.DownloadManager
import com.aurora.store.data.receiver.PackageManagerReceiver
-import com.aurora.store.data.service.NotificationService
import com.aurora.store.util.CommonUtil
import com.aurora.store.util.DownloadWorkerUtil
import com.aurora.store.util.NotificationUtil
import com.aurora.store.util.PackageUtil
-import com.tonyodev.fetch2.Fetch
import dagger.hilt.android.HiltAndroidApp
import javax.inject.Inject
import org.lsposed.hiddenapibypass.HiddenApiBypass
@@ -52,8 +49,6 @@ class AuroraApplication : Application(), Configuration.Provider {
.setWorkerFactory(workerFactory)
.build()
- private lateinit var fetch: Fetch
-
companion object {
val enqueuedInstalls: MutableSet = mutableSetOf()
}
@@ -69,9 +64,6 @@ class AuroraApplication : Application(), Configuration.Provider {
//Create Notification Channels : General & Alert
NotificationUtil.createNotificationChannel(this)
- NotificationService.startService(this)
-
- fetch = DownloadManager.with(this).fetch
// Initialize DownloadWorker to observe and trigger downloads
downloadWorkerUtil.init()
diff --git a/app/src/main/java/com/aurora/store/data/downloader/DownloadManager.kt b/app/src/main/java/com/aurora/store/data/downloader/DownloadManager.kt
deleted file mode 100644
index bfb43b443..000000000
--- a/app/src/main/java/com/aurora/store/data/downloader/DownloadManager.kt
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Aurora Store
- * Copyright (C) 2021, Rahul Kumar Patel
- *
- * Aurora Store is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * Aurora Store is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Aurora Store. If not, see .
- *
- */
-
-package com.aurora.store.data.downloader
-
-import android.content.Context
-import com.aurora.store.data.SingletonHolder
-import com.aurora.store.util.Preferences
-import com.tonyodev.fetch2.BuildConfig
-import com.tonyodev.fetch2.Download
-import com.tonyodev.fetch2.Fetch
-import com.tonyodev.fetch2.FetchConfiguration
-import com.tonyodev.fetch2.FetchGroup
-import com.tonyodev.fetch2.FetchListener
-import com.tonyodev.fetch2core.DefaultStorageResolver
-import com.tonyodev.fetch2core.getFileTempDir
-
-class DownloadManager private constructor(var context: Context) {
-
- companion object : SingletonHolder(::DownloadManager)
-
- var fetch: Fetch
-
- init {
- fetch = Fetch.getInstance(getFetchConfiguration(context))
- }
-
- fun getFetchInstance(): Fetch {
- return fetch
- }
-
- private fun getFetchConfiguration(context: Context): FetchConfiguration {
- return FetchConfiguration.Builder(context)
- .enableLogging(BuildConfig.DEBUG)
- .enableHashCheck(true)
- .enableFileExistChecks(true)
- .enableRetryOnNetworkGain(true)
- .enableAutoStart(true)
- .setAutoRetryMaxAttempts(3)
- .setProgressReportingInterval(3000)
- .setNamespace(BuildConfig.APPLICATION_ID)
- .setStorageResolver(DefaultStorageResolver(context, getFileTempDir(context)))
- .build()
- }
-
- fun isDownloading(fetchGroup: FetchGroup): Boolean {
- return fetchGroup.downloadingDownloads.isNotEmpty()
- || fetchGroup.queuedDownloads.isNotEmpty()
- || fetchGroup.addedDownloads.isNotEmpty()
- }
-
- fun isCanceled(fetchGroup: FetchGroup): Boolean {
- return fetchGroup.cancelledDownloads.isNotEmpty()
- || fetchGroup.removedDownloads.isNotEmpty()
- || fetchGroup.deletedDownloads.isNotEmpty()
- }
-
- fun updateOngoingDownloads(
- fetch: Fetch, packageList: MutableList, download: Download,
- fetchListener: FetchListener?
- ) {
- if (packageList.contains(download.tag)) {
- val packageName = download.tag
- if (packageName != null) {
- val groupIDsOfPackageName = RequestGroupIdBuilder.getGroupIDsForApp(context, packageName.hashCode())
- groupIDsOfPackageName.forEach {
- fetch.deleteGroup(it)
- }
- packageList.remove(packageName)
- }
- }
- if (packageList.size == 0) {
- fetch.removeListener(fetchListener!!)
- }
- }
-}
diff --git a/app/src/main/java/com/aurora/store/data/downloader/RequestBuilder.kt b/app/src/main/java/com/aurora/store/data/downloader/RequestBuilder.kt
deleted file mode 100644
index adba57b56..000000000
--- a/app/src/main/java/com/aurora/store/data/downloader/RequestBuilder.kt
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Aurora Store
- * Copyright (C) 2021, Rahul Kumar Patel
- *
- * Aurora Store is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * Aurora Store is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Aurora Store. If not, see .
- *
- */
-
-package com.aurora.store.data.downloader
-
-import android.content.Context
-import com.aurora.Constants
-import com.aurora.gplayapi.data.models.App
-import com.aurora.gplayapi.data.models.File
-import com.aurora.store.util.PathUtil
-import com.aurora.store.util.Preferences
-import com.google.gson.GsonBuilder
-import com.tonyodev.fetch2.EnqueueAction
-import com.tonyodev.fetch2.NetworkType
-import com.tonyodev.fetch2.Request
-import com.tonyodev.fetch2core.Extras
-import java.lang.reflect.Modifier
-
-private fun Request.attachMetaData(context: Context, app: App) {
- val isWifiOnly = Preferences.getBoolean(context, Preferences.PREFERENCE_DOWNLOAD_WIFI_ONLY)
-
- apply {
- groupId = app.getGroupId(context)
- tag = app.packageName
- enqueueAction = EnqueueAction.UPDATE_ACCORDINGLY
- networkType = if (isWifiOnly) NetworkType.WIFI_ONLY else NetworkType.ALL
- }
-}
-
-private fun Request.attachExtra(app: App) {
- val stringMap: MutableMap = mutableMapOf()
- val gson = GsonBuilder()
- .excludeFieldsWithModifiers(Modifier.TRANSIENT)
- .create()
- stringMap[Constants.STRING_EXTRA] = gson.toJson(app)
- apply {
- extras = Extras(stringMap)
- }
-}
-
-object RequestBuilder {
-
- fun buildRequest(context: Context, app: App, file: File): Request {
- val fileName = when (file.type) {
- File.FileType.BASE,
- File.FileType.SPLIT -> PathUtil.getApkDownloadFile(context, app.packageName, app.versionCode, file)
- File.FileType.OBB,
- File.FileType.PATCH -> PathUtil.getObbDownloadFile(app.packageName, file)
- }
- return Request(file.url, fileName).apply {
- attachMetaData(context, app)
- attachExtra(app)
- }
- }
-}
diff --git a/app/src/main/java/com/aurora/store/data/downloader/RequestGroupIdBuilder.kt b/app/src/main/java/com/aurora/store/data/downloader/RequestGroupIdBuilder.kt
deleted file mode 100644
index d94d098a4..000000000
--- a/app/src/main/java/com/aurora/store/data/downloader/RequestGroupIdBuilder.kt
+++ /dev/null
@@ -1,54 +0,0 @@
-package com.aurora.store.data.downloader
-
-import android.content.Context
-import com.aurora.gplayapi.data.models.App
-import com.aurora.store.util.Preferences
-import com.aurora.store.util.Preferences.PREFERENCE_UNIQUE_GROUP_IDS
-import com.google.gson.Gson
-import com.google.gson.reflect.TypeToken
-
-class RequestGroupIdBuilder {
-
- data class AppIDnVersion(val id: Int, val versionCode: Int)
-
- companion object {
- fun getGroupIDsForApp(context: Context, appID: Int): MutableList {
- val data = Preferences.getPrefs(context).getString(PREFERENCE_UNIQUE_GROUP_IDS, "")!!
- val gson = Gson()
- var groupIDMap = HashMap()
- if (data.isNotEmpty()) {
- val empMapType = object : TypeToken