fix(android): list installed packages on some Samsung devices - #5713
fix(android): list installed packages on some Samsung devices#5713rigor789 wants to merge 3 commits into
Conversation
|
Update: draft state because errors are part of stderr but not caught in the catch block - need to parse command result for output like this: Temporary fix was to modify the result.stdout.concat(result.stderr)
// ...
if(result.includes('Exception occurred while executing')) {
throw result
} |
|
Is there anything I can help with this one ? |
c39f616 to
c4560b9
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthrough
ChangesAndroid package discovery
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Package discovery now falls back to per-user listing when global Android package listing fails, with deduplication and cached results. No concrete merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant AndroidApplicationManager
participant AndroidDebugBridge
participant AndroidPackageManager
AndroidApplicationManager->>AndroidDebugBridge: Run global package listing
AndroidDebugBridge->>AndroidPackageManager: Execute pm list packages
AndroidPackageManager-->>AndroidDebugBridge: Return package output
alt Output is empty or per-user mode is enabled
AndroidApplicationManager->>AndroidDebugBridge: Run pm list users
AndroidDebugBridge->>AndroidPackageManager: Execute user listing
AndroidPackageManager-->>AndroidDebugBridge: Return user IDs
AndroidApplicationManager->>AndroidDebugBridge: Run pm list packages --user ID
AndroidDebugBridge->>AndroidPackageManager: Execute per-user listing
AndroidPackageManager-->>AndroidDebugBridge: Return package output
end
AndroidApplicationManager-->>AndroidApplicationManager: Parse and deduplicate packages
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. A rabbit checks each package trail Comment |
`executeShellCommand` never rejects on a non-zero exit code, so catching an error around `pm list packages` could not detect the SecurityException some Samsung devices raise for the Secure Folder user (150). Detect the failure from the empty package output instead, list packages per user, deduplicate the result, and keep using the per-user path for the rest of the session since the installed-apps check is polled frequently.
PR Checklist
What is the current behavior?
On some devices listing installed packages via
adb shellbreaks due to a permission error - and makes other parts of the CLI fail because we can't verify whether or not the app has been installed.What is the new behavior?
In case listing the packages fails - we try an alternative (slower) method:
Summary by CodeRabbit