Repository navigation
Read the module repository through the shared Store code - #135
Open
JingMatrix wants to merge 2 commits into
Open
JingMatrix wants to merge 2 commits into
JingMatrix wants to merge 2 commits into
Conversation
core carries the Store's networking in manager-ui, so RepoRepository is a subclass of StoreRepository and keeps only what is LSPatch's: how the device is asked what is installed, and where a log line goes. What comes with it is the catalogue built from both hosts — the whole snapshot from backup.modules.lsposed.org as the base, the index pages from modules.lsposed.org as corrections — and the shared client's disk cache, so a cold start with no network renders the last catalogue rather than an empty screen, and pull-to-refresh reads the index to its last page. The Store's three preferences move into the app's settings store, because a module installed from the store is one LSPatch installed: the release channel, the muted updates, and a note of what each install left behind, which is what keeps the same release from being offered again. A package event refreshes the installed map, when the Store has been opened. Also here: core moves to 6f6b976, where that shared code lives. On a Pixel 7: 1380 modules, the walk stopping at page 6 of 47; the same list from the cache with the radios off; all 47 pages on a pull.
Installed versions come from one getInstalledPackages call rather than a version read per package over the manager's app-list scan: the scan carries no version, so that was a binder round trip for every app on the device, on every package event. The store install writes its note after the bar reaches Done rather than before. The note asks the device what it now holds, and a reader watching the install has no reason to wait on bookkeeping; the package rescan it did first is the broadcast's job and no longer needed here. On a moto g75: a module installed from the Store is recorded as 2-1.1/2-1.1, comes back as Installed in the list, and the catalogue reads 1382 modules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This manager and Vector show the same Store screen and read the same two hosts, and until now each had its own copy of the code that reads them. Vector's now lives in
manager-ui, soRepoRepositoryhere is a subclass ofStoreRepositorythat supplies only what is LSPatch's: how the device is asked what is installed, and where a log line goes. The file goes from 210 lines to 76.What arrives with the shared code:
backup.modules.lsposed.orgserves the whole snapshot but is a periodic rebuild;modules.lsposed.orgrefuses that path and serves the index a page at a time, current. The snapshot is the base and the pages correct it, stopping at the first page that agrees.The Store's three preferences were in-memory defaults on the grounds that this manager could not install from the store. It can, so they are persisted in the app's
settingsstore: the release channel, the muted updates, and a note of what each install left behind — without that note the Store keeps offering a release it has already installed. A package event refreshes the installed map, but only once the Store has been opened.Tried on a Pixel 7 (Android 17): 1380 modules with the walk stopping at page 6 of 47; the same list rendered from the cache with Wi-Fi and data off; all 47 pages read on a pull; a module's details page and its install bar intact. No crashes.
coremoves from e00c5c5 to 6f6b976, where the shared code lives (JingMatrix/Vector#1022).