Skip to content

Migrate optimization DSL - #378

Merged
Goooler merged 1 commit into
trunkfrom
g/new-minify-dsl
Jul 29, 2026
Merged

Migrate optimization DSL#378
Goooler merged 1 commit into
trunkfrom
g/new-minify-dsl

Conversation

@Goooler

@Goooler Goooler commented Jul 29, 2026

Copy link
Copy Markdown
Owner

https://developer.android.com/topic/performance/app-optimization/enable-app-optimization#enable

λ diff configuration-old.txt configuration-new.txt
93,117d92
< # The proguard configuration file for the following section is /Users/goooler/StudioProjects/Tabby/androidApp/proguard-rules.pro
< -verbose
< -allowaccessmodification
<
< -keepattributes SourceFile,
<                 LineNumberTable
<
< -renamesourcefileattribute SourceFile
<
< -dontobfuscate
<
< # Remove some Kotlin overhead
< -processkotlinnullchecks remove
<
<
< # Hardcode in core/src/main/cpp/main.c.JNI_OnLoad
< -keep class kotlin.Unit
< -keep interface kotlinx.coroutines.CompletableDeferred
<
< # https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposeRuntimeFlags#isLinkBufferComposerEnabled()
< -assumevalues public class androidx.compose.runtime.ComposeRuntimeFlags {
<     static boolean isLinkBufferComposerEnabled return true;
< }
<
< # End of content from /Users/goooler/StudioProjects/Tabby/androidApp/proguard-rules.pro
1320a1296,1320
> # The proguard configuration file for the following section is Local project :androidApp::androidApp (extracted file: /Users/goooler/StudioProjects/Tabby/androidApp/src/main/keepRules/proguard-rules.keep)
> -verbose
> -allowaccessmodification
>
> -keepattributes SourceFile,
>                 LineNumberTable
>
> -renamesourcefileattribute SourceFile
>
> -dontobfuscate
>
> # Remove some Kotlin overhead
> -processkotlinnullchecks remove
>
>
> # Hardcode in core/src/main/cpp/main.c.JNI_OnLoad
> -keep class kotlin.Unit
> -keep interface kotlinx.coroutines.CompletableDeferred
>
> # https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposeRuntimeFlags#isLinkBufferComposerEnabled()
> -assumevalues public class androidx.compose.runtime.ComposeRuntimeFlags {
>     static boolean isLinkBufferComposerEnabled return true;
> }
>
> # End of content from Local project :androidApp::androidApp (extracted file: /Users/goooler/StudioProjects/Tabby/androidApp/src/main/keepRules/proguard-rules.keep)

https://developer.android.com/topic/performance/app-optimization/enable-app-optimization#enable

```diff
λ diff configuration-old.txt configuration-new.txt
93,117d92
< # The proguard configuration file for the following section is /Users/goooler/StudioProjects/Tabby/androidApp/proguard-rules.pro
< -verbose
< -allowaccessmodification
<
< -keepattributes SourceFile,
<                 LineNumberTable
<
< -renamesourcefileattribute SourceFile
<
< -dontobfuscate
<
< # Remove some Kotlin overhead
< -processkotlinnullchecks remove
<
<
< # Hardcode in core/src/main/cpp/main.c.JNI_OnLoad
< -keep class kotlin.Unit
< -keep interface kotlinx.coroutines.CompletableDeferred
<
< # https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposeRuntimeFlags#isLinkBufferComposerEnabled()
< -assumevalues public class androidx.compose.runtime.ComposeRuntimeFlags {
<     static boolean isLinkBufferComposerEnabled return true;
< }
<
< # End of content from /Users/goooler/StudioProjects/Tabby/androidApp/proguard-rules.pro
1320a1296,1320
> # The proguard configuration file for the following section is Local project :androidApp::androidApp (extracted file: /Users/goooler/StudioProjects/Tabby/androidApp/src/main/keepRules/proguard-rules.keep)
> -verbose
> -allowaccessmodification
>
> -keepattributes SourceFile,
>                 LineNumberTable
>
> -renamesourcefileattribute SourceFile
>
> -dontobfuscate
>
> # Remove some Kotlin overhead
> -processkotlinnullchecks remove
>
>
> # Hardcode in core/src/main/cpp/main.c.JNI_OnLoad
> -keep class kotlin.Unit
> -keep interface kotlinx.coroutines.CompletableDeferred
>
> # https://developer.android.com/reference/kotlin/androidx/compose/runtime/ComposeRuntimeFlags#isLinkBufferComposerEnabled()
> -assumevalues public class androidx.compose.runtime.ComposeRuntimeFlags {
>     static boolean isLinkBufferComposerEnabled return true;
> }
>
> # End of content from Local project :androidApp::androidApp (extracted file: /Users/goooler/StudioProjects/Tabby/androidApp/src/main/keepRules/proguard-rules.keep)
```
@Goooler Goooler changed the title Migrate minification DSL Migrate optimization DSL Jul 29, 2026
@Goooler
Goooler merged commit 71ea5e7 into trunk Jul 29, 2026
4 checks passed
@Goooler
Goooler deleted the g/new-minify-dsl branch July 29, 2026 09:59
@Goooler

