Skip to content

Fix module repository loading#765

Open
Shallow-dusty wants to merge 2 commits into
JingMatrix:masterfrom
Shallow-dusty:codex/fix-module-repo-loader
Open

Fix module repository loading#765
Shallow-dusty wants to merge 2 commits into
JingMatrix:masterfrom
Shallow-dusty:codex/fix-module-repo-loader

Conversation

@Shallow-dusty

Copy link
Copy Markdown

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:

  • keep the "Open in browser" action on the public modules.lsposed.org web page, because backup.modules.lsposed.org/module/<package> returns 404 without the .json suffix
  • report non-2xx / empty HTTP responses as repository load failures instead of silently leaving the UI refreshing

Root Cause

The old module list API currently fails from the manager path:

  • https://modules.lsposed.org/modules.json returns 403
  • https://modules-blogcdn.lsposed.org/modules.json returns 418
  • https://modules-cloudflare.lsposed.org/modules.json is no longer reliable
  • https://backup.modules.lsposed.org/modules.json returns the expected JSON payload

Also, entries from modules.json may not include README content anymore, while the per-module JSON endpoint still does. The manager therefore needs to load module/<package>.json before rendering the README tab when the list entry has no README.

Changes

  • Use https://backup.modules.lsposed.org/ for module repository JSON API calls.
  • Treat unsuccessful HTTP responses and empty response bodies as load failures.
  • Restore the loaded state after a failed repository refresh so the UI does not remain in an endless refresh state.
  • Load full per-module JSON when README content is missing, then refresh the README tab.
  • Keep browser navigation pointed at https://modules.lsposed.org/module/<package>.

Related

Validation

  • ./gradlew.bat --no-daemon :app:compileDebugJavaWithJavac
  • ./gradlew.bat --no-daemon :app:assembleDebug
  • Verified endpoint behavior with curl:
    • backup.modules.lsposed.org/modules.json -> 200 JSON
    • backup.modules.lsposed.org/module/com.luckyzyx.luckytool.json -> 200 JSON
    • backup.modules.lsposed.org/module/com.luckyzyx.luckytool -> 404
    • modules.lsposed.org/module/com.luckyzyx.luckytool -> 200 HTML

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread app/src/main/java/org/lsposed/manager/repo/RepoLoader.java
Comment thread app/src/main/java/org/lsposed/manager/repo/RepoLoader.java
@Shallow-dusty

Copy link
Copy Markdown
Author

Addressed Copilot's review comments in 5f247d9a:

  • Reject blank repository list responses before writing repo.json.
  • Reject blank module-detail responses and JSON that parses to null.
  • Reset the README remote-load flag when repo reloads without README content, so refresh can retry.
  • Clear the user-initiated release-load flag on the error path to avoid a stale "no more releases" hint.

Validation after the update:

  • ./gradlew.bat --no-daemon :app:compileDebugJavaWithJavac
  • ./gradlew.bat --no-daemon :app:assembleDebug

@policiros

Copy link
Copy Markdown

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.

Vector-refs-pull-765-app+module.zip

@Shallow-dusty

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Module page in the repository doesnt load

3 participants