diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 7ffdad2..7a77105 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -36,6 +36,11 @@
android:name=".SettingsActivity"
android:exported="false"
android:screenOrientation="portrait" />
+
\ No newline at end of file
diff --git a/app/src/main/java/com/example/app/MainActivity.kt b/app/src/main/java/com/example/app/MainActivity.kt
index 4d13cb6..1899f86 100644
--- a/app/src/main/java/com/example/app/MainActivity.kt
+++ b/app/src/main/java/com/example/app/MainActivity.kt
@@ -1,16 +1,41 @@
package com.example.app
import android.content.Intent
+import android.content.SharedPreferences
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
+
+ private lateinit var sharedPreferences: SharedPreferences
+
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
-
- // 启动综合相机Activity
- startActivity(Intent(this, CameraActivity::class.java))
+
+ sharedPreferences = getSharedPreferences("app_preferences", MODE_PRIVATE)
+
+ // 检查用户是否已同意隐私政策
+ val privacyAccepted = sharedPreferences.getBoolean("privacy_accepted", false)
+
+ if (privacyAccepted) {
+ // 已同意,直接进入相机界面
+ startCameraActivity()
+ } else {
+ // 未同意,显示隐私政策
+ showPrivacyPolicy()
+ }
+ }
+
+ private fun startCameraActivity() {
+ val intent = Intent(this, CameraActivity::class.java)
+ startActivity(intent)
finish() // 关闭MainActivity,避免返回键回到空白页面
}
+
+ private fun showPrivacyPolicy() {
+ val intent = Intent(this, PrivacyPolicyActivity::class.java)
+ startActivity(intent)
+ finish() // 关闭MainActivity,隐私政策页面会处理后续流程
+ }
}
diff --git a/app/src/main/java/com/example/app/PrivacyPolicyActivity.kt b/app/src/main/java/com/example/app/PrivacyPolicyActivity.kt
new file mode 100644
index 0000000..0e1ceca
--- /dev/null
+++ b/app/src/main/java/com/example/app/PrivacyPolicyActivity.kt
@@ -0,0 +1,267 @@
+package com.example.app
+
+import android.content.Intent
+import android.content.SharedPreferences
+import android.os.Bundle
+import android.webkit.WebView
+import android.widget.Button
+import androidx.appcompat.app.AppCompatActivity
+import androidx.appcompat.widget.Toolbar
+
+class PrivacyPolicyActivity : AppCompatActivity() {
+
+ private lateinit var sharedPreferences: SharedPreferences
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_privacy_policy)
+
+ sharedPreferences = getSharedPreferences("app_preferences", MODE_PRIVATE)
+
+ // 设置Toolbar
+ val toolbar: Toolbar = findViewById(R.id.toolbar)
+ setSupportActionBar(toolbar)
+ supportActionBar?.setDisplayHomeAsUpEnabled(true)
+ toolbar.setNavigationOnClickListener {
+ onBackPressed()
+ }
+
+ val webView: WebView = findViewById(R.id.privacyWebView)
+ val agreeButton: Button = findViewById(R.id.agreeButton)
+ val disagreeButton: Button = findViewById(R.id.disagreeButton)
+
+ // 设置按钮点击事件
+ agreeButton.setOnClickListener {
+ savePrivacyAcceptance(true)
+ startCameraActivity()
+ }
+
+ disagreeButton.setOnClickListener {
+ savePrivacyAcceptance(false)
+ finish() // 不同意则退出应用
+ }
+
+ // 加载隐私政策HTML内容
+ val privacyPolicyHtml = """
+
+
+
+
+
+
+
+
+ 最后更新日期:2025年2月11日
+
+ LogCam 隐私政策
+
+
+
欢迎使用 LogCam(以下简称"本应用")。我们高度重视您的隐私保护,并致力于保护您的个人信息安全。本隐私政策旨在说明我们如何收集、使用、存储和保护您的个人信息。
+
+
+
重要提示:请仔细阅读本隐私政策。使用本应用即表示您同意本隐私政策的条款。如果您不同意本政策,请停止使用本应用。
+
+
+
+
+
1. 信息收集
+
本应用在以下情况下会收集信息:
+
+
1.1 相机权限
+
当您使用拍照功能时,本应用需要访问您的设备相机。我们仅使用相机权限来:
+
+ - 预览相机画面
+ - 拍摄照片
+ - 添加水印(如选择水印模式)
+
+
我们不会:通过相机权限录制视频、进行人脸识别或收集任何生物特征信息。
+
+
1.2 存储权限
+
当您保存照片时,本应用需要访问设备存储。我们仅使用存储权限来:
+
+ - 将拍摄的照片保存到您的设备相册
+ - 读取已保存的照片进行合成处理(如选择合成模式)
+
+
所有照片都保存在您的设备本地,我们不会将您的照片上传到任何服务器。
+
+
1.3 设备信息
+
我们可能会收集以下匿名设备信息用于应用优化:
+
+ - 设备型号
+ - Android 版本
+ - 应用使用情况统计(功能使用频率)
+
+
这些信息都是匿名的,无法识别您的个人身份。
+
+
+
+
2. 信息使用
+
我们收集的信息仅用于以下目的:
+
+ - 提供核心拍照功能
+ - 改进应用性能和用户体验
+ - 修复应用错误和问题
+ - 统计分析应用使用情况
+
+
+
+
+
3. 信息存储
+
3.1 本地存储
+
所有拍摄的照片都存储在您的设备本地,具体位置为:
+
+ - 内部存储 → Pictures/LogCam 目录
+ - 或您选择的其他位置
+
+
+
3.2 数据安全
+
我们采取合理的技术措施保护您的信息:
+
+ - 照片仅存储在设备本地
+ - 不收集敏感个人信息
+ - 遵循最小必要原则收集信息
+
+
+
+
+
4. 信息共享
+
我们不会与任何第三方共享您的个人信息或照片。具体包括:
+
+ - 不将照片上传到云端
+ - 不向广告商提供个人信息
+ - 不与第三方分析工具共享可识别信息
+
+
+
+
+
5. 第三方服务
+
本应用使用了以下第三方库,这些库可能会收集匿名信息:
+
+ - CameraX:Google提供的相机库,用于相机功能
+ - AndroidX:Google提供的Android扩展库
+
+
这些库的使用遵循其各自的隐私政策,但我们确保它们不会收集您的个人照片或可识别信息。
+
+
+
+
6. 儿童隐私
+
本应用不面向13岁以下儿童设计。我们不会有意收集儿童的个人信息。如果您是家长或监护人,并发现您的孩子向我们提供了个人信息,请通过以下联系方式与我们联系,我们将尽快删除这些信息。
+
+
+
+
7. 权限管理
+
您可以在设备的设置中随时管理本应用的权限:
+
+ - 前往"设置" → "应用" → "LogCam" → "权限"
+ - 您可以随时授予或撤销相机、存储等权限
+ - 撤销权限可能会影响部分功能的正常使用
+
+
+
+
+
8. 隐私政策更新
+
我们可能会不时更新本隐私政策。更新后的隐私政策将在本页面发布,并在应用内通知您。建议您定期查看本隐私政策以了解任何更改。
+
+
+
+
+
+ """.trimIndent()
+
+ webView.loadDataWithBaseURL(
+ null,
+ privacyPolicyHtml,
+ "text/html",
+ "UTF-8",
+ null
+ )
+
+ // 自动滚动到底部,确保用户看到同意按钮
+ webView.postDelayed({
+ webView.scrollTo(0, webView.contentHeight)
+ }, 500)
+ }
+
+ private fun savePrivacyAcceptance(accepted: Boolean) {
+ val editor = sharedPreferences.edit()
+ editor.putBoolean("privacy_accepted", accepted)
+ editor.apply()
+ }
+
+ private fun startCameraActivity() {
+ val intent = Intent(this, CameraActivity::class.java)
+ startActivity(intent)
+ finish()
+ }
+
+ override fun onBackPressed() {
+ // 不允许通过返回键跳过隐私政策
+ // 显示提示信息
+ android.app.AlertDialog.Builder(this)
+ .setTitle("提示")
+ .setMessage("您需要同意隐私政策才能使用本应用")
+ .setPositiveButton("确定", null)
+ .show()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_arrow_back.xml b/app/src/main/res/drawable/ic_arrow_back.xml
new file mode 100644
index 0000000..ff760b5
--- /dev/null
+++ b/app/src/main/res/drawable/ic_arrow_back.xml
@@ -0,0 +1,10 @@
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_privacy_policy.xml b/app/src/main/res/layout/activity_privacy_policy.xml
new file mode 100644
index 0000000..5cf128b
--- /dev/null
+++ b/app/src/main/res/layout/activity_privacy_policy.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index e88c0b3..88eb283 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -8,4 +8,6 @@
#FF000000
#FFFFFFFF
#FF6200EE
+ #FF9E9E9E
+ #FF6200EE
\ No newline at end of file