diff --git a/app/src/main/java/com/vanced/manager/core/downloader/MicrogDownloadService.kt b/app/src/main/java/com/vanced/manager/core/downloader/MicrogDownloadService.kt index 9d8bbe11..364a9d4c 100644 --- a/app/src/main/java/com/vanced/manager/core/downloader/MicrogDownloadService.kt +++ b/app/src/main/java/com/vanced/manager/core/downloader/MicrogDownloadService.kt @@ -23,6 +23,7 @@ import com.vanced.manager.utils.InternetTools.getObjectFromJson import com.vanced.manager.utils.NotificationHelper import com.vanced.manager.utils.NotificationHelper.cancelNotif import com.vanced.manager.utils.NotificationHelper.createBasicNotif +import java.io.File class MicrogDownloadService: Service() { @@ -43,7 +44,7 @@ class MicrogDownloadService: Service() { request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI) request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE) request.setTitle(getString(R.string.downloading_file, "MicroG")) - request.setDestinationUri(Uri.parse("${filesDir.path}/microg.apk")) + request.setDestinationUri(Uri.fromFile(File("${filesDir.path}/microg.apk"))) val downloadManager = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager downloadId = downloadManager.enqueue(request) diff --git a/app/src/main/java/com/vanced/manager/core/downloader/VancedDownloadService.kt b/app/src/main/java/com/vanced/manager/core/downloader/VancedDownloadService.kt index 5e23a711..71271981 100644 --- a/app/src/main/java/com/vanced/manager/core/downloader/VancedDownloadService.kt +++ b/app/src/main/java/com/vanced/manager/core/downloader/VancedDownloadService.kt @@ -25,6 +25,7 @@ import com.vanced.manager.utils.InternetTools.getObjectFromJson import com.vanced.manager.utils.NotificationHelper.cancelNotif import com.vanced.manager.utils.NotificationHelper.createBasicNotif import com.vanced.manager.utils.NotificationHelper.displayDownloadNotif +import java.io.File class VancedDownloadService: Service() { @@ -69,7 +70,7 @@ class VancedDownloadService: Service() { request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI) request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE) request.setTitle(getString(R.string.downloading_file, "MicroG")) - request.setDestinationUri(Uri.parse("${filesDir.path}/${getFileNameFromUrl(url)}")) + request.setDestinationUri(Uri.fromFile(File("${filesDir.path}/${getFileNameFromUrl(url)}"))) val downloadManager = getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager downloadId = downloadManager.enqueue(request) diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt index a6b32dbb..9da9c9b6 100644 --- a/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt +++ b/app/src/main/java/com/vanced/manager/ui/fragments/UpdateCheckFragment.kt @@ -77,15 +77,14 @@ class UpdateCheckFragment : DialogFragment() { } private fun upgradeManager() { - val dwnldUrl = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/manager.json") - .get("url").asString + val dwnldUrl = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/manager.json").get("url").asString //val loadBar = view?.findViewById(R.id.update_center_progressbar) val request = DownloadManager.Request(Uri.parse(dwnldUrl)) request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI) request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE) request.setTitle(activity?.getString(R.string.downloading_file, "Manager")) - request.setDestinationUri(Uri.parse("${activity?.filesDir?.path}/manager.apk")) + request.setDestinationUri(Uri.fromFile(File("${activity?.filesDir?.path}/manager.apk"))) val downloadManager = activity?.getSystemService(DOWNLOAD_SERVICE) as DownloadManager downloadId = downloadManager.enqueue(request)