Commit Graph

1053 Commits

Author SHA1 Message Date
Aayush Gupta
65fc2a2dbd SessionInstaller: Open write sessions with packageName only
This allows to open same sessions multiple times when required untill it's
abandoned. Also specifiy file length as it is known.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-05-02 13:24:33 +05:30
Aayush Gupta
a75838a57d AuroraApp: Switch from GlobalScope to MainScope
Use MainScope instead of GlobalScope managed in the application class

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-05-02 12:22:06 +05:30
Aayush Gupta
4a109fa164 DownloadFragment: Display downloads in reversed order
Latest downloads should always be on top to allow users to easily manage them.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-30 18:37:37 +05:30
Aayush Gupta
3918fc199d GoogleFragment: Update EMBEDDED_SETUP_URL
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-24 09:06:32 +05:30
Aayush Gupta
b48cc00cbe MoreDialogFragment: Better theme and color handling
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-19 12:18:45 +05:30
Aayush Gupta
92771bbaec DownloadMenuSheet: Allow to export downloaded files
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-16 12:04:32 +05:30
Aayush Gupta
5f714e624b MainActivity: Use NavigationRail on large screen devices
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-16 10:45:14 +05:30
Aayush Gupta
c3963519e0 MainActivity: Move navigation drawer items into dialogfragment
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-16 10:37:38 +05:30
Aayush Gupta
b85b2afd35 AboutFragment: Format app version name and code properly
Appending version code to name confuses users regarding version they are using.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-04 13:51:38 +05:30
Aayush Gupta
687b8f0e68 Constants: Drop unused variables
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-04 13:46:39 +05:30
Aayush Gupta
8962260f0b WelcomeFragment: Localize welcome screen strings
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-04 11:12:58 +05:30
Aayush Gupta
5612263e04 data: installer: Localize installer information
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-03 21:23:00 +05:30
Aayush Gupta
4dbe4c78a2 AppLinksFragment: Wrap app link activity start in try-catch block
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>
2024-04-01 15:17:38 +05:30
Aayush Gupta
ed4e8c8430 AppLinksFragment: Update button state when link is removed
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-04-01 15:02:43 +05:30
Aayush Gupta
4790ae1d83 PermissionBottomSheet: Highlight new permissions using accent color
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-30 13:29:59 +05:30
Aayush Gupta
b925aa3400 SessionInstaller: Register session callbacks on main thread
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-30 11:02:03 +05:30
Aayush Gupta
8abade8881 Avoid accessing file's path when working with downloads
This will help us to use document tree in future to allow users custom download
directory.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-27 19:52:41 +05:30
Aayush Gupta
d15fd40296 PathUtil: Set default downloads to internal cache directory
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>
2024-03-27 18:55:27 +05:30
Aayush Gupta
5c5b48c6c1 DownloadWorker: Update downloadedBytes when file exists as well
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-22 17:45:50 +05:30
Aayush Gupta
3067647724 fixup! DownloadWorker: Resume download when possible
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-22 16:38:02 +05:30
Aayush Gupta
ad64d512e5 DownloadWorker: Resume download when possible
* 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>
2024-03-22 16:19:53 +05:30
Aayush Gupta
dcddfc74bd AppDetailsFragment: Better check for running downloads on setup
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-22 14:07:56 +05:30
Aayush Gupta
42a38ef741 DownloadWorker: Also consider speed when updating progress
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>
2024-03-22 13:51:44 +05:30
Aayush Gupta
1edc0b3f53 AppDetailsFragment: Access DetailsClusterViewModel using viewModels method
* Leftover of the great migration

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-20 19:17:08 +05:30
Aayush Gupta
795d0dddb7 BaseClusterViewModel: Use original cluster ID to append apps
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-20 17:56:14 +05:30
Aayush Gupta
b187096869 InstalledAppsFragment: Move event handling to fragment
* Just fetch the list again, its not that expensive

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-20 17:24:04 +05:30
Aayush Gupta
0b07c3cecb [LeakCanary] Fragment: Explicity set viewpager2 adapter to null
* Also use viewLifecycleOwner to get lifecycle

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-20 17:24:04 +05:30
Aayush Gupta
3a27fa719b ui: sheets: Use BottomSheetDialogFragment directly
We don't need base class anymore. Also use view binding the recommended
way for fragments.

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-20 17:24:04 +05:30
Aayush Gupta
5cf7fa6b3c Fragment: Multiple improvements to fragments
* 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>
2024-03-20 17:24:04 +05:30
Aayush Gupta
c3bae480c4 ViewModel: Switch to Hilt for accessing application context
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-20 17:24:04 +05:30
Aayush Gupta
13a88afa09 AppUtil: Move installed and updatable app logic to separate class
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-19 18:55:08 +05:30
Aayush Gupta
d030a7ac2e Respect battery optimization setting when auto-updating
* 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>
2024-03-18 22:01:38 +05:30
Aayush Gupta
c72b860b4d Supress deprecation warning for compat methods
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-18 15:32:54 +05:30
Aayush Gupta
61e148f58b model: Drop unused model classes
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-14 11:59:26 +05:30
Aayush Gupta
d4f4b4bca5 OnboardingFragment: Drop theme and accent fragments
Still available in the settings

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-14 11:46:44 +05:30
Aayush Gupta
9b9cfd8de2 Implement Material3 based EditTextPreference
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-07 18:38:45 +05:30
Aayush Gupta
8f09c7d6ed NetworkPreference: Move proxy validation logic into viewModel
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-07 17:19:59 +05:30
Aayush Gupta
2a41baf69d DownloadWorker: Download files using proxy when exists
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-07 14:37:19 +05:30
Aayush Gupta
00b94fbac3 SessionInstaller: Automatically pick the best install location
This ensures that if an app is installed in external storage, it continues
to install it there, otherwise defaults to internal like existing behaviour.

Ref: https://cs.android.com/android/platform/superproject/+/main:frameworks/base/core/java/com/android/internal/content/InstallLocationUtils.java;l=328

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-06 19:23:00 +05:30
Aayush Gupta
28ba1ac17c SplashFragment: Fixes for AuthState.Failed
* Make menu invisible instead of clearing it
* Apply appropriate margin to the status textView

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-05 14:52:28 +05:30
Aayush Gupta
72d077decf BasePreferenceFragment: Move Material3 preference logic to new fragment
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-05 14:42:56 +05:30
Aayush Gupta
ac3065ab2c Improve and fix proxy setup/usage
* 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>
2024-03-05 14:17:11 +05:30
Aayush Gupta
29ce733611 UpdatesFragment: Move Update All button to FAB
* Also link BlacklistFragment in in it's place as requested by users

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-04 14:50:15 +05:30
Aayush Gupta
caf6dd18c1 Cleanup and retire non-working download options
* 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>
2024-03-04 12:55:39 +05:30
Aayush Gupta
2f5d39106a UpdateWorker: Merge self-updates logic for non-fdroid builds
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>
2024-03-02 13:26:54 +05:30
Aayush Gupta
3b9efeed11 UpdateWorker: Move update notification logic to NotificationUtil
* All notification related logic should be in this class

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-03-02 10:48:16 +05:30
Aayush Gupta
804d37a579 MainActivity: Move search FAB to fragment_apps_games layout
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-02-27 22:46:08 +05:30
Aayush Gupta
361707f0cc SelfUpdateWorker: Make update check interval configurable
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-02-24 06:39:10 +05:30
Aayush Gupta
3091679c4c ShortcutManagerUtil: Ensure app has a launch intent
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-02-23 12:53:52 +05:30
Aayush Gupta
89fdf1186f AppDetailsFragment: Show menu action to create app shortcut if supported
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
2024-02-23 12:25:48 +05:30