Commit e3b52206 authored by Dayona Joseph's avatar Dayona Joseph Committed by Arnau Vàzquez
Browse files

Fix arch values in download api

parent ac181e72
......@@ -21,15 +21,14 @@ import com.fasterxml.jackson.annotation.JsonCreator
import foundation.e.apps.utils.Common
import foundation.e.apps.utils.Constants
class AppDownloadedRequest(private val id: String) {
class AppDownloadedRequest(private val id: String, private val apkArchitecture: String?) {
companion object {
private val reader = Common.getObjectMapper().readerFor(Result::class.java)
}
fun request() {
try {
val arch = System.getProperty("os.arch")
val url = Constants.BASE_URL + "apps?action=download&app_id=$id&architecture=:$arch"
val url = Constants.BASE_URL + "apps?action=download&app_id=$id&architecture=$apkArchitecture"
val urlConnection = Common.createConnection(url, Constants.REQUEST_METHOD_GET)
reader.readValue<Result>(urlConnection.inputStream)
urlConnection.disconnect()
......
......@@ -201,7 +201,7 @@ class Application(val packageName: String, private val applicationManager: Appli
override fun onDownloadComplete(context: Context, status: Int) {
if (status == DownloadManager.STATUS_SUCCESSFUL) {
Execute({
AppDownloadedRequest(basicData!!.id).request()
AppDownloadedRequest(basicData!!.id,fullData!!.getLastVersion()?.apkArchitecture).request()
}, {})
if(info.isXapk(fullData!!,basicData)){
isInstalling=true
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment