Skip to content

URI Implementation - #1781

Open
ShadowFungi wants to merge 4 commits into
utkarshdalal:masterfrom
ShadowFungi:uri-implementation
Open

URI Implementation#1781
ShadowFungi wants to merge 4 commits into
utkarshdalal:masterfrom
ShadowFungi:uri-implementation

Conversation

@ShadowFungi

@ShadowFungi ShadowFungi commented Jul 29, 2026

Copy link
Copy Markdown

Description

I added a button to copy a URI for launching games in GameNative from a web browser and many other apps, I also added a basic URI handling system to the IntentLaunchManager.kt. Also let me know if I messed up anywhere or need to change anything, I only recently started learning kotlin.

Recording

gamenative-web-uri.mp4

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Adds a deep link URI scheme to launch games and a “Copy web URI” quick action, with stricter validation of incoming links. Users can copy a gamenative:// link and start games from the browser or other apps.

  • New Features
    • Added deep link handling in AndroidManifest.xml: android.intent.action.VIEW, BROWSABLE, and gamenative://run.
    • Updated IntentLaunchManager to parse both app.gamenative.LAUNCH_GAME and android.intent.action.VIEW, require gamenative://run, read appid and gamesource, reject unknown sources, and only accept container_config for launch intents.
    • Added “Copy web URI” option in the game options menu that copies gamenative://run?appid=<id>&gamesource=<source> to the clipboard.
    • UI updates: new menu type CopyURI, icon mapping, and inclusion in Quick Actions.
    • Added option_copy_web_uri string.

Written for commit dc7ab65. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added a “Copy web URI” quick action for installed games.
    • Enabled launching games via gamenative://run links using appid and gamesource.
  • Improvements
    • Updated the URI copy label to use the app name and game name for clearer clipboard text.
  • Bug Fixes
    • Improved deep-link handling by strictly validating supported actions and required URI parameters before launching.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The app now supports copying gamenative://run game URIs from installed library options and launching games from matching Android VIEW intents.

Changes

Web URI deep-link flow

Layer / File(s) Summary
Deep-link intent contract and parsing
app/src/main/AndroidManifest.xml, app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt
MainActivity accepts gamenative://run VIEW intents, while IntentLaunchManager validates and parses appid and gamesource query parameters.
Copy URI menu action
app/src/main/java/app/gamenative/ui/enums/AppOptionMenuType.kt, app/src/main/java/app/gamenative/ui/screen/library/appscreen/BaseAppScreen.kt, app/src/main/res/values/strings.xml
Adds the CopyURI option and copies a generated game URI to the clipboard.
Quick-action menu integration
app/src/main/java/app/gamenative/ui/screen/library/components/GameOptionsPanel.kt, app/src/main/java/app/gamenative/ui/screen/library/appscreen/BaseAppScreen.kt
Displays CopyURI with a share icon in the quick-actions group and installed-only options menu.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ExternalLink
  participant MainActivity
  participant IntentLaunchManager
  ExternalLink->>MainActivity: Open gamenative://run URI
  MainActivity->>IntentLaunchManager: Parse ACTION_VIEW intent
  IntentLaunchManager->>IntentLaunchManager: Validate URI and query parameters
Loading

Possibly related PRs

Suggested reviewers: utkarshdalal, xxjsonderuloxx

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too vague to clearly describe the main change in the pull request. Rename it to a concise, specific summary of the deep-link URI and Copy web URI feature.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description matches the template and includes the required sections, checklist items, and a recording link.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt (1)

50-69: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Reject malformed VIEW sources instead of defaulting to Steam.

For ACTION_VIEW, a missing or invalid gamesource reaches Line 68 and becomes STEAM. A typo or unsupported source can therefore launch a different store’s app with the same numeric ID. Normalize the expected case if needed, but return null for invalid VIEW links; retain the fallback only for the legacy action.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt` around lines
50 - 69, Update the source validation in IntentLaunchManager’s intent handling
so ACTION_VIEW returns null when gameSource is missing or invalid, while
preserving the STEAM fallback for ACTION_LAUNCH_GAME. Normalize VIEW gameSource
casing before validation as needed, and keep valid sources unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt`:
- Around line 36-46: Update IntentLaunchManager’s ACTION_VIEW handling to ignore
and remove any EXTRA_CONTAINER_CONFIG supplied by external VIEW intents before
the intent is passed to MainActivity, preventing overrides of executablePath,
envVars, drives, and execArgs. Preserve container configuration for trusted
ACTION_LAUNCH_GAME intents, and ensure the legacy action is similarly protected
if it can be reached externally.

---

Outside diff comments:
In `@app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt`:
- Around line 50-69: Update the source validation in IntentLaunchManager’s
intent handling so ACTION_VIEW returns null when gameSource is missing or
invalid, while preserving the STEAM fallback for ACTION_LAUNCH_GAME. Normalize
VIEW gameSource casing before validation as needed, and keep valid sources
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a9afb41a-23e9-4aaf-ad57-f17c4110d7d5

📥 Commits

Reviewing files that changed from the base of the PR and between d61318b and e934b86.

📒 Files selected for processing (6)
  • app/src/main/AndroidManifest.xml
  • app/src/main/java/app/gamenative/ui/enums/AppOptionMenuType.kt
  • app/src/main/java/app/gamenative/ui/screen/library/appscreen/BaseAppScreen.kt
  • app/src/main/java/app/gamenative/ui/screen/library/components/GameOptionsPanel.kt
  • app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt
  • app/src/main/res/values/strings.xml

Comment thread app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread app/src/main/AndroidManifest.xml
Comment thread app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt
Comment thread app/src/main/java/app/gamenative/utils/IntentLaunchManager.kt Outdated
Comment thread app/src/main/java/app/gamenative/ui/screen/library/appscreen/BaseAppScreen.kt Outdated
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.

1 participant