NanoHTTPD has issues with HTTP Keep-Alive, especially when other requests
are mixed in, like the /request-swap POST or perhaps the F-Droid HEAD to
fetch the ETag before the GET.
This disables gzip encoding and sets a Content Security Policy while I'm at
it. APKs, PNGs, and JARs are already compressed, so gzip would only ever
cause problems. And the index page is meant to be viewed by browsers, so
having a CSP will limit potential malicious swap activity.
The webserver was totally broken since nanohttpd had changed so much since
the swap webserver was implemented. This syncs up with the sample file and
gets rid of our hacks. The only differences now are the stuff that is
removed since it is totally unused in F-Droid. This also adds a full test
suite.
this actually closes#248
The MIME Types only need to be set on files that we are actually using to
display in the browser. All others should not be set so that they cannot
be abused.
This is a quick hack to reuse the Latest view with a slightly simpler
layout. It makes the "basic" flavor fully functional as an fdroid client.
The goal here is just to have something simpler with as little new code as
possible. It is essential that the whitelabeling and "Light" aka "basic"
flavor does not increase the maintenance load.
closesfdroid/fdroidclient#48fdroid/fdroidclient!692fdroid/fdroidclient!695
PendingInstall means that the user considers the install still in process,
like when F-Droid gets killed in the background. There is unfortunately no
reliable way currently to ensure that removePendingInstall() is called when
the app is finally installed so we can't use it here.
This reverts a small part of 1c50e2891054b629e2af6b2d0b1fc89e0b1cf18b
closesfdroid/fdroidclient#1527fdroid/fdroidclient#1532
InstalledAppProviderService also updates the AppUpdateStatus of any
package installs that are still in progress. Most importantly, this
provides the final status update to mark the end of the installation
process. It also errors out installation processes where some outside
factor uninstalled the package while the F-Droid process was underway, e.g.
uninstalling via adb, updates via Google Play, Yalp, etc.
fdroid/fdroidclient#1536fdroid/fdroidclient#1357
This could definitely use a better design treatment, but at least it is
better than showing the "click to install" button again during the install
process.
closes#1357
This adds a new PendingInstall event which broadcasts that an install
process has started, but the state of it is not yet known, like
whether it needs to be downloaded still, or is ready to install. It
marks the very first step of the whole InstallManagerService process.
Installer events should only be directly related to the install process as
managed by the Installer set of classes. The newer AppStatusUpdate stuff
now tracks the whole lifecycle of the process.
This mostly reverts f0d6acd974548e24662a64271ae57922f74c3225 since there is
now the overarching concept of "Pending Install" to mark packages that are
somewhere in the whole process.
refs #828
refs #1357