carguo/gsyvideoplayer/13-gsy-proguard-r8
Claude Code and agent skill by carguo/gsyvideoplayer
- community
Checking that the SKILL.md file is still in the repository.
在启用了 R8 优化 / Full Mode / Configuration Analyzer 的项目里,为 GSYVideoPlayer 配置正确、最小面积的保留规则。
Install
npx vskill@latest install carguo/gsyvideoplayer/13-gsy-proguard-r8SKILL.md
The same SKILL.md was published earlier as carguo/gsyvideoplayer/13-gsy-proguard-r8.
gsy-proguard-r8
三个必须的反射热点
分别在源代码里:
- PlayerFactory #L11-L13 ——
Class.newInstance()反射构造IPlayerManager实现。 - CacheFactory —— 同上,构造
ICacheManager实现(见 CacheFactory)。 - GSYBaseVideoPlayer.startWindowFullscreen —— 通过
getConstructor(Context, Boolean)复刻自身,实现"全屏时另起一份 player",见 GSYBaseVideoPlayer。
推荐 proguard-rules.pro(IJK 内核,含 Media3 抑警)
完整版参照仓库当前的 proguard-rules.pro。
Aliyun 内核追加
R8 Configuration Analyzer 使用
本仓库 v14 使用 AGP 8.9.1 / Gradle 8.12,settings.gradle 已固定 R8 9.4.14。报告生成命令及历史评分边界见 R8_ANALYZER_REPORT.md。报告 HTML 可直接查看保留范围;历史本地 score.mjs 未随仓库交付,不作为接入前提。
分数对比示例
见 doc/R8_ANALYZER_REPORT.md:本项目将 -keep class com.shuyu.gsyvideoplayer.** { *; } 全量 keep 收敛成 3 条精准 keep 后,Shrinking / Optimization / Obfuscation 三档分数、live class/method 数、APK 尺寸对比。
校验清单(发版前)
| 步骤 | 命令/操作 | |
|---|---|---|
| release 构建 | ./gradlew :app:assembleRelease | |
| 直接安装真机 | adb install -r app/build/outputs/apk/release/*.apk | |
| 手动跑主流程 | 详情播放 → 全屏 → 手势 → seek → 缓存命中 → 列表 → 广告 → 投屏(若集成) | |
| logcat | adb logcat -s System.err AndroidRuntime GSYVideoPlayer 无 ClassNotFoundException / NoSuchMethodException |
常见崩溃 -> 规则映射
| 崩溃症状 | 原因 | 增补规则 | |
|---|---|---|---|
NoSuchMethodException: xxxVideoPlayer.<init>(Context, Boolean) | 未保留自定义 View 的 Boolean 构造 | -keep class * extends GSYBaseVideoPlayer 那条 | |
InstantiationException on switching kernel | Manager 实现类被去除或改名 | -keep class * implements IPlayerManager | |
UnsatisfiedLinkError libijkplayer.so | ijkplayer JNI 回调找不到 Java 类 | -keep class tv.danmaku.ijk.media.player.** { *; } | |
ClassNotFoundException: androidx.media3...* | Exo/Media3 未抑警且 aar consumer 未生效 | -dontwarn androidx.media3.** + 检查 aar 是否 include | |
| List 页 seek 后 seek 失效 | 序列化模型被混淆 | 保留 Serializable / Parcelable |
常见坑
- 用
-allowaccessmodification+Full Mode时,父子类构造器可见性会被改写;-keep <init>一定要写。 consumer-rules.pro只在 aar 打包时打入,本地源码模块不生效;如果 SDK 是源码依赖,需要把 keep 规则同时放到 appproguard-rules.pro。- Media3 aar 会覆盖旧的
com.google.android.exoplayer2.**,两者规则并存无害,但只用其一时可只保留对应-dontwarn。
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/13-gsy-proguard-r8/SKILL.md
Popularity
- Repository stars
- 21,490
- Repository forks
- 4,315
- 7-day trend score
- 50
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/carguo/gsyvideoplayer/13-gsy-proguard-r8)