privacy-policy-generate

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Privacy Policy Generator

隐私政策生成器

Generates a comprehensive privacy policy for Android apps by scanning the project and creating a GitHub Pages-ready Markdown document.
通过扫描项目并创建可直接用于GitHub Pages的Markdown文档,为Android应用生成全面的隐私政策。

Overview

概述

Why this is needed:
  • Google Play requires a privacy policy URL for all apps
  • Privacy policy must be on a publicly accessible, non-geofenced URL
  • Cannot be a PDF (must be HTML or plain text)
  • Health Connect apps have additional disclosure requirements
What this skill does:
  1. Scans AndroidManifest.xml for permissions and features
  2. Analyzes build.gradle for third-party SDKs
  3. Detects Health Connect integration
  4. Prompts for missing information
  5. Generates privacy policy in Markdown
  6. Provides GitHub Pages setup instructions
为何需要此工具:
  • Google Play要求所有应用提供隐私政策URL
  • 隐私政策必须托管在可公开访问、无地理限制的URL上
  • 不能是PDF格式(必须为HTML或纯文本)
  • 使用Health Connect的应用有额外的披露要求
此工具的功能:
  1. 扫描AndroidManifest.xml获取权限和功能信息
  2. 分析build.gradle中的第三方SDK
  3. 检测Health Connect集成情况
  4. 提示补充缺失的信息
  5. 生成Markdown格式的隐私政策
  6. 提供GitHub Pages的设置指南

Prerequisites

前提条件

  • Android project with AndroidManifest.xml
  • Git repository (for GitHub Pages hosting)
  • Build configuration files (build.gradle.kts)
  • 包含AndroidManifest.xml的Android项目
  • Git仓库(用于GitHub Pages托管)
  • 构建配置文件(build.gradle.kts)

Inputs

输入参数

InputRequiredDefaultDescription
project_pathYes.Android project root
developer_nameNoPromptedDeveloper or company name
contact_emailNoPromptedContact email address
输入项是否必填默认值描述
project_path.Android项目根目录
developer_name需用户输入开发者或公司名称
contact_email需用户输入联系邮箱

Process

操作流程

Step 1: Scan Project for App Information

步骤1:扫描项目获取应用信息

Extract from AndroidManifest.xml:
bash
undefined
从AndroidManifest.xml提取信息:
bash
undefined

Get package name

Get package name

PACKAGE_NAME=$(grep "package=" app/src/main/AndroidManifest.xml | head -1 | sed 's/.package="([^"])".*/\1/') echo "Package: $PACKAGE_NAME"
PACKAGE_NAME=$(grep "package=" app/src/main/AndroidManifest.xml | head -1 | sed 's/.package="([^"])".*/\1/') echo "Package: $PACKAGE_NAME"

Get app name (from strings.xml)

Get app name (from strings.xml)

APP_NAME=$(grep 'name="app_name"' app/src/main/res/values/strings.xml | sed 's/.>([^<])<.*/\1/') echo "App name: $APP_NAME"
APP_NAME=$(grep 'name="app_name"' app/src/main/res/values/strings.xml | sed 's/.>([^<])<.*/\1/') echo "App name: $APP_NAME"

Check for permissions

Check for permissions

echo "Scanning permissions..." PERMISSIONS=$(grep "<uses-permission" app/src/main/AndroidManifest.xml | sed 's/.android:name="([^"])".*/\1/')
echo "Scanning permissions..." PERMISSIONS=$(grep "<uses-permission" app/src/main/AndroidManifest.xml | sed 's/.android:name="([^"])".*/\1/')

Check for Health Connect

Check for Health Connect

HEALTH_CONNECT=$(echo "$PERMISSIONS" | grep -i "health" || echo "") if [[ -n "$HEALTH_CONNECT" ]]; then echo "✓ Health Connect detected" fi
undefined
HEALTH_CONNECT=$(echo "$PERMISSIONS" | grep -i "health" || echo "") if [[ -n "$HEALTH_CONNECT" ]]; then echo "✓ Health Connect detected" fi
undefined

Step 2: Analyze Third-Party SDKs

步骤2:分析第三方SDK

Scan build.gradle.kts for common libraries:
bash
echo "Scanning dependencies..."
扫描build.gradle.kts中的常见库:
bash
echo "Scanning dependencies..."

Check for analytics

Check for analytics

ANALYTICS="" grep -q "firebase-analytics" app/build.gradle.kts && ANALYTICS="$ANALYTICS Firebase Analytics," grep -q "google-analytics" app/build.gradle.kts && ANALYTICS="$ANALYTICS Google Analytics,"
ANALYTICS="" grep -q "firebase-analytics" app/build.gradle.kts && ANALYTICS="$ANALYTICS Firebase Analytics," grep -q "google-analytics" app/build.gradle.kts && ANALYTICS="$ANALYTICS Google Analytics,"

Check for ads

Check for ads

ADS="" grep -q "admob" app/build.gradle.kts && ADS="$ADS AdMob," grep -q "facebook-ads" app/build.gradle.kts && ADS="$ADS Facebook Audience Network,"
ADS="" grep -q "admob" app/build.gradle.kts && ADS="$ADS AdMob," grep -q "facebook-ads" app/build.gradle.kts && ADS="$ADS Facebook Audience Network,"

Check for crash reporting

Check for crash reporting

CRASH_REPORTING="" grep -q "crashlytics" app/build.gradle.kts && CRASH_REPORTING="$CRASH_REPORTING Firebase Crashlytics,"
echo "Analytics: ${ANALYTICS:-None}" echo "Ads: ${ADS:-None}" echo "Crash reporting: ${CRASH_REPORTING:-None}"
undefined
CRASH_REPORTING="" grep -q "crashlytics" app/build.gradle.kts && CRASH_REPORTING="$CRASH_REPORTING Firebase Crashlytics,"
echo "Analytics: ${ANALYTICS:-None}" echo "Ads: ${ADS:-None}" echo "Crash reporting: ${CRASH_REPORTING:-None}"
undefined

Step 3: Detect Health Connect Data Types

步骤3:检测Health Connect数据类型

If Health Connect is detected, extract data types:
bash
undefined
如果检测到Health Connect,提取对应的数据类型:
bash
undefined

Scan for Health Connect permission declarations

Scan for Health Connect permission declarations

HEALTH_PERMISSIONS=$(grep "health.permission" app/src/main/AndroidManifest.xml || echo "")
HEALTH_PERMISSIONS=$(grep "health.permission" app/src/main/AndroidManifest.xml || echo "")

Common Health Connect data types

Common Health Connect data types

echo "Health data types detected:" echo "$HEALTH_PERMISSIONS" | grep -i "STEPS" && echo " - Steps (read/write)" echo "$HEALTH_PERMISSIONS" | grep -i "HEART_RATE" && echo " - Heart rate (read)" echo "$HEALTH_PERMISSIONS" | grep -i "SLEEP" && echo " - Sleep sessions (read)" echo "$HEALTH_PERMISSIONS" | grep -i "EXERCISE" && echo " - Exercise sessions (read/write)"
undefined
echo "Health data types detected:" echo "$HEALTH_PERMISSIONS" | grep -i "STEPS" && echo " - Steps (read/write)" echo "$HEALTH_PERMISSIONS" | grep -i "HEART_RATE" && echo " - Heart rate (read)" echo "$HEALTH_PERMISSIONS" | grep -i "SLEEP" && echo " - Sleep sessions (read)" echo "$HEALTH_PERMISSIONS" | grep -i "EXERCISE" && echo " - Exercise sessions (read/write)"
undefined

Step 4: Prompt User for Missing Information

步骤4:提示用户补充缺失信息

Ask user for required information:
Developer/Company Name: (Detected from git config: {git config user.name}) Press Enter to use detected value, or type a different name:
Contact Email: (Detected from git config: {git config user.email}) Press Enter to use detected value, or type a different email:
App Type:
  1. Free (no ads, no purchases)
  2. Free with ads
  3. Free with in-app purchases
  4. Paid
  5. Open source Select option (1-5):
Data Storage:
  1. All data stays on device (no cloud sync)
  2. Data synced to cloud (specify service)
  3. Both local and cloud storage Select option (1-3):
向用户询问必要信息:
开发者/公司名称: (从git config检测到:{git config user.name}) 按回车键使用检测到的值,或输入其他名称:
联系邮箱: (从git config检测到:{git config user.email}) 按回车键使用检测到的值,或输入其他邮箱:
应用类型:
  1. 免费(无广告、无内购)
  2. 免费含广告
  3. 免费含内购
  4. 付费
  5. 开源 选择选项(1-5):
数据存储方式:
  1. 所有数据仅存储在设备本地(无云同步)
  2. 数据同步至云端(请指定服务)
  3. 同时支持本地和云端存储 选择选项(1-3):

Step 5: Generate Privacy Policy

步骤5:生成隐私政策

Create
docs/privacy-policy.md
using the template:
markdown
undefined
使用模板创建
docs/privacy-policy.md
markdown
undefined

Privacy Policy for {APP_NAME}

Privacy Policy for {APP_NAME}

Last updated: {CURRENT_DATE}
{DEVELOPER_NAME} built the {APP_NAME} app as {APP_TYPE}. This SERVICE is provided at no cost and is intended for use as is.
Last updated: {CURRENT_DATE}
{DEVELOPER_NAME} built the {APP_NAME} app as {APP_TYPE}. This SERVICE is provided at no cost and is intended for use as is.

Information Collection and Use

Information Collection and Use

For a better experience while using our Service, we may require you to provide us with certain personally identifiable information. The information that we request will be retained on your device and is not collected by us in any way.
{IF HEALTH_CONNECT}
For a better experience while using our Service, we may require you to provide us with certain personally identifiable information. The information that we request will be retained on your device and is not collected by us in any way.
{IF HEALTH_CONNECT}

Health Data

Health Data

This app integrates with Health Connect to access your health and fitness data.
Health Data Types Accessed: {HEALTH_DATA_TYPES_LIST}
Purpose: This app collects health data to {HEALTH_PURPOSE}.
Data Storage: {DATA_STORAGE_DESCRIPTION}
Data Sharing: Your health data is not shared with third parties. {/IF}
{IF THIRD_PARTY_SERVICES}
This app integrates with Health Connect to access your health and fitness data.
Health Data Types Accessed: {HEALTH_DATA_TYPES_LIST}
Purpose: This app collects health data to {HEALTH_PURPOSE}.
Data Storage: {DATA_STORAGE_DESCRIPTION}
Data Sharing: Your health data is not shared with third parties. {/IF}
{IF THIRD_PARTY_SERVICES}

Third-Party Services

Third-Party Services

This app uses the following third-party services:
{THIRD_PARTY_LIST} {/IF}
{IF ADS}
This app uses the following third-party services:
{THIRD_PARTY_LIST} {/IF}
{IF ADS}

Advertising

Advertising

This app displays advertisements using {AD_NETWORKS}. These services may collect information about your device and usage patterns. {/IF}
This app displays advertisements using {AD_NETWORKS}. These services may collect information about your device and usage patterns. {/IF}

Log Data

Log Data

In case of an error in the app, we collect data called Log Data. This Log Data may include information such as your device's Internet Protocol ("IP") address, device name, operating system version, the configuration of the app, the time and date of your use of the Service, and other statistics.
In case of an error in the app, we collect data called Log Data. This Log Data may include information such as your device's Internet Protocol ("IP") address, device name, operating system version, the configuration of the app, the time and date of your use of the Service, and other statistics.

Security

Security

We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and we cannot guarantee its absolute security.
We value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and we cannot guarantee its absolute security.

Children's Privacy

Children's Privacy

This Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from children under 13.
This Service does not address anyone under the age of 13. We do not knowingly collect personally identifiable information from children under 13.

Changes to This Privacy Policy

Changes to This Privacy Policy

We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page.
We may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. We will notify you of any changes by posting the new Privacy Policy on this page.

Contact Us

Contact Us

If you have any questions or suggestions about our Privacy Policy, do not hesitate to contact us at: {CONTACT_EMAIL}

This privacy policy is hosted on GitHub Pages
undefined
If you have any questions or suggestions about our Privacy Policy, do not hesitate to contact us at: {CONTACT_EMAIL}

This privacy policy is hosted on GitHub Pages
undefined

Step 6: Create Privacy Setup Instructions

步骤6:创建隐私政策设置指南

Create
docs/PRIVACY_SETUP.md
:
markdown
undefined
创建
docs/PRIVACY_SETUP.md
markdown
undefined

Privacy Policy Setup for GitHub Pages

Privacy Policy Setup for GitHub Pages

Overview

Overview

Your privacy policy has been generated at
docs/privacy-policy.md
and is ready to be hosted on GitHub Pages.
Your privacy policy has been generated at
docs/privacy-policy.md
and is ready to be hosted on GitHub Pages.

Setup Steps

Setup Steps

1. Enable GitHub Pages

1. Enable GitHub Pages

  1. Go to your repository on GitHub
  2. Navigate to SettingsPages
  3. Under "Source", select Deploy from a branch
  4. Select branch: main (or master)
  5. Select folder: /docs
  6. Click Save
  1. Go to your repository on GitHub
  2. Navigate to SettingsPages
  3. Under "Source", select Deploy from a branch
  4. Select branch: main (or master)
  5. Select folder: /docs
  6. Click Save

2. Wait for Deployment

2. Wait for Deployment

GitHub Pages will automatically build and deploy your site. This usually takes 1-2 minutes.
You can check the deployment status under Actions tab.
GitHub Pages will automatically build and deploy your site. This usually takes 1-2 minutes.
You can check the deployment status under Actions tab.

3. Verify Privacy Policy URL

3. Verify Privacy Policy URL

Once deployed, your privacy policy will be available at:
https://{USERNAME}.github.io/{REPO}/privacy-policy
Test the URL in your browser to confirm it's accessible.
Once deployed, your privacy policy will be available at:
https://{USERNAME}.github.io/{REPO}/privacy-policy
Test the URL in your browser to confirm it's accessible.

4. Add URL to Play Console

4. Add URL to Play Console

  1. Open Google Play Console
  2. Select your app
  3. Go to App contentPrivacy policy
  4. Enter the URL:
    https://{USERNAME}.github.io/{REPO}/privacy-policy
  5. Click Save
  1. Open Google Play Console
  2. Select your app
  3. Go to App contentPrivacy policy
  4. Enter the URL:
    https://{USERNAME}.github.io/{REPO}/privacy-policy
  5. Click Save

Custom Domain (Optional)

Custom Domain (Optional)

If you want to use a custom domain:
  1. Add a
    CNAME
    file to
    docs/
    :
    privacy.yourdomain.com
  2. Configure DNS at your domain registrar:
    • Type: CNAME
    • Name: privacy (or your subdomain)
    • Value: {USERNAME}.github.io
  3. Update the privacy policy URL in Play Console
If you want to use a custom domain:
  1. Add a
    CNAME
    file to
    docs/
    :
    privacy.yourdomain.com
  2. Configure DNS at your domain registrar:
    • Type: CNAME
    • Name: privacy (or your subdomain)
    • Value: {USERNAME}.github.io
  3. Update the privacy policy URL in Play Console

Health Apps Declaration

Health Apps Declaration

⚠️ Important: If your app uses Health Connect, you must also:
  1. Go to Play Console → App contentHealth
  2. Complete the Health Apps declaration form
  3. List all health data types your app accesses
  4. Explain how the data is used
  5. Confirm your privacy policy includes health data disclosure
⚠️ Important: If your app uses Health Connect, you must also:
  1. Go to Play Console → App contentHealth
  2. Complete the Health Apps declaration form
  3. List all health data types your app accesses
  4. Explain how the data is used
  5. Confirm your privacy policy includes health data disclosure

Troubleshooting

Troubleshooting

"404 Not Found"

"404 Not Found"

  • Wait 2-3 minutes for deployment to complete
  • Verify GitHub Pages is enabled in repository settings
  • Check that
    docs/privacy-policy.md
    exists on main branch
  • Wait 2-3 minutes for deployment to complete
  • Verify GitHub Pages is enabled in repository settings
  • Check that
    docs/privacy-policy.md
    exists on main branch

"Privacy policy URL required"

"Privacy policy URL required"

  • Ensure URL is publicly accessible (not behind login)
  • URL must use HTTPS
  • Cannot be a PDF or editable document
  • Ensure URL is publicly accessible (not behind login)
  • URL must use HTTPS
  • Cannot be a PDF or editable document

Next Steps

Next Steps

After privacy policy is live:
  • Test the URL is publicly accessible
  • Add URL to Play Console
  • Complete other Play Console requirements (content rating, data safety, etc.)
  • Run
    /devtools:android-playstore-scan
    to verify all requirements
undefined
After privacy policy is live:
  • Test the URL is publicly accessible
  • Add URL to Play Console
  • Complete other Play Console requirements (content rating, data safety, etc.)
  • Run
    /devtools:android-playstore-scan
    to verify all requirements
undefined

Verification

验证步骤

MANDATORY: Run these commands:
bash
undefined
**必须执行:**运行以下命令:
bash
undefined

Verify privacy policy created

Verify privacy policy created

test -f docs/privacy-policy.md && echo "✓ Privacy policy created"
test -f docs/privacy-policy.md && echo "✓ Privacy policy created"

Verify setup guide created

Verify setup guide created

test -f docs/PRIVACY_SETUP.md && echo "✓ Setup guide created"
test -f docs/PRIVACY_SETUP.md && echo "✓ Setup guide created"

Check privacy policy contains required sections

Check privacy policy contains required sections

grep -q "Privacy Policy" docs/privacy-policy.md && echo "✓ Title present" grep -q "Contact" docs/privacy-policy.md && echo "✓ Contact info present"
grep -q "Privacy Policy" docs/privacy-policy.md && echo "✓ Title present" grep -q "Contact" docs/privacy-policy.md && echo "✓ Contact info present"

Check for Health Connect section if applicable

Check for Health Connect section if applicable

if grep -q "health.permission" app/src/main/AndroidManifest.xml; then grep -q "Health Data" docs/privacy-policy.md && echo "✓ Health data section present" fi

**Expected output:**
- ✓ Privacy policy created
- ✓ Setup guide created
- ✓ Title present
- ✓ Contact info present
- (✓ Health data section present - if Health Connect is used)
if grep -q "health.permission" app/src/main/AndroidManifest.xml; then grep -q "Health Data" docs/privacy-policy.md && echo "✓ Health data section present" fi

**预期输出:**
- ✓ Privacy policy created
- ✓ Setup guide created
- ✓ Title present
- ✓ Contact info present
- (✓ Health data section present - if Health Connect is used)

Outputs

输出结果

OutputLocationDescription
Privacy policydocs/privacy-policy.mdGenerated privacy policy
Setup guidedocs/PRIVACY_SETUP.mdGitHub Pages setup instructions
输出项位置描述
隐私政策docs/privacy-policy.md生成的隐私政策
设置指南docs/PRIVACY_SETUP.mdGitHub Pages设置说明

Templates

模板

Health Connect Data Purpose Examples

Health Connect数据用途示例

For the health data purpose section, use one of these based on user input:
  • Fitness tracking: "to track your fitness activities and provide insights into your health patterns"
  • Health monitoring: "to monitor your health metrics and help you achieve your wellness goals"
  • Data sync: "to sync your health data across devices"
  • Custom: User provides their own description
针对健康数据用途部分,可根据用户输入选择以下示例之一:
  • 健身追踪: "用于追踪您的健身活动,为您提供健康模式分析"
  • 健康监测: "用于监测您的健康指标,帮助您实现健康目标"
  • 数据同步: "用于在多设备间同步您的健康数据"
  • 自定义: 用户自行提供描述

Third-Party Service Links

第三方服务链接

Troubleshooting

故障排除

"Cannot find app name"

"无法找到应用名称"

Cause: app_name not defined in strings.xml Fix: Add
<string name="app_name">Your App Name</string>
to res/values/strings.xml
原因: strings.xml中未定义app_name 解决方法: 在res/values/strings.xml中添加
<string name="app_name">您的应用名称</string>

"Git config not found"

"未找到Git配置"

Cause: Git user not configured Fix: Run
git config --global user.name "Your Name"
and
git config --global user.email "email@example.com"
原因: 未配置Git用户信息 解决方法: 运行
git config --global user.name "您的姓名"
git config --global user.email "email@example.com"

"Health permissions not detected"

"未检测到健康权限"

Cause: Health Connect permissions not declared in manifest Fix: Verify permissions are correctly declared in AndroidManifest.xml
原因: AndroidManifest.xml中未声明Health Connect权限 解决方法: 确认权限已正确声明在AndroidManifest.xml中

Play Console Requirements

Google Play Console要求

Your privacy policy MUST:
  • ✅ Be hosted on a publicly accessible URL (HTTPS)
  • ✅ Be non-editable (static page is fine)
  • ✅ Not be a PDF
  • ✅ Not be geofenced (accessible worldwide)
  • ✅ Include health data disclosure (if using Health Connect)
  • ✅ Be linked from your app or store listing
您的隐私政策必须:
  • ✅ 托管在可公开访问的HTTPS URL上
  • ✅ 不可编辑(静态页面即可)
  • ✅ 不能是PDF格式
  • ✅ 无地理限制(全球可访问)
  • ✅ 若使用Health Connect,需包含健康数据披露内容
  • ✅ 可从应用或商店列表跳转访问

Completion Criteria

完成标准

  • docs/privacy-policy.md
    exists with complete content
  • docs/PRIVACY_SETUP.md
    exists with setup instructions
  • Privacy policy includes all detected features (Health Connect, ads, etc.)
  • Developer name and contact email are correct
  • Privacy policy reviewed and customized as needed
  • Ready to enable GitHub Pages
  • docs/privacy-policy.md
    已存在且内容完整
  • docs/PRIVACY_SETUP.md
    已存在且包含设置说明
  • 隐私政策包含所有检测到的功能(Health Connect、广告等)
  • 开发者名称和联系邮箱正确无误
  • 隐私政策已审核并按需自定义
  • 已准备好启用GitHub Pages