R8 receives program classes, dependencies, and keep rules. It performs shrinking, optimization, and obfuscation and produces mapping information. It is effective at removing unreachable code, reducing size, and lowering symbol readability. Reflection, serialization, JNI entry points, and generated framework code still require accurate rules.
Hardening adds controls to the APK artifact. Depending on configuration, it may restructure DEX, protect strings or native libraries, and add anti-debugging or anti-hook behavior. These changes can raise analysis cost, but they also alter packaging and execution paths. The result must be signed and tested again for installation, startup, performance, and product behavior.