Add an optional HTTP proxy for downloads (#1474)

* Add an optional HTTP proxy for downloads

Downloads only reached GitHub directly or through URL-rewrite
mirrors, which does not help where a local proxy is the workable
route. Setup now takes a host:port HTTP proxy that every Downloader
connection uses, independently of the download source mode.

* Reference the Kotlin object instance from Java

Java cannot call a Kotlin object member on the class name without
@JvmStatic; the surrounding code already uses INSTANCE.

* Assert the proxy host literal without a reverse lookup

InetSocketAddress.getHostName reverse-resolves on some JVMs
(127.0.0.1 became localhost on CI); hostString is the literal.

* Pass the app proxy into the guest environment

The Steam client installer and the guest package tools fetch with
plain curl against their own CDNs, outside Downloader. Export the
usual proxy variables for them when the app proxy is set; proot
shares the host network, so a localhost proxy is reachable as-is.

---------

Co-authored-by: VIIII4 <VIIII4@users.noreply.github.com>
This commit is contained in:
VIIII4andVIIII4 authored and GitHub committed 2026-10-25 12:07:26 -04:00
1 parent 2be08bc67d
commit c6bc8aef04
9 files changed
+100 -1

No files matched your search

@@ -170,6 +170,7 @@ class FrontEndActivity : ComponentActivity() {
private var downloadSource by mutableStateOf(DownloadSource.MODE_AUTO)
private var downloadMirror by mutableStateOf("")
private var downloadPrefix by mutableStateOf("")
private var downloadProxy by mutableStateOf("")
private var animationsEnabled by mutableStateOf(true)
private var launcherIcon by mutableStateOf(LauncherIcon.DARK)
private var gameStoresEnabled by mutableStateOf(true)
@@ -768,6 +769,7 @@ class FrontEndActivity : ComponentActivity() {
downloadSource = DownloadSource.mode(this)
downloadMirror = DownloadSource.mirror(this)
downloadPrefix = DownloadSource.custom(this)
downloadProxy = DownloadSource.proxyHostPort(this)
DownloadSource.probe()
animationsEnabled = SessionPrefs.animationsEnabled(this)
LauncherIcon.repair(this, intent?.component)
@@ -833,6 +835,7 @@ class FrontEndActivity : ComponentActivity() {
downloadSource = downloadSource,
downloadMirror = downloadMirror,
downloadPrefix = downloadPrefix,
downloadProxy = downloadProxy,
animationsEnabled = animationsEnabled,
launcherIcon = launcherIcon,
gameStoresEnabled = gameStoresEnabled,
@@ -1033,6 +1036,10 @@ class FrontEndActivity : ComponentActivity() {
DownloadSource.setCustom(this, prefix)
downloadPrefix = DownloadSource.custom(this)
},
onDownloadProxy = { value ->
DownloadSource.setProxy(this, value)
downloadProxy = DownloadSource.proxyHostPort(this)
},
onHomeApp = { manageHomeApp() },
onHomeScreen = { on ->
HomeApp.setHomeScreenEnabled(this, on)