privacy-policy-generate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePrivacy 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:
- Scans AndroidManifest.xml for permissions and features
- Analyzes build.gradle for third-party SDKs
- Detects Health Connect integration
- Prompts for missing information
- Generates privacy policy in Markdown
- Provides GitHub Pages setup instructions
为何需要此工具:
- Google Play要求所有应用提供隐私政策URL
- 隐私政策必须托管在可公开访问、无地理限制的URL上
- 不能是PDF格式(必须为HTML或纯文本)
- 使用Health Connect的应用有额外的披露要求
此工具的功能:
- 扫描AndroidManifest.xml获取权限和功能信息
- 分析build.gradle中的第三方SDK
- 检测Health Connect集成情况
- 提示补充缺失的信息
- 生成Markdown格式的隐私政策
- 提供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
输入参数
| Input | Required | Default | Description |
|---|---|---|---|
| project_path | Yes | . | Android project root |
| developer_name | No | Prompted | Developer or company name |
| contact_email | No | Prompted | Contact 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
undefinedGet 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
undefinedHEALTH_CONNECT=$(echo "$PERMISSIONS" | grep -i "health" || echo "")
if [[ -n "$HEALTH_CONNECT" ]]; then
echo "✓ Health Connect detected"
fi
undefinedStep 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}"
undefinedCRASH_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}"
undefinedStep 3: Detect Health Connect Data Types
步骤3:检测Health Connect数据类型
If Health Connect is detected, extract data types:
bash
undefined如果检测到Health Connect,提取对应的数据类型:
bash
undefinedScan 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)"
undefinedecho "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)"
undefinedStep 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:
- Free (no ads, no purchases)
- Free with ads
- Free with in-app purchases
- Paid
- Open source Select option (1-5):
Data Storage:
- All data stays on device (no cloud sync)
- Data synced to cloud (specify service)
- Both local and cloud storage Select option (1-3):
向用户询问必要信息:
开发者/公司名称: (从git config检测到:{git config user.name}) 按回车键使用检测到的值,或输入其他名称:
联系邮箱: (从git config检测到:{git config user.email}) 按回车键使用检测到的值,或输入其他邮箱:
应用类型:
- 免费(无广告、无内购)
- 免费含广告
- 免费含内购
- 付费
- 开源 选择选项(1-5):
数据存储方式:
- 所有数据仅存储在设备本地(无云同步)
- 数据同步至云端(请指定服务)
- 同时支持本地和云端存储 选择选项(1-3):
Step 5: Generate Privacy Policy
步骤5:生成隐私政策
Create using the template:
docs/privacy-policy.mdmarkdown
undefined使用模板创建:
docs/privacy-policy.mdmarkdown
undefinedPrivacy 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
undefinedIf 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
undefinedStep 6: Create Privacy Setup Instructions
步骤6:创建隐私政策设置指南
Create :
docs/PRIVACY_SETUP.mdmarkdown
undefined创建:
docs/PRIVACY_SETUP.mdmarkdown
undefinedPrivacy Policy Setup for GitHub Pages
Privacy Policy Setup for GitHub Pages
Overview
Overview
Your privacy policy has been generated at and is ready to be hosted on GitHub Pages.
docs/privacy-policy.mdYour privacy policy has been generated at and is ready to be hosted on GitHub Pages.
docs/privacy-policy.mdSetup Steps
Setup Steps
1. Enable GitHub Pages
1. Enable GitHub Pages
- Go to your repository on GitHub
- Navigate to Settings → Pages
- Under "Source", select Deploy from a branch
- Select branch: main (or master)
- Select folder: /docs
- Click Save
- Go to your repository on GitHub
- Navigate to Settings → Pages
- Under "Source", select Deploy from a branch
- Select branch: main (or master)
- Select folder: /docs
- 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
- Open Google Play Console
- Select your app
- Go to App content → Privacy policy
- Enter the URL:
https://{USERNAME}.github.io/{REPO}/privacy-policy - Click Save
- Open Google Play Console
- Select your app
- Go to App content → Privacy policy
- Enter the URL:
https://{USERNAME}.github.io/{REPO}/privacy-policy - Click Save
Custom Domain (Optional)
Custom Domain (Optional)
If you want to use a custom domain:
-
Add afile to
CNAME:docs/privacy.yourdomain.com -
Configure DNS at your domain registrar:
- Type: CNAME
- Name: privacy (or your subdomain)
- Value: {USERNAME}.github.io
-
Update the privacy policy URL in Play Console
If you want to use a custom domain:
-
Add afile to
CNAME:docs/privacy.yourdomain.com -
Configure DNS at your domain registrar:
- Type: CNAME
- Name: privacy (or your subdomain)
- Value: {USERNAME}.github.io
-
Update the privacy policy URL in Play Console
Health Apps Declaration
Health Apps Declaration
⚠️ Important: If your app uses Health Connect, you must also:
- Go to Play Console → App content → Health
- Complete the Health Apps declaration form
- List all health data types your app accesses
- Explain how the data is used
- Confirm your privacy policy includes health data disclosure
⚠️ Important: If your app uses Health Connect, you must also:
- Go to Play Console → App content → Health
- Complete the Health Apps declaration form
- List all health data types your app accesses
- Explain how the data is used
- 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 exists on main branch
docs/privacy-policy.md
- Wait 2-3 minutes for deployment to complete
- Verify GitHub Pages is enabled in repository settings
- Check that exists on main branch
docs/privacy-policy.md
"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 to verify all requirements
/devtools:android-playstore-scan
undefinedAfter 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 to verify all requirements
/devtools:android-playstore-scan
undefinedVerification
验证步骤
MANDATORY: Run these commands:
bash
undefined**必须执行:**运行以下命令:
bash
undefinedVerify 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
输出结果
| Output | Location | Description |
|---|---|---|
| Privacy policy | docs/privacy-policy.md | Generated privacy policy |
| Setup guide | docs/PRIVACY_SETUP.md | GitHub Pages setup instructions |
| 输出项 | 位置 | 描述 |
|---|---|---|
| 隐私政策 | docs/privacy-policy.md | 生成的隐私政策 |
| 设置指南 | docs/PRIVACY_SETUP.md | GitHub 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
第三方服务链接
Common third-party services and their privacy policy URLs:
- Health Connect: https://support.google.com/android/answer/12098244
- Firebase Analytics: https://firebase.google.com/policies/analytics
- Google Analytics: https://policies.google.com/privacy
- AdMob: https://support.google.com/admob/answer/6128543
- Crashlytics: https://firebase.google.com/support/privacy
常见第三方服务及其隐私政策URL:
- Health Connect: https://support.google.com/android/answer/12098244
- Firebase Analytics: https://firebase.google.com/policies/analytics
- Google Analytics: https://policies.google.com/privacy
- AdMob: https://support.google.com/admob/answer/6128543
- Crashlytics: https://firebase.google.com/support/privacy
Troubleshooting
故障排除
"Cannot find app name"
"无法找到应用名称"
Cause: app_name not defined in strings.xml
Fix: Add to res/values/strings.xml
<string name="app_name">Your App Name</string>原因: 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 and
git config --global user.name "Your Name"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
完成标准
- exists with complete content
docs/privacy-policy.md - exists with setup instructions
docs/PRIVACY_SETUP.md - 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