Fix module repository loading#765
Conversation
Use the working backup repository API endpoint for module JSON, surface failed HTTP responses, and load full module details when README content is missing. Keeps the browser action on the public modules.lsposed.org web page because the backup host only serves the JSON API. Builds on the approach from JingMatrix#747 by byemaxx. Co-authored-by: Qing <44231502+byemaxx@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the module repository integration to work with the current LSPosed repository endpoints (using the backup CDN), improves failure handling so repository refreshes don’t get stuck in an endless loading state, and restores README rendering by fetching per-module JSON when README content isn’t present in the list payload.
Changes:
- Switch repository JSON API base URL to
https://backup.modules.lsposed.org/and remove deprecated fallback mirrors. - Treat non-2xx and empty HTTP responses as load failures, and ensure UI exits the refreshing state on failure.
- Fetch per-module JSON when README is missing and refresh the README tab after module details load.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| app/src/main/java/org/lsposed/manager/ui/fragment/RepoItemFragment.java | Adds README-missing detection and triggers remote module fetch; updates release loading UX and README tab refresh behavior. |
| app/src/main/java/org/lsposed/manager/repo/RepoLoader.java | Switches repo base URL and tightens HTTP failure handling for repo list and per-module fetches. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed Copilot's review comments in
Validation after the update:
|
|
Successfully compiled this branch on Windows (after bypassing the VERSION_NAME / INJECTED_PACKAGE_NAME macro quoting bugs in config.h and module.cpp) and verified it works flawlessly on Android 17. |
|
Thanks for testing this on Windows and Android 17. The VERSION_NAME / INJECTED_PACKAGE_NAME quoting issue should be covered by #764, which moves those injected values into CMake compile definitions. Once both PRs are applied, the Windows build workaround should no longer be needed. |
|
As you said, I think it is important to distinguish overlap from duplication. #765 intentionally overlaps with #747 because it was opened as a follow-up after testing #747 locally. I already mentioned this in #747: the core README-loading direction comes from #747, and I am happy for these follow-up changes to be folded back into #747 if @byemaxx or maintainers prefer that. The reason I opened this as a small separate PR is that #747 fixes the README loading path but also changes For #750, I see it as a different direction: it adds repository source selection / fallback behavior, which is closer to using a new feature to improve the repo outage case. #765 is intentionally narrower: it fixes the current loader behavior and error handling without adding a new setting. In particular, it surfaces non-2xx / empty / invalid JSON responses as failures and resets the README/release loading flags on error paths. So I do not see #765 as a competing replacement for either #747 or #750. If maintainers prefer consolidating the work, I am fine with closing this PR after the follow-up fixes are folded into whichever PR they choose. |
Summary
This fixes the module repository loader against the current LSPosed repository endpoints.
It builds on the investigation and approach from #747 by @byemaxx, with two follow-up adjustments:
modules.lsposed.orgweb page, becausebackup.modules.lsposed.org/module/<package>returns 404 without the.jsonsuffixRoot Cause
The old module list API currently fails from the manager path:
https://modules.lsposed.org/modules.jsonreturns 403https://modules-blogcdn.lsposed.org/modules.jsonreturns 418https://modules-cloudflare.lsposed.org/modules.jsonis no longer reliablehttps://backup.modules.lsposed.org/modules.jsonreturns the expected JSON payloadAlso, entries from
modules.jsonmay not include README content anymore, while the per-module JSON endpoint still does. The manager therefore needs to loadmodule/<package>.jsonbefore rendering the README tab when the list entry has no README.Changes
https://backup.modules.lsposed.org/for module repository JSON API calls.https://modules.lsposed.org/module/<package>.Related
Validation
./gradlew.bat --no-daemon :app:compileDebugJavaWithJavac./gradlew.bat --no-daemon :app:assembleDebugcurl:backup.modules.lsposed.org/modules.json-> 200 JSONbackup.modules.lsposed.org/module/com.luckyzyx.luckytool.json-> 200 JSONbackup.modules.lsposed.org/module/com.luckyzyx.luckytool-> 404modules.lsposed.org/module/com.luckyzyx.luckytool-> 200 HTML