Changed logic to update app from utilizing DownloadManager to manual download
This commit is contained in:
@@ -27,12 +27,19 @@ package xyz.quaver.pupil
|
||||
*/
|
||||
|
||||
import org.junit.Test
|
||||
import xyz.quaver.pupil.util.download
|
||||
import java.io.File
|
||||
import java.net.URL
|
||||
|
||||
class ExampleUnitTest {
|
||||
|
||||
@Test
|
||||
fun test() {
|
||||
|
||||
URL("https://github.om/tom5079/Pupil/releases/download/4.2-beta2-hotfix2/Pupil-v4.2-beta2-hotfix2.apk").download(
|
||||
File(System.getenv("USERPROFILE"), "Pupil.apk")
|
||||
) { downloaded, fileSize ->
|
||||
println("%.1f%%".format(downloaded*100.0/fileSize))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user