Visitar URL original
build: DEX code optimization by jesmrec · Pull Request #5032 · owncloud/android · GitHub
Skip to content

build: DEX code optimization - #5032

Open
jesmrec wants to merge 10 commits into
masterfrom
technical/dex_code_optimisation
Open

jesmrec wants to merge 10 commits into
masterfrom
technical/dex_code_optimisation

Conversation

@jesmrec

@jesmrec jesmrec commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Related Issues

App:

  • Add changelog files for the fixed issues in folder changelog/unreleased. More info here
  • Add feature to Release Notes in ReleaseNotesViewModel.kt creating a new ReleaseNote() with String resources (if required)

QA

@jesmrec jesmrec linked an issue Oct 22, 2026 that may be closed by this pull request
@jesmrec
jesmrec force-pushed the technical/dex_code_optimisation branch from 67de337 to 5c03059 Compare October 22, 2026 08:30
Signed-off-by: Jesus Recio <jrecio@izertis.com>
@jesmrec
jesmrec force-pushed the technical/dex_code_optimisation branch from 5c03059 to f7b313a Compare October 22, 2026 08:32
Signed-off-by: Jesus Recio <jrecio@izertis.com>
Signed-off-by: Jesus Recio <jrecio@izertis.com>
Signed-off-by: Jesus Recio <jrecio@izertis.com>
@jesmrec
jesmrec force-pushed the technical/dex_code_optimisation branch from ea37b6c to 1bb4116 Compare October 22, 2026 12:24
@jesmrec
jesmrec marked this pull request as ready for review October 22, 2026 12:33
@jesmrec
jesmrec requested a review from a team as a code owner October 22, 2026 12:33
@joragua joragua changed the title fix: DEX code optimization build: DEX code optimization Oct 23, 2026
@joragua

joragua commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Regarding proguard.cfg, should it also be removed when adding the new file? It doesn't appear to be used anywhere in the project, unless I'm missing something @jesmrec

@jesmrec

jesmrec commented Oct 26, 2026 •

Copy link
Copy Markdown
Member Author

Regarding proguard.cfg, should it also be removed when adding the new file? It doesn't appear to be used anywhere in the project, unless I'm missing something @jesmrec

you're right, it's not referenced apart of very old and not maintained. The current file should be enough. Removing it.

Signed-off-by: Jesus Recio <jrecio@izertis.com>
Signed-off-by: Jesus Recio <jrecio@izertis.com>
Signed-off-by: Jesus Recio <jrecio@izertis.com>
Signed-off-by: Jesus Recio <jrecio@izertis.com>
…members

Signed-off-by: Jesus Recio <jrecio@izertis.com>
@jesmrec

jesmrec commented Oct 26, 2026

Copy link
Copy Markdown
Member Author

Extra updates:

  • AppRegistryProvider class does not have @JsonClass annotation. It is serialized to JSON by KotlinJsonAdapterFactory and stored as a plain string in the app_providers Room column. Without this rule, R8 renames its fields, making stored JSON unstable across releases and causing app providers to silently disappear after an app update.

  • Replace all rules about classes extending androidx.preference.PreferenceFragmentCompat for a wildcard, so that, any newly created class extending will be also covered by the rule.

  • The four custom view keep rules in proguard-rules.pro were deleted because the Android build tools (AAPT) already generate exactly those rules automatically by scanning the layout XML files. Removed to avoid that duplication

  • The Moshi rule was changed from -keep @JsonClass class * { *; } to -keepnames @JsonClass class *. The old rule prevented R8 from removing any member of every Moshi model class, blocking the shrinking that was the whole point of enabling R8; the new rule only prevents renaming, which is all that's actually needed to keep JSON field mapping working.

Signed-off-by: Jesus Recio <jrecio@izertis.com>
@jesmrec

jesmrec commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

New update:

  • Classes inside of com.owncloud.android.lib.common.http.logging were data classes with no @JsonClass, so the existing -keepnames @JsonClass rule doesn't cover them.

@joragua joragua left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Let's move it to QA 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TECHNICAL] DEX code optimisation is below Google threshold

2 participants