PathUtil: Use sharedLibrary's package name for directory
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -70,15 +70,15 @@ object PathUtil {
|
|||||||
* @param download An instance of [Download]
|
* @param download An instance of [Download]
|
||||||
*/
|
*/
|
||||||
fun getLocalFile(context: Context, gFile: GPlayFile, download: Download): File {
|
fun getLocalFile(context: Context, gFile: GPlayFile, download: Download): File {
|
||||||
val isSharedLib = download.sharedLibs.any { it.fileList.contains(gFile) }
|
val sharedLib = download.sharedLibs.find { it.fileList.contains(gFile) }
|
||||||
return when (gFile.type) {
|
return when (gFile.type) {
|
||||||
GPlayFile.FileType.BASE, GPlayFile.FileType.SPLIT -> {
|
GPlayFile.FileType.BASE, GPlayFile.FileType.SPLIT -> {
|
||||||
val downloadDir = if (isSharedLib) {
|
val downloadDir = if (sharedLib != null) {
|
||||||
getLibDownloadDir(
|
getLibDownloadDir(
|
||||||
context,
|
context,
|
||||||
download.packageName,
|
download.packageName,
|
||||||
download.versionCode,
|
download.versionCode,
|
||||||
download.packageName
|
sharedLib.packageName
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
getAppDownloadDir(context, download.packageName, download.versionCode)
|
getAppDownloadDir(context, download.packageName, download.versionCode)
|
||||||
|
|||||||
Reference in New Issue
Block a user