mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-16 03:31:02 -04:00
DownloadWorker: Support downloading OBB and patch files
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -114,7 +114,11 @@ class DownloadWorker(private val appContext: Context, workerParams: WorkerParame
|
||||
|
||||
// Download and verify all files exists
|
||||
totalBytes = files.sumOf { it.size }
|
||||
|
||||
PathUtil.getAppDownloadDir(appContext, app.packageName, app.versionCode).createDirectories()
|
||||
if (files.any { it.type == GPlayFile.FileType.OBB || it.type == GPlayFile.FileType.PATCH }) {
|
||||
PathUtil.getObbDownloadDir(app.packageName).createDirectories()
|
||||
}
|
||||
|
||||
val requestList = getDownloadRequest(files)
|
||||
requestList.forEach { request ->
|
||||
|
||||
@@ -89,6 +89,14 @@ object PathUtil {
|
||||
.toString() + "/Android/obb/" + app.packageName
|
||||
}
|
||||
|
||||
fun getObbDownloadDir(packageName: String): Path {
|
||||
return Path(
|
||||
Environment.getExternalStorageDirectory().absolutePath,
|
||||
"/Android/obb/",
|
||||
packageName
|
||||
)
|
||||
}
|
||||
|
||||
fun getObbDownloadFile(app: App, file: File): String {
|
||||
val obbDir = getObbDownloadPath(app)
|
||||
return "$obbDir/${file.name}"
|
||||
|
||||
Reference in New Issue
Block a user