Skip to content

Create Play Policy Insights skill to detect Play policies violations in the app. - #104

Merged
simona-anomis merged 7 commits into
android:github-skillsfrom
saswatanand:play-policy-insights
Jul 10, 2026
Merged

Create Play Policy Insights skill to detect Play policies violations in the app.#104
simona-anomis merged 7 commits into
android:github-skillsfrom
saswatanand:play-policy-insights

Conversation

@saswatanand

Copy link
Copy Markdown
Collaborator

The play-policy-insights skill is an automated auditor designed to verify Android applications against Google Play Policy domains. It cross-references static code analysis with Play Store declarations to generate deterministic compliance reports, identifying undeclared data collection, architectural risks, and missing disclosures.

1. Permissions and APIs Hygiene

This domain focuses on verifying that restricted permissions are justified by the app's core functionality and recommending minimum-scope API alternatives where applicable.

  • Photo and Video Access Policy: Evaluates if broad access to photos/videos (READ_MEDIA_IMAGES, READ_MEDIA_VIDEO) is justified or if the app should migrate to the privacy-preserving Android Photo Picker.
  • All Files Access Policy: Restricts the high-risk MANAGE_EXTERNAL_STORAGE permission strictly to apps where full disk access is critical to the core purpose (e.g., file managers, backup tools). Non-compliant apps must use Scoped Storage or the Storage Access Framework (SAF).
  • Location Access Policy: Verifies that location access is essential, uses the minimum necessary scope (Approximate vs. Precise), is properly disclosed, and does not utilize background tracking unless strictly essential for safety or navigation.
  • Contacts Access Policy: Evaluates if broad contacts access (READ_CONTACTS) is justified, mandating the use of the Android Contact Picker for secondary tasks.
  • Exact Alarm Policy: Restricts the USE_EXACT_ALARM permission to preserve system performance and battery life, limiting it to alarm clocks, timers, and calendar apps.
  • Foreground Services Policy: Ensures every foreground service has an appropriate foregroundServiceType defined in the Manifest, and special types like specialUse contain specific and valid tag property justifications.
  • Accessibility API Policy: Prevents the misuse of Accessibility Services for non-accessibility tasks like UI automation, screen scraping, or background monitoring.
  • Package Visibility Policy: Evaluates if broad visibility into installed apps (QUERY_ALL_PACKAGES) is justified, restricting it to apps that directly manage device safety.
  • SMS and Call Log Permissions: Restricts access to sensitive SMS and Call Log data to default handlers, enforcing the use of the SMS Retriever API for tasks like OTP verification.
  • Audio Recording Policy: Evaluates if broad audio recording (RECORD_AUDIO) is justified, encouraging the use of the system-managed Microphone Button for temporary needs.
  • Files and Docs Access Policy: Enforces storage isolation by migrating document and file selections to the Storage Access Framework (SAF) instead of requesting broad READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE for simple tasks.

2. User Account and Identity

This domain ensures compliance with Play Console administrative requirements and fundamental user data rights.

  • Login Credentials (Play Console Requirement): Identifies if the app implements a login wall or authentication screen. If present, it mandates that developers submit functional, non-expiring demo credentials in the Play Console to allow reviewers to access gated features.
  • Account Deletion Requirement: Enforces that if an app allows users to create an account in-app (even via third-party providers), it must provide a highly discoverable, in-app account deletion mechanism that wipes remote backend records, not just a local sign-out.

3. Data Safety and Privacy

This domain focuses on the transparent handling, transmission, and disclosure of user data.

  • Prominent Disclosure Policy: Requires that sensitive or non-obvious data collection have an in-app affirmative consent gatekeeper before data collection begins. The UI must explicitly state what is collected and how it is used.
  • Data Safety Section (Taxonomy): Traces data from code-level sources to off-device sinks to verify proper declaration in the Play Store Data Safety form. It checks the following comprehensive data types:
    • Location: Precise and Approximate location.
    • Personal Info: User IDs, Name, Email, Address, Phone number, Race/ethnicity, Political/religious beliefs, Sexual orientation, and other info.
    • Financial Info: User payment info, Purchase history, Credit score, and other financial info.
    • Health and Fitness: Health info and Fitness info.
    • Messages: Emails, SMS/MMS, and Other in-app messages.
    • Photos and Videos: User's photos and videos.
    • Audio Files: Voice/sound recordings, Music files, and Other audio files.
    • Files and Docs: User's files and documents.
    • Calendar & Contacts: Calendar events and Contacts information.
    • App Activity: App interactions, In-app search history, Installed apps, Other user-generated content, and Other actions.
    • Web Browsing: Web browsing history.
    • App Info and Performance: Crash logs, Diagnostics, and Other app performance data.
    • Device or other IDs: Device or other identifiers (e.g., IMEI, MAC address, advertising ID).

@google-cla

google-cla Bot commented Jul 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces play-policy-insights, an automated auditor tool designed to verify Android applications against Google Play Policy domains. It includes policy definitions, a scraper, a static analysis scanner, an orchestrator, and a template engine to generate compliance reports. The review feedback is highly constructive and points out several key improvements: updating the comment-stripping regex in scanner.py to preserve single-quoted strings; passing loop items directly in template_engine.py to support nested property access; filtering scraped data safety items directly against VALID_TAXONOMY in play_store_scraper.py to avoid UI artifact leakage; and adjusting _strip_inline_comment in orchestrator.py to handle literal single quotes (such as contractions) in properties files.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread play/play-policy-insights/scripts/scanner.py
Comment thread play/play-policy-insights/scripts/template_engine.py Outdated
Comment thread play/play-policy-insights/scripts/play_store_scraper.py
Comment thread play/play-policy-insights/scripts/orchestrator.py Outdated
@saswatanand
saswatanand force-pushed the play-policy-insights branch from 313ce63 to cedc37c Compare July 9, 2026 18:10
@saswatanand
saswatanand force-pushed the play-policy-insights branch from cedc37c to ae501c2 Compare July 9, 2026 18:16
saswatanand and others added 2 commits July 9, 2026 12:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
   - Update _strip_inline_comment to support optional quote delimiter tracking.
   - Disable quote tracking for .properties files to prevent literal quotes and apostrophes (e.g., "don't") from breaking subsequent comment removal.
   - Preserve quote-awareness for TOML version catalogs to ensure valid parsing of quoted strings.
Comment thread play/play-policy-insights/SKILL.md Outdated
@simona-anomis
simona-anomis requested a review from kolea2 July 10, 2026 14:35
@simona-anomis
simona-anomis merged commit aec5fcd into android:github-skills Jul 10, 2026
1 check passed
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.

3 participants