Goooler commented Jul 29, 2026

Copy link
Copy Markdown
Owner Author
OLD: old.apk (signature: V2)
NEW: new.apk (signature: V2)

          │            compressed            │           uncompressed           
          ├───────────┬───────────┬──────────┼───────────┬───────────┬──────────
 APK      │ old       │ new       │ diff     │ old       │ new       │ diff     
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
      dex │   6.2 MiB │   6.2 MiB │ -6.7 KiB │   6.2 MiB │   6.2 MiB │ -6.7 KiB 
     arsc │ 442.3 KiB │ 442.3 KiB │      0 B │ 442.2 KiB │ 442.2 KiB │      0 B 
 manifest │   4.9 KiB │   4.9 KiB │      0 B │  21.9 KiB │  21.9 KiB │      0 B 
      res │ 403.9 KiB │ 403.9 KiB │      0 B │ 448.6 KiB │ 448.6 KiB │      0 B 
   native │    17 MiB │    17 MiB │      0 B │  46.3 MiB │  46.3 MiB │      0 B 
    asset │  12.3 MiB │  12.3 MiB │ +3.4 KiB │  24.9 MiB │  24.9 MiB │ +1.2 KiB 
    other │  62.4 KiB │  62.4 KiB │      0 B │ 125.6 KiB │ 125.6 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  36.4 MiB │  36.4 MiB │ -3.3 KiB │  78.4 MiB │  78.4 MiB │ -5.5 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 41041 │ 41027 │ -14 (+278 -292)   
   types │  8735 │  8718 │ -17 (+127 -144)   
 classes │  7325 │  7308 │ -17 (+124 -141)   
 methods │ 34776 │ 34733 │ -43 (+1159 -1202) 
  fields │ 24940 │ 24918 │ -22 (+278 -300)   

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  130 │  130 │  0   
 entries │ 1101 │ 1101 │  0   

=================
====   APK   ====
=================

     compressed     │    uncompressed     │                                
─────────┬──────────┼──────────┬──────────┤                                
 size    │ diff     │ size     │ diff     │ path                           
─────────┼──────────┼──────────┼──────────┼────────────────────────────────
 6.2 MiB │ -6.7 KiB │  6.2 MiB │ -6.7 KiB │ ∆ classes.dex                  
 1.2 MiB │ +2.3 KiB │    4 MiB │   +145 B │ ∆ assets/geosite.dat           
 6.1 KiB │   +1 KiB │  5.9 KiB │   +1 KiB │ ∆ assets/dexopt/baseline.prof  
   888 B │     +2 B │    754 B │     +2 B │ ∆ assets/dexopt/baseline.profm 
─────────┼──────────┼──────────┼──────────┼────────────────────────────────
 7.4 MiB │ -3.3 KiB │ 10.2 MiB │ -5.5 KiB │ (total)                        

@Goooler
Goooler requested a review from Copilot July 29, 2026 10:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates the Android release build configuration from the legacy minifyEnabled/shrinkResources/proguardFiles setup to the newer optimization { enable = true } DSL, and relocates the R8/ProGuard rules into the src/main/keepRules source set.

Changes:

  • Switched the release build type to use optimization { enable = true } instead of the legacy shrinking configuration.
  • Added androidApp/src/main/keepRules/proguard-rules.keep containing the project’s R8/ProGuard configuration previously embedded in the old pipeline.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
androidApp/src/main/keepRules/proguard-rules.keep Introduces keep/assumevalues rules under the new keepRules source set.
androidApp/build.gradle.kts Updates release build type to use the optimization DSL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants