{{ message }}
重构: Gpu-Image 外部化 + 清理无用代码 + 修复编辑页保存卡死#57
Merged
Conversation
- Gpu-Image vendored 模块改为 implementation 'jp.co.cyberagent.android:gpuimage:2.1.0',删除整个模块(含 4 个 .so);滤镜 import 迁到 .filter 子包 - 删除 13 个未被业务使用的 Trinea 工具类 + CameraBaseFragmentActivity + BaseFragmentActivity - GPUImageFilterTools 精简到实际使用的 NORMAL + ACV 曲线滤镜(668→81 行),并移除 PhotoProcessActivity 中已注释失效的 FilterAdjuster 调用 - 清理孤儿资源 tone_cuver_sample.acv / lookup_amatorka.png - 更新 CLAUDE.md 到当前工具链(AGP 8 / AndroidX / Java 17) ImageViewTouch 因深度耦合其 protected API 且已重打包,保留 vendored。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
targetSdk 36 分区存储下根因修复: - 保存目录由公共外部存储 Environment.getExternalStorageDirectory() 改为应用专属目录 getExternalFilesDir(),免权限、全 API 级别可写 - FileUtils.mkdir() 改用 mkdirs(),修复 mkdir 失败时 while 循环空转、导致后台保存线程死循环卡死的根因 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

概述
本 PR 做了三件事:依赖外部化、无用代码清理,以及修复图片编辑页保存卡死的 bug。所有改动均通过
./gradlew :app:compileDebugJavaWithJavac编译。改动内容
1. Gpu-Image 改为 Maven 依赖
:Gpu-Image模块(含 4 个.so,共 97 个文件),改用implementation 'jp.co.cyberagent.android:gpuimage:2.1.0'(wasabeef 维护版,AAR 自带 64 位.so)。GPUImageView/setFilter/capture()/setFromCurveFileInputStream)与 2.1.0 完全兼容;滤镜类 import 迁移到.filter子包。MyImageViewDrawableOverlay/MyHighlightView深度重写了ImageViewTouchBase的大量 protected 方法,且该 fork 已重打包为com.imagezoom,换 Maven 版需重写整个贴纸覆盖层,投入产出比差。2. 清理无用代码
AppUtils/MapUtils/NetWorkUtils/PackageUtils等)+CameraBaseFragmentActivity+ 连带变死的BaseFragmentActivity(均经全工程 grep 验证无引用)。GPUImageFilterTools精简到实际使用的 NORMAL + 14 个 ACV 曲线滤镜(668 → 81 行),移除约 68 个走不到的滤镜分支及已注释失效的FilterAdjuster。tone_cuver_sample.acv、lookup_amatorka.png。CLAUDE.md到当前真实工具链(AGP 8 / AndroidX / Java 17)。3. 修复保存卡死 bug
图片编辑页点"下一步"一直显示"图片处理中"、无法保存。根因(targetSdk 36 分区存储遗留):
WRITE_EXTERNAL_STORAGE失效、直接写必失败 → 改用应用专属目录getExternalFilesDir()(免权限、全 API 级别可写)。FileUtils.mkdir()的while (!parent.exists()) mkdir(parent)在mkdir失败时空转死循环、卡死后台保存线程 → 改用mkdirs()。验证
./gradlew :app:compileDebugJavaWithJavac编译通过。/Android/data/<包名>/files/stickercamera/,应用自带图库正常读取。已知限制(本 PR 范围外)
CAMERA在 targetSdk 36 下需运行时授权。getSystemPhotoPath())同受分区存储影响,属独立功能未在本 PR 处理。🤖 Generated with Claude Code