Changed logic to update app from utilizing DownloadManager to manual download

This commit is contained in:
tom5079
2020-01-13 14:06:47 +09:00
parent 6b43faa70e
commit ce843abec8
9 changed files with 183 additions and 133 deletions

View File

@@ -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))
}
}
}