fix(desktop): disable ProGuard optimization entirely — fixes kmp-tor crash

Disabling individual sub-passes (method/specialization/returntype,
method/marking/static) was not sufficient. The interaction between
multiple optimization passes causes IncompatibleClassChangeError in
kmp-tor's AsyncFs.of() at launch. Shrink (dead code removal) stays
ON for the size win; only optimize is disabled.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
nrobi144
2026-05-19 10:11:11 +03:00
parent 487dd3f2ac
commit 5ad21b6acd
+13 -18
View File
@@ -107,28 +107,23 @@
-keep class okio.** { *; } -keep class okio.** { *; }
# ============================================================================ # ============================================================================
# Optimize sub-pass — disable the one that produces invalid okio bytecode # Optimization — disabled entirely
# ============================================================================ # ============================================================================
# ProGuard's `method/specialization/returntype` pass specialised # ProGuard's optimize pass causes multiple runtime crashes in the release
# `Okio__OkioKt.buffer(Source): BufferedSource` to a synthetic bridge # build that are invisible at compile time:
# `buffer$<hash>` whose declared return type was the more concrete
# `RealBufferedSource` while the bytecode body returned the
# `BufferedSource` super-interface. The JVM verifier rejected the bridge:
# #
# VerifyError: Bad return type # 1. `method/specialization/returntype` generates invalid okio bytecode:
# Exception Details: # VerifyError on Okio__OkioKt.buffer() (bridge return type mismatch).
# Location: okio/Okio__OkioKt.buffer$5ae116e(...)
# Reason: Type 'okio/BufferedSource' is not assignable to
# 'okio/RealBufferedSource'.
# #
# Disabling just these sub-passes keeps merging, inlining, peephole and # 2. kmp-tor's `AsyncFs.of()` gets transformed (instance static or
# dead-code optimizations on. Everything else in `optimize` stays. # inlined call-site mismatch), causing IncompatibleClassChangeError
# at launch. Discovered by CI smoke test (release-deb-launch job).
# #
# `method/marking/static` converts instance methods to static when they # Disabling individual sub-passes (`!method/specialization/returntype`,
# don't reference `this`. kmp-tor's `AsyncFs.of()` is called via # `!method/marking/static`) did not fully resolve (2). The interaction
# invokevirtual; after ProGuard marks it static the JVM throws # between multiple optimization passes is the root cause. Shrink (dead
# IncompatibleClassChangeError at launch (discovered by CI smoke test). # code removal) remains ON and provides the bulk of the size win.
-optimizations !method/specialization/returntype,!method/marking/static -dontoptimize
# ============================================================================ # ============================================================================
# Desktop-only: Jackson mobile module does not ship Jackson on Android # Desktop-only: Jackson mobile module does not ship Jackson on Android