# Shrink And Protect The Android Release Build

> Why the Android release build isn't the build you tested, and what R8 changes in the app.

- URL: https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/05-testing-security-release/lesson-03-shrink-and-guard-release-build
- Course: [Mobile Action Pro](https://dantech.academy/en/courses/kotlin-accelerator.md)
- Module: Testing, Security, and Release
- Duration: 10 min
- Difficulty: intermediate
- Access: Enrolled students
- Tiếng Việt: https://dantech.academy/courses/kotlin-accelerator/engineer-builder/05-testing-security-release/lesson-03-shrink-and-guard-release-build.md

## Objectives

- Compare the debug and release build types: R8, resource shrinking and the signing guard
- Explain why direct references in AppFeatures.kt need no keep rules
- Check which rules actually reach R8 with -printconfiguration

## In this lesson

1. Lesson Goal
2. Part 1: Release Is A Different Program
3. Part 2: Direct References Need No Keep Rules
4. Part 3: Read The Rule File Section By Section
5. Part 4: Which Rules Actually Reach R8?
6. Code Reading Path
7. Common Misconceptions
8. References
9. Key Points

## Study with an AI agent

The full lesson is for students of this course. Students open the lesson on the web and press **Markdown** to copy all of it, then paste it into Claude, ChatGPT, Cursor or whichever agent you use. Faster: mint a token at `/profile/ai-agents` and your agent reads lessons over MCP.

- [Join the course](https://dantech.academy/en/kotlin-accelerator/checkout)

---

- Previous lesson: [Test Flows And ViewModels](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/05-testing-security-release/lesson-02-test-flows-and-viewmodels.md)
- Next lesson: [Protect Secrets In The Build (Android + iOS)](https://dantech.academy/en/courses/kotlin-accelerator/engineer-builder/05-testing-security-release/lesson-04-protect-secrets-at-build-time.md)
