Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
App Lounge
Commits
e3b52206
Commit
e3b52206
authored
Jul 28, 2020
by
Dayona Joseph
Committed by
Arnau Vàzquez
Jul 28, 2020
Browse files
Fix arch values in download api
parent
ac181e72
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/foundation/e/apps/api/AppDownloadedRequest.kt
View file @
e3b52206
...
...
@@ -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
()
...
...
app/src/main/java/foundation/e/apps/application/model/Application.kt
View file @
e3b52206
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment