Skip to content

Commit 194b76a

Browse files
authored
perf: shrink classes.dex from ~932KB to ~47KB (#26)
Drop the unused UI library dependencies (material, appcompat, core-ktx, tracing) and replace the Material app theme with a zero-cost framework theme. None of these were referenced by the source — they were pulled in solely by the Material theme. This app is headless (instrumentation + broadcast receiver, no activity), so a framework theme is sufficient. classes.dex: 953,956 -> 47,700 bytes
1 parent 1d46386 commit 194b76a

3 files changed

Lines changed: 4 additions & 36 deletions

File tree

app/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ android {
5656

5757
dependencies {
5858

59-
implementation(libs.androidx.core.ktx)
60-
implementation(libs.androidx.tracing)
61-
implementation(libs.androidx.appcompat)
62-
implementation(libs.material)
6359
implementation(libs.androidx.uiautomator) {
6460
exclude(group = "junit", module = "junit")
6561
}

app/src/main/res/values-night/themes.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

app/src/main/res/values/themes.xml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
<resources xmlns:tools="http://schemas.android.com/tools">
2-
<!-- Base application theme. -->
3-
<style name="Theme.Mobilenextclipboard" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
4-
<!-- Primary brand color. -->
5-
<item name="colorPrimary">@color/purple_500</item>
6-
<item name="colorPrimaryVariant">@color/purple_700</item>
7-
<item name="colorOnPrimary">@color/white</item>
8-
<!-- Secondary brand color. -->
9-
<item name="colorSecondary">@color/teal_200</item>
10-
<item name="colorSecondaryVariant">@color/teal_700</item>
11-
<item name="colorOnSecondary">@color/black</item>
12-
<!-- Status bar color. -->
13-
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
14-
<!-- Customize your theme here. -->
15-
</style>
16-
</resources>
1+
<resources>
2+
<!-- Headless instrumentation app: no UI, so a zero-cost framework theme is enough. -->
3+
<style name="Theme.Mobilenextclipboard" parent="@android:style/Theme.Material.Light.NoActionBar" />
4+
</resources>

0 commit comments

Comments
 (0)