Skip to content

feat(orpheus): use kotlin serialization instead of gson#196

Merged
roitium merged 1 commit into
devfrom
refactor/use-kotlin-serialization
Feb 2, 2026
Merged

feat(orpheus): use kotlin serialization instead of gson#196
roitium merged 1 commit into
devfrom
refactor/use-kotlin-serialization

Conversation

@roitium
Copy link
Copy Markdown
Collaborator

@roitium roitium commented Feb 2, 2026

Summary by CodeRabbit

发行说明

  • 重构

    • 更新 JSON 序列化库,优化数据处理性能。
  • 琐事

    • 更新核心依赖版本至 0.11.3。
    • 移除无用补丁和配置。

✏️ Tip: You can customize this high-level summary in your review settings.

@roitium roitium added the enhancement New feature or request label Feb 2, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bbplayer-docs Ready Ready Preview, Comment Feb 2, 2026 1:55am

@safedep
Copy link
Copy Markdown

safedep Bot commented Feb 2, 2026

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon @nandorojo/galeria @ 2.0.2
apps/mobile/package.json pnpm-lock.yaml
ok icon
ok icon
ok icon
🔗

This report is generated by SafeDep Github App

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 2, 2026

Caution

Review failed

The pull request is closed.

演进总览

此PR将Expo Orpheus模块的JSON序列化从Gson库迁移至Kotlinx Serialization。涵盖Kotlin序列化插件配置、依赖更新、Android模型类及工具函数的序列化注解改造。

变更内容

任务组/文件 摘要
Kotlin序列化插件配置
apps/mobile/app.config.ts, apps/mobile/expo-plugins/withKotlinSerialization.js
新增Expo插件withKotlinSerialization,在Gradle编译配置中自动注入kotlin-serialization classpath依赖。
Orpheus序列化库迁移
packages/orpheus/android/build.gradle, packages/orpheus/android/src/main/java/expo/modules/orpheus/ExpoOrpheusModule.kt, packages/orpheus/android/src/main/java/expo/modules/orpheus/util/GeneralStorage.kt, packages/orpheus/android/src/main/java/expo/modules/orpheus/util/TrackRecordExtension.kt
将Gson.toJson/fromJson替换为Json.encodeToString/decodeFromString;移除Gson依赖,新增org.jetbrains.kotlinx:kotlinx-serialization-json和retrofit2-kotlinx-serialization-converter。
数据模型序列化标记
packages/orpheus/android/src/main/java/expo/modules/orpheus/bilibili/BilibiliModels.kt, packages/orpheus/android/src/main/java/expo/modules/orpheus/model/LyricsModels.kt, packages/orpheus/android/src/main/java/expo/modules/orpheus/model/TrackRecord.kt
添加@serializable和@SerialName注解至所有数据类及字段;为可选字段补充null默认值。
网络层序列化配置
packages/orpheus/android/src/main/java/expo/modules/orpheus/bilibili/NetworkModule.kt
更新Retrofit配置,用Json.asConverterFactory()替代GsonConverterFactory。
版本与依赖更新
packages/orpheus/CHANGELOG.md, packages/orpheus/package.json, apps/mobile/package.json
Orpheus版本号0.11.2→0.11.3;@nandorojo/galeria依赖^2.0.0→^2.0.2。
补丁与配置清理
patches/@nandorojo__galeria.patch, pnpm-workspace.yaml, tsconfig.json
移除galeria补丁文件及patchedDependencies配置;删除外部播放列表同步的tsconfig引用。

代码审查工作量评估

🎯 4 (复杂) | ⏱️ ~45 分钟

可能相关的PR

  • BBPlayer#193:同样修改Orpheus Android代码库,包括BilibiliModels.kt、NetworkModule.kt及build.gradle序列化/网络配置相关改动。

诗歌

🐰 胡萝卜序列化之歌
Gson远去,Kotlinx来临,
模型披上@serializable新装,
Json轻声低唱encodeToString,
插件自动注入,兔毛飘扬,
序列化的魔法,数据更纯净✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/use-kotlin-serialization

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@roitium roitium merged commit f94619f into dev Feb 2, 2026
3 of 5 checks passed
@roitium roitium deleted the refactor/use-kotlin-serialization branch February 2, 2026 01:55
roitium added a commit that referenced this pull request Feb 8, 2026
* fix(mobile): fix version code getter logic

* Merge pull request #193 from bbplayer-app/feat/nitro-fetch

* fix(orpheus, mobile): disable usesCleartextTraffic, only allow hdslb.com use http

* fix(mobile): disable r8

* fix(mobile): update proguard rules and enable R8

* chore(mobile): disable r8

* fix(mobile): r8 made @nandrorjo/galeria raise error

* feat: sync external playlist (#194)

* feat(mobile): e2e (#195)

* feat(mobile): 1 (#196)

* fix(mobile): add more current state check

I don't know why, but I hope it will work.

* feat(mobile): some improvements (#198)

* feat(orpheus): enhance backend retention capabilities

* fix(mobile): player page setpage

* fix(orpheus): allow androidx.media3.player wrapping in REPEAT_MODE_ONE (#199)

* fix(orpheus): allow androidx.media3.player wrapping in REPEAT_MODE_ONE

* chore(mobile): update changelog

---------

Co-authored-by: roitium <65794453+roitium@users.noreply.github.com>

* feat(mobile): improve playlist UI (#200)

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): verbatim lyrics (#201)

* feat(mobile, splash): improve verbatim lyrics

* perf(mobile): improve verbatim lyrics perf

* fix(mobile): player slider cannot slide

* fix(mobile): react compiler in PlayerLyrics

* chore(mobile): remove reanimated logger config

* chore(mobile): edit changelog

* fix(mobile): desktop lyrics not work

* feat(mobile): add firebase analytics integration (#203)

* fix(mobile): improve UI on small screen devices

* perf(mobile): some perf improvements

* feat(mobile): firebase

* feat(mobile): add firebase analytics track

* chore(mobile): update privacy

* chore(mobile): use firebase analytics new api

* chore(root): move some libraries

* fix(mobile): type

* chore(root, mobile): update package.json

* chore(docs): update docs

* chore(docs): update docs

* chore(docs): update docs

* chore(root): wiki

* chore(root): wiki

* chore(orpheus): wiki

* feat(mobile): danmaku (#205)

* feat(mobile): implement bilibili danmaku api

* fix(mobile): use `useWindowDimensions` instead of `Dimensions.get`

* feat(mobile): implement

* fix(mobile): 1

* chore(mobile): bump version

* chore(mobile): update changelog

* ci(mobile): wrong secret key

* fix(root): ci not work

* chore(root): just make sure

* chore(root): remove unnecessary easignore

* chore(root): remove unnecessary easignore

* chore(root): update update json

---------

Co-authored-by: Deyu Wang <kvtoDev@outlook.com>
roitium added a commit that referenced this pull request Feb 9, 2026
* fix(mobile): fix version code getter logic

* Merge pull request #193 from bbplayer-app/feat/nitro-fetch

* fix(orpheus, mobile): disable usesCleartextTraffic, only allow hdslb.com use http

* fix(mobile): disable r8

* fix(mobile): update proguard rules and enable R8

* chore(mobile): disable r8

* fix(mobile): r8 made @nandrorjo/galeria raise error

* feat: sync external playlist (#194)

* feat(mobile): e2e (#195)

* feat(mobile): 1 (#196)

* fix(mobile): add more current state check

I don't know why, but I hope it will work.

* feat(mobile): some improvements (#198)

* feat(orpheus): enhance backend retention capabilities

* fix(mobile): player page setpage

* fix(orpheus): allow androidx.media3.player wrapping in REPEAT_MODE_ONE (#199)

* fix(orpheus): allow androidx.media3.player wrapping in REPEAT_MODE_ONE

* chore(mobile): update changelog

---------

Co-authored-by: roitium <65794453+roitium@users.noreply.github.com>

* feat(mobile): improve playlist UI (#200)

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): 1

* feat(mobile): verbatim lyrics (#201)

* feat(mobile, splash): improve verbatim lyrics

* perf(mobile): improve verbatim lyrics perf

* fix(mobile): player slider cannot slide

* fix(mobile): react compiler in PlayerLyrics

* chore(mobile): remove reanimated logger config

* chore(mobile): edit changelog

* fix(mobile): desktop lyrics not work

* feat(mobile): add firebase analytics integration (#203)

* fix(mobile): improve UI on small screen devices

* perf(mobile): some perf improvements

* feat(mobile): firebase

* feat(mobile): add firebase analytics track

* chore(mobile): update privacy

* chore(mobile): use firebase analytics new api

* chore(root): move some libraries

* fix(mobile): type

* chore(root, mobile): update package.json

* chore(docs): update docs

* chore(docs): update docs

* chore(docs): update docs

* chore(root): wiki

* chore(root): wiki

* chore(orpheus): wiki

* feat(mobile): danmaku (#205)

* feat(mobile): implement bilibili danmaku api

* fix(mobile): use `useWindowDimensions` instead of `Dimensions.get`

* feat(mobile): implement

* fix(mobile): 1

* chore(mobile): bump version

* chore(mobile): update changelog

* ci(mobile): wrong secret key

* fix(root): ci not work

* chore(root): just make sure

* chore(root): remove unnecessary easignore

* chore(root): remove unnecessary easignore

* chore(root): update update json

* fix(mobile): auto compile protobuf when prepare

* chore(root): update app screenshots

* fix(mobile): player controls button not work (#208)

* fix(mobile): remove player page animation (#212)

* fix(mobile): remove player page animation

* chore(mobile): bump version

* fix(mobile): cover

* chore(mobile): Bump version to 2.3.1 and update release URL

Updated version and URL for the release notes.

---------

Co-authored-by: Deyu Wang <kvtoDev@outlook.com>
@coderabbitai coderabbitai Bot mentioned this pull request Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant