Repository navigation
Lite APK を約58 MBへ縮小 / Reduce Lite APKs to about 58 MB - #1330
Merged
Merged
Conversation
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.
日本語
Lite APK の大部分を占める辞書・索引を XZ 圧縮して同梱し、APK を約58 MBに縮小します。辞書内容とメモリマップによる検索を維持し、初回利用時に端末内へ展開します。
org.tukaani:xz:1.12をビルド側・実行側に固定し、6個の辞書・索引を圧縮します。展開サイズとSHA-256を含む決定的なマニフェストを生成します。同じ dev
0fc6a8634を起点とする署名なしのローカル release ビルドで比較しました(MB = 1,000,000 bytes)。検証済み:両Liteリリースビルド、デコーダー・展開キャッシュの単体テスト12件、既存辞書差し替えテスト63件、リリースツールのテスト19件、全6資源の展開後バイト一致、APK配置・ハッシュ検査、実際のRelease依存解決結果とライセンスカタログの照合、actionlint。
全6資源を展開すると別途65.73 MBを使用します。APKとこの展開物の合計は約124.01 MBで、その他のアプリデータ・OSの最適化領域は含みません。APKダウンロード量の削減であり、端末内の総使用量も同じだけ減る変更ではありません。
Android 17 / arm64 エミュレータ(4 GiB、2コア)の分離パッケージで検証しました。release variant、R8有効、debug署名、テストから呼ぶAPIを保持する追加ProGuardルールという条件です。各回アプリのプロセスを再起動し、初回条件では展開物を削除しました。
書込不可はキャッシュ用パスを通常ファイルにして模擬しました。その条件の計測後PSSは94,505 KiB、展開済み条件では78,972〜79,014 KiBでした。OSページキャッシュやホスト負荷は制御しておらず、エミュレータの参考値です。全画面の起動時間・候補表示遅延を測るベンチマークではありません。物理Pixel 6は接続が切れたため、この更新での実機性能は未確認です。
更新後のLinux CIも成功しました。独立したクリーンビルド2回、ソースリビジョン照合、全XZ資源の展開・ハッシュ検査、単体テスト、APKバイト一致確認を通過しています。CI APKの6資源も旧PR CIの非圧縮データと全バイト一致しました。
全画面のUI操作、Full版のネイティブビルド、公式fdroidserver環境での再ビルドは未検証です。公式F-Droidへの配布は別途更新が必要です。新しいバージョン・タグでリリースし、既存タグや公開APKを置き換えないでください。
APK・ログ・端末検証コードはすべてリポジトリ外に保存しています。
English
Compress the six large bundled dictionaries/indexes with XZ to reduce Lite APKs to approximately 58 MB. Retain dictionary contents and memory-mapped lookup by expanding assets into private storage on first use.
org.tukaani:xz:1.12; emit deterministic uncompressed sizes and SHA-256 hashes.The table above compares unsigned local release builds from dev
0fc6a8634with identical SDK/JDK settings. Both Lite APKs now build at approximately 58.28 MB.Passed: both release builds, 12 decoder/cache unit tests, 63 existing override tests, 19 release-tool tests, byte-for-byte parity of all six expanded assets, APK format/hash checks, actual release dependency/catalog validation and actionlint.
Expanding all six assets uses an additional 65.73 MB of private storage. The APK plus those copies total approximately 124.01 MB, excluding other app data and OS optimization files. This is a download-size reduction; total installed storage does not decrease by the same amount.
Validated on an isolated Android 17 arm64 emulator (4 GiB, two cores), using the release variant with R8, debug signing and additional rules retaining APIs called by instrumentation. Each run starts a new application process; the first-use condition also deletes expanded copies.
Every run verifies original English arrays, English word lookup, Japanese dictionary loading, grammar availability and sampled connection costs. The unwritable condition uses a regular file at the cache-directory path. Post-load PSS is 94,505 KiB in that fallback and 78,972–79,014 KiB in cached runs. OS page cache and host load were not controlled. These are emulator observations, not full UI or candidate-display latency measurements. The physical Pixel 6 disconnected; hardware performance for this update remains unverified.
The updated Linux CI passes two independent clean builds, source-revision checks, XZ/hash validation, unit tests and byte-for-byte APK comparison. All six expanded CI assets also match the previous PR CI's uncompressed bytes.
Full UI coverage, Full native builds and the official fdroidserver environment remain unverified. Official F-Droid distribution requires a separate update. Publish with a new version/tag rather than replacing existing assets.
APKs, logs and temporary probes stay outside the repository.