From 96d25be53ee0d445514862e140c8154dbcea4191 Mon Sep 17 00:00:00 2001 From: Ponshu Developer Date: Tue, 17 Feb 2026 00:21:54 +0900 Subject: [PATCH] docs: Add --obfuscate flag to APK build command in distribution guide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add --obfuscate and --split-debug-info options to the release build command. These options harden the APK against reverse engineering by obfuscating class/function names and separating debug symbols from the APK binary. Also add a plain build option for quick verification. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- docs/DISTRIBUTION_API_KEY_SETUP.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/DISTRIBUTION_API_KEY_SETUP.md b/docs/DISTRIBUTION_API_KEY_SETUP.md index 5afcc02..fab5757 100644 --- a/docs/DISTRIBUTION_API_KEY_SETUP.md +++ b/docs/DISTRIBUTION_API_KEY_SETUP.md @@ -117,11 +117,23 @@ android { ### 6. 配布 APK のビルド ```cmd -flutter build apk --release --dart-define=GEMINI_API_KEY=AIzaSy...(配布用キー) +flutter build apk --release ^ + --dart-define=GEMINI_API_KEY=AIzaSy...(配布用キー) ^ + --obfuscate ^ + --split-debug-info=build\debug-info ``` +- `--obfuscate`: クラスや関数名を難読化し、逆コンパイル時に解析されにくくする +- `--split-debug-info`: デバッグシンボルを APK 本体から分離して保存(APK サイズ削減) + - `build\debug-info` フォルダは git 管理外でよい(ローカルに保持しておく) + 出力ファイル: `build\app\outputs\flutter-apk\app-release.apk` +> 難読化なしの簡易ビルド(動作確認用): +> ```cmd +> flutter build apk --release --dart-define=GEMINI_API_KEY=AIzaSy...(配布用キー) +> ``` + --- ## 配布方法 @@ -162,7 +174,7 @@ Google Cloud Console で **アラート** を設定しておくことを推奨: - [ ] リリースキーストア(`ponshu_release.jks`)を作成 - [ ] `android/key.properties` にパスワードを設定 - [ ] キーストアと key.properties が `.gitignore` に含まれていることを確認 -- [ ] `flutter build apk --release --dart-define=GEMINI_API_KEY=<配布用キー>` で APK ビルド +- [ ] `flutter build apk --release --dart-define=GEMINI_API_KEY=<配布用キー> --obfuscate --split-debug-info=build\debug-info` で APK ビルド - [ ] テスト端末でインストール・動作確認 ---