初始提交:浩瑞(HaoRui)头条自动化工程

- app/:Kotlin 全部源码、AndroidManifest 与资源
- docs/:技术文档、UI 原型、回归清单
- img/:文档引用的对照规格截图
- scripts/:环境加载与回归统计脚本
- 构建配置:Gradle 入口脚本与属性
- 新增 .gitignore:排除工具链、构建缓存、临时产物与本机配置

Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
2026-11-06 17:26:51 +08:00
co-authored by Claude Code
commit e497d36ba1
69 changed files with 16651 additions and 0 deletions
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
浩瑞启动图标背景 —— 品牌紫渐变
深浅紫斜向渐变,托住前景的白色小机器人,增加立体感与精致度。
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#8A6BF0"
android:centerColor="#6E58DC"
android:endColor="#5237B8"
android:angle="135" />
</shape>
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
浩瑞启动图标前景 —— 「眨眼小机器人」
设计意图(幽默风趣):
一只会眨眼的萌系小机器人,胸口带播放键 ——
寓意「手机自己干活,我只负责可爱」。
眨眼(wink)是幽默点:偷偷告诉你它替你干完活了。
造型要点:圆润、大眼、腮红、天线,小尺寸下依旧清晰可辨。
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<!-- 天线:线 + 顶端小球 -->
<path
android:pathData="M54,34 L54,26"
android:strokeColor="#FFFFFF"
android:strokeWidth="4"
android:strokeLineCap="round" />
<path
android:fillColor="#FFE066"
android:pathData="M54,18 m-5,0 a5,5 0 1,0 10,0 a5,5 0 1,0 -10,0" />
<!-- 头部(圆角方形) -->
<path
android:fillColor="#FFFFFF"
android:pathData="M34,36
Q34,30 40,30
L68,30
Q74,30 74,36
L74,58
Q74,64 68,64
L40,64
Q34,64 34,58 Z" />
<!-- 左眼(圆睁) -->
<path
android:fillColor="#3B2E6E"
android:pathData="M45,45 m-5,0 a5,5 0 1,0 10,0 a5,5 0 1,0 -10,0" />
<!-- 左眼高光(呆萌) -->
<path
android:fillColor="#FFFFFF"
android:pathData="M47,43 m-1.8,0 a1.8,1.8 0 1,0 3.6,0 a1.8,1.8 0 1,0 -3.6,0" />
<!-- 右眼:眨眼(横线,幽默点) -->
<path
android:pathData="M59,45 L69,45"
android:strokeColor="#3B2E6E"
android:strokeWidth="4"
android:strokeLineCap="round" />
<!-- 腮红(可爱) -->
<path
android:fillColor="#FF9EC4"
android:pathData="M37,53 m-4,0 a4,3 0 1,0 8,0 a4,3 0 1,0 -8,0" />
<path
android:fillColor="#FF9EC4"
android:pathData="M71,53 m-4,0 a4,3 0 1,0 8,0 a4,3 0 1,0 -8,0" />
<!-- 微笑 -->
<path
android:pathData="M46,54 Q54,61 62,54"
android:strokeColor="#3B2E6E"
android:strokeWidth="3.2"
android:strokeLineCap="round" />
<!-- 身体(圆角方形) -->
<path
android:fillColor="#FFFFFF"
android:pathData="M38,68
Q38,64 42,64
L66,64
Q70,64 70,68
L70,86
Q70,90 66,90
L42,90
Q38,90 38,86 Z" />
<!-- 胸口播放键(代表自动播放/发布) -->
<path
android:fillColor="#6E58DC"
android:pathData="M51,71 L63,78 L51,85 Z" />
<!-- 小手臂(俏皮) -->
<path
android:pathData="M38,74 L32,80"
android:strokeColor="#FFFFFF"
android:strokeWidth="4.5"
android:strokeLineCap="round" />
<path
android:pathData="M70,74 L76,80"
android:strokeColor="#FFFFFF"
android:strokeWidth="4.5"
android:strokeLineCap="round" />
</vector>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#6E58DC</color>
</resources>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">浩瑞</string>
<string name="a11y_label">浩瑞自动发布</string>
<string name="a11y_description">浩瑞需要无障碍权限来自动化操作今日头条 18.3.0:滑动信息流、打开卡片、复制链接、填写标题、点击发布。所有操作仅在你主动启动后执行。</string>
</resources>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
浩瑞主题基座
色值锚点:原产品 styles.xml 的 colorAccent #6e58dc / statusBarColor #f5f5f5
-->
<resources>
<style name="Theme.HaoRui" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:fontFamily">sans</item>
<item name="android:colorAccent">#6E58DC</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item>
</style>
</resources>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
浩瑞无障碍服务配置
对照原产品 res/xml/accessibility_service_config.xml
-->
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:accessibilityEventTypes="typeWindowStateChanged|typeWindowContentChanged|typeViewClicked"
android:accessibilityFeedbackType="feedbackGeneric"
android:accessibilityFlags="flagReportViewIds|flagIncludeNotImportantViews|flagRetrieveInteractiveWindows"
android:canPerformGestures="true"
android:canRetrieveWindowContent="true"
android:canTakeScreenshot="true"
android:description="@string/a11y_description"
android:notificationTimeout="100"
android:settingsActivity="com.haorui.app.MainActivity" />
+32
View File
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
浩瑞 · FileProvider 路径配置
用途:把下载的视频文件(file://)转成 content:// URI,
供 ACTION_SEND 分享给头条发布器。
⚠️ Android 7+ 禁止跨应用传递 file:// URI(FileUriExposedException),
必须走 FileProvider。对照原产品 ToutiaoAccessibilityService.p2():
type.putExtra("android.intent.extra.STREAM", uri)
其 mediaUri 为 content:// 形态。
路径对应 VideoDownloader.videoDir:
context.getExternalFilesDir("videos") + "/videos/"
= /storage/emulated/0/Android/data/com.haorui.app/files/videos/videos/
-->
<paths>
<!-- 对应 context.getExternalFilesDir("videos"),其下含 videos/ 子目录 -->
<external-files-path
name="videos"
path="videos/" />
<!-- 兜底:内部 files 目录(getExternalFilesDir 返回 null 时的回落位置) -->
<files-path
name="internal_videos"
path="videos/" />
<!-- 日志导出(LogExporter.generateExportFile → cacheDir/export/) -->
<cache-path
name="export"
path="export/" />
</paths>