Draft: Removes keep rules and adds optimized resource shrinking #198
Draft: Removes keep rules and adds optimized resource shrinking #198
Conversation
Summary of ChangesHello @AjeshRPai, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on optimizing the application's build size and performance by refining ProGuard/R8 configurations. It streamlines the build process by eliminating unnecessary code retention rules and activating advanced resource shrinking capabilities, leading to a more compact and efficient final application package. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to reduce the application size by removing redundant ProGuard keep rules and enabling optimized resource shrinking. The changes include enabling android.r8.optimizedResourceShrinking, adding R8 optimizations for Kotlin intrinsics, and removing several broad keep rules. While these changes are beneficial for optimization, I've raised a concern about the aggressive removal of keep rules in watchface/proguard-rules.pro. Specifically, removing rules for libraries like BouncyCastle and APK Signer, which are known to use reflection, poses a significant risk of runtime crashes. It's crucial to verify that these rules are genuinely redundant before merging.
I am having trouble creating individual review comments. Click here to see my feedback.
watchface/proguard-rules.pro (11-34)
Removing these -keep rules is a high-risk change. Libraries like BouncyCastle, APK Signer, and various XML parsers are often used via reflection, and removing their -keep rules can lead to ClassNotFoundException or other reflection-related crashes at runtime. The comments in the original file for BouncyCastle even explicitly state this. While the goal of removing redundant rules is good, it's critical to ensure these are truly redundant (e.g., because the libraries now ship with their own consumer ProGuard rules). Otherwise, these rules should be restored to prevent potential runtime failures.
This PR fixes #165 by