Greenstand / Greenstand/treetracker-android
Fix overly permissive ProGuard/R8 keep rule
- Dominant language
- Kotlin
- Stars
- 101
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
## Problem
`proguard-rules.pro` lines 35-37 contain:
```
-keep class * {
public private *;
}
```
This keeps **ALL** classes and all their public/private members, effectively defeating R8's dead code elimination, class merging, and name obfuscation. This significantly increases APK size and prevents optimization.
## Location
- `app/proguard-rules.pro` lines 35-37
## Suggested Fix
Remove the overly broad rule and replace with specific keep rules only for classes that are accessed via reflection or JNI. The existing AWS SDK, kotlinx-serialization, and AndroidX rules already cover the known reflection cases.
```diff
- -keep class * {
- public private *;
- }
```
**Important:** This change requires thorough testing of the release build to ensure no runtime `ClassNotFoundException` or `NoSuchMethodError` occurs. Test all major flows (login, tree capture, sync, messages) with the release/minified APK.
## Effort
Medium (requires thorough release build testing)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with app/proguard-rules.pro lines 35-37 and review the existing AWS SDK, kotlinx-serialization, and AndroidX rules. Remove the broad keep rule, build the release/minified APK, and test login, tree capture, sync, and messages. Done means these flows work without ClassNotFoundException or NoSuchMethodError and the APK retains the intended R8 optimization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- build-system, mobile
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100