build: update AndroidX, Material, Gson, coroutines, guava, desugar#10
Conversation
Routine dependency bumps (compileSdk 35-compatible): - kotlinx-coroutines 1.6.4 -> 1.8.1 - core-ktx 1.9.0 -> 1.13.1 - recyclerview 1.3.0 -> 1.3.2 - fragment-ktx 1.5.6 -> 1.8.5 - browser 1.5.0 -> 1.8.0 - constraintlayout 2.1.4 -> 2.2.0 - navigation 2.5.3 -> 2.8.5 - preference-ktx 1.2.0 -> 1.2.1 - appcompat 1.6.1 -> 1.7.0 - work 2.8.1 -> 2.9.1 - material 1.8.0 -> 1.12.0 - gson 2.9.0 -> 2.11.0 - guava 31.0.1 -> 33.4.0-android - desugar_jdk_libs 2.0.3 -> 2.1.3 Held: kryo (profile serialization), ini4j, process-phoenix, zxing-lite, blacksquircle, material-about-library, swiperefreshlayout, activity-ktx.
WorkManager 2.9 replaced the getWorkManagerConfiguration() method with a workManagerConfiguration property on Configuration.Provider.
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughDependency versions in ChangesDependency and WorkManager Updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
|
@coderabbitai full review Please focus on AndroidX/Material/coroutines compatibility with compileSdk 35, the WorkManager 2.9 Configuration.Provider property migration in SagerNet.kt, and any API breaks. Note: dependency versions were specifically chosen to stay compileSdk-35-compatible (avoided releases requiring compileSdk 36). kryo intentionally held (serialization). Both debug and release builds pass on the builder. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "=== app/build.gradle.kts ==="
cat app/build.gradle.kts
echo ""
echo "=== SagerNet.kt (search) ==="
fd -i "SagerNet.kt" --exec cat {}
echo ""
echo "=== WorkManager Configuration.Provider usage ==="
rg -n "Configuration" --type kotlin -C 5
echo ""
echo "=== coroutines usage patterns ==="
rg -n "coroutines\|GlobalScope\|CoroutineScope\|Dispatchers" --type kotlin -C 2 | head -80
echo ""
echo "=== navigation safe-args or NavController usage ==="
rg -n "NavController\|navigate\|findNavController\|NavigationUI" --type kotlin -C 2 | head -60
echo ""
echo "=== WorkManager enqueue/getConfiguration usage ==="
rg -n "WorkManager\|WorkRequest\|getWorkManagerConfiguration\|workManagerConfiguration" --type kotlin -C 3 | head -80Length of output: 52114
Review:
|
| Dependency | New version | compileSdk-35 safe? | Note |
|---|---|---|---|
appcompat:1.7.0 |
1.7.0 | ✅ | 1.8.0 requires SDK 36 — correctly avoided |
core-ktx:1.13.1 |
1.13.1 | ✅ | 1.15+ requires SDK 36 — correctly avoided |
work-runtime-ktx:2.9.1 |
2.9.1 | ✅ | 2.10 requires SDK 36 — correctly avoided |
navigation:2.8.5 |
2.8.5 | ✅ | |
fragment-ktx:1.8.5 |
1.8.5 | ✅ | activity-ktx:1.10.1 satisfies transitive requirement |
material:1.12.0 |
1.12.0 | ✅ | |
constraintlayout:2.2.0 |
2.2.0 | ✅ | |
guava:33.4.0-android |
33.4.0 | ✅ | Correct -android variant (not -jre) |
desugar_jdk_libs:2.1.3 |
2.1.3 | ✅ | Matches isCoreLibraryDesugaringEnabled = true |
✅ No SafeArgs / Navigation API Break
No SafeArgs plugin is declared in the plugins {} block (com.android.application, kotlin-android, ksp, kotlin-parcelize only). Navigation 2.8's new type-safe @Serializable route API is opt-in; @IdRes-based navigate() remains fully supported. No action needed.
✅ Fragment 1.8.5 — Predictive Back Compatibility
MainActivity already uses onBackPressedDispatcher.addCallback {} (the modern pattern) with no legacy override fun onBackPressed(). Fragment 1.8's predictive back integration is fully compatible. ✅
✅ Coroutines 1.8.1
DEBUG_PROPERTY_NAME and DEBUG_PROPERTY_VALUE_ON (used in SagerNet.onCreate()) remain stable public API in 1.8.1. No removals or deprecation breaks relevant to this codebase.
⚠️ Advisory: Gson 2.11.0 — Default Float Serialization Behavior Change
Gson 2.10+ changed the default behavior: NaN and ±Infinity are no longer serialized without explicitly enabling them via GsonBuilder().serializeSpecialFloatingPointValues(). If any profile data, subscription parsing, or config export code passes NaN/Infinity through a default Gson() instance, it will now throw IllegalArgumentException at runtime instead of silently encoding a non-standard JSON token.
This won't be caught by the build but could surface in runtime profile handling. It is worth scanning Gson instantiation sites for Gson() vs GsonBuilder() usage. Since kryo is intentionally held for profile serialization, the blast radius is limited — but subscription/config JSON paths may use Gson directly.
Summary
| Area | Result |
|---|---|
WorkManager 2.9 Configuration.Provider property migration |
✅ Correct |
| compileSdk 35 compatibility for all 14 bumps | ✅ Confirmed |
| API breaks across all bumped libs | ✅ None found |
| Navigation 2.8.5 (no SafeArgs) | ✅ Safe |
| Fragment 1.8.5 back handling | ✅ Compatible |
| Coroutines 1.8.1 | ✅ No breaks |
| Gson 2.11.0 special float default |
The PR is well-scoped and the only item requiring attention is the Gson advisory above.
✅ Action performed
Full review finished.
|
Re: Gson 2.11.0 NaN/Infinity advisory — assessed, no change needed. Both central Gson instances (JavaUtil.gson and SingBoxOptions.gsonSingbox) and the ad-hoc Gson() uses (V2RayFmt VMess QR) only ever serialize VPN config values: ports, timeouts, mbps, packet sizes, UUIDs, strings — all finite integers/doubles parsed from JSON/YAML/URI subscription input. There is no code path that produces Float.NaN or +/-Infinity to serialize, so the Gson 2.10+ stricter default cannot be triggered here. Adding serializeSpecialFloatingPointValues() would be defensive code for an input that cannot occur. Documented as an accepted no-op. Profile persistence uses kryo (intentionally held), not Gson, so profile data is unaffected. |
Summary
Routine app-dependency bumps (third of the split dependency PRs). All chosen to remain
compatible with the current
compileSdk 35.Source change required
WorkManager 2.9 replaced
Configuration.Provider.getWorkManagerConfiguration()(method)with a
workManagerConfiguration(property). UpdatedSagerNet.ktaccordingly. This wasthe only API break across all the bumps.
Intentionally held
kryo5.2.1 — backs profile serialization wire format; not bumped to avoid data-format risk.activity-ktx1.10.1 — already current.swiperefreshlayout1.1.0 — latest stable.ini4j,process-phoenix,zxing-lite,blacksquircle.*,material-about-library—left as-is to keep the surface controlled.
compileSdk 35-compatible (newer core/appcompat/workreleases that require compileSdk 36 were avoided).
Verification (AWS Linux builder)
./gradlew app:assembleOssDebug— BUILD SUCCESSFUL../gradlew app:assembleOssRelease— BUILD SUCCESSFUL (R8 minify, lintVital withwarningsAsErrors=true, resource shrinking, desugaring all pass).Scope
app/build.gradle.kts(14 version bumps) +SagerNet.kt(WorkManager API adaptation).No compileSdk/Kotlin/AGP/Gradle changes, no kryo/serialization changes.
Runtime testing note
Build-verified only (emulator blocked by EC2 vCPU quota; increase pending). These are
UI/utility libraries; batched runtime QA planned once emulator capacity exists.