URI Implementation - #1781
Conversation
📝 WalkthroughWalkthroughThe app now supports copying ChangesWeb URI deep-link flow
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 winReject malformed VIEW sources instead of defaulting to Steam.
For
ACTION_VIEW, a missing or invalidgamesourcereaches Line 68 and becomesSTEAM. 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 returnnullfor 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
📒 Files selected for processing (6)
app/src/main/AndroidManifest.xmlapp/src/main/java/app/gamenative/ui/enums/AppOptionMenuType.ktapp/src/main/java/app/gamenative/ui/screen/library/appscreen/BaseAppScreen.ktapp/src/main/java/app/gamenative/ui/screen/library/components/GameOptionsPanel.ktapp/src/main/java/app/gamenative/utils/IntentLaunchManager.ktapp/src/main/res/values/strings.xml
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
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
Checklist
#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.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.AndroidManifest.xml:android.intent.action.VIEW,BROWSABLE, andgamenative://run.IntentLaunchManagerto parse bothapp.gamenative.LAUNCH_GAMEandandroid.intent.action.VIEW, requiregamenative://run, readappidandgamesource, reject unknown sources, and only acceptcontainer_configfor launch intents.gamenative://run?appid=<id>&gamesource=<source>to the clipboard.CopyURI, icon mapping, and inclusion in Quick Actions.option_copy_web_uristring.Written for commit dc7ab65. Summary will update on new commits.
Summary by CodeRabbit
gamenative://runlinks usingappidandgamesource.