Android warns that it may not exist on all devices and samsung devices
seems to prove that true.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This allows system to automatically free up space when required as well as
users to delete it manually from the app info settings without wiping out
aurora store specific configuration.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* If file still exists, resume the download using range requests.
* Avoid deleting files when download fails as we can resume the download again.
* Assert for expected SHA and actual SHA to match
* Verify SHA after download is finished to avoid complicated logic
Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This should fix the issue where progress gets stuck because download speed
gets really low but UI still mentions old speed and time remaining
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* Use viewModels method to get ViewModel instances
* Use view binding as recommended for fragments
* Mark possible variables as private and val
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* Don't enable auto-install for updates if battery optimization permission
is not granted during onboarding.
* Drop showing warning in toolbar, show it instead if they want auto-install
* Don't check for the same during downloads. Failing is better instead.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* Switch connectivitycheck URL to HTTPS as cleartext communication is disabled
* Use GlobalScope to verify and setup proxy URL
* Ignore proxy setup in HttpClient if its empty
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
* External storage download uses external files directory and not the SD card
to downloads while the description states otherwise. This is in-accurate and
thus dropped (See #985).
* Custom download path is broken which was implemented as a workaround for the
above (See #1003).
* Move downloads storage to internal files directory which is sandboxed and only
accessible to us.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
Treat Aurora Store as a normal app for non-fdroid builds and check
for its updates based on auto-update preference.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
SplashFragment always removes itself from backstack in every other case, do same
when launching the app detail page to handle intents as well.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
WorkManager downloads can fail due to n number of reason. Regardless of the reason
there might be not enough time to mark the download as failed within the worker
causing the download to keep the status as downloading on next startup, thus blocking
the queue.
Always check for downloads with downloading status on init and cancel them if work
manager cannot find atleast one ongoing work for it.
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>