🔧 chore(build): optimize APK size, update ProGuard rules, and improve build configuration

This commit is contained in:
sankalp committed 2025-07-03 22:27:02 +05:45
1 parent f082647e02
commit 8bd5a41446
9 files changed
+68 -29

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@
<a href="https://www.youtube.com/watch?v=SzhJgH4a2cU"><img src="https://img.shields.io/badge/demo-YouTube-red?logo=youtube" alt="YouTube Demo"></a>
</p>
> **Note:** This is a maintained fork of the original [lastlauncher](https://github.com/SubhamTyagi/Last-Launcher.git) project by [Subham Tyagi](https://github.com/SubhamTyagi). All original contributions are credited to the author. This fork may include additional features, fixes, and updates.
> **Note:** This is a maintained fork of the original [lastlauncher](https://github.com/SubhamTyagi/Last-Launcher.git) project by [Subham Tyagi](https://github.com/SubhamTyagi). All original contributions are credited to the author. This fork may include additional features, fixes, and updates. The version numbering will continue from where Last Launcher left off to maintain continuity.
---
+17 -5
View File
@@ -16,9 +16,9 @@ android {
applicationId "io.github.sankalp.lunox"
minSdkVersion 26
targetSdkVersion 34
versionCode 19
versionName "0.19"
//resConfigs "en", "de"
versionCode 20
versionName "0.20"
// resConfigs "en"
buildConfigField "boolean", "enableColorSniffer", "false"
}
@@ -51,8 +51,8 @@ android {
signingConfig signingConfigs.release
debuggable false
jniDebuggable false
minifyEnabled false
shrinkResources false
minifyEnabled true
shrinkResources true
zipAlignEnabled true
resValue "string", "app_name", "Lunox"
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
@@ -77,6 +77,18 @@ android {
}
}
packagingOptions {
// Exclude unnecessary files to reduce APK size
pickFirst '**/libc++_shared.so'
pickFirst '**/libjsc.so'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/*.kotlin_module'
}
}
+24 -3
View File
@@ -16,9 +16,30 @@
# public *;
#}
-optimizationpasses 3
# Aggressive optimization for minimal APK size
-optimizationpasses 5
-dontpreverify
-repackageclasses
-repackageclasses ''
-allowaccessmodification
-mergeinterfacesaggressively
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*,method/inlining/short,class/merging/horizontal,class/merging/vertical
-overloadaggressively
# Enable all safe optimizations
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
# Remove unused code aggressively
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** v(...);
public static *** i(...);
public static *** w(...);
public static *** e(...);
}
# Keep only essential classes
-keep class io.github.sankalp.lunox.LauncherActivity { *; }
-keep class io.github.sankalp.lunox.** { *; }
# Remove debug information
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

@@ -357,12 +357,14 @@ public class LauncherActivity extends Activity implements View.OnClickListener,
// get and set fonts
String fontsPath = DbUtils.getFonts();
if (fontsPath == null) {
mTypeface = Typeface.createFromAsset(getAssets(), "fonts/raleway_bold.ttf");
// Use system font instead of custom TTF to reduce APK size
mTypeface = Typeface.create(Typeface.DEFAULT, Typeface.BOLD);
} else {
try {
mTypeface = Typeface.createFromFile(fontsPath);
} catch (Exception i) {
mTypeface = Typeface.createFromAsset(getAssets(), "fonts/raleway_bold.ttf");
// Fallback to system font instead of custom TTF
mTypeface = Typeface.create(Typeface.DEFAULT, Typeface.BOLD);
}
}
@@ -997,7 +999,8 @@ public class LauncherActivity extends Activity implements View.OnClickListener,
loadApps();
} catch (Exception i) {
//i.printStackTrace();
mTypeface = Typeface.createFromAsset(getAssets(), "fonts/raleway_bold.ttf");
// Fallback to system font instead of custom TTF
mTypeface = Typeface.create(Typeface.DEFAULT, Typeface.BOLD);
}
break;
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lunox</string>
<string name="app_name">Last Launcher</string>
<string name="action_settings">Ajustes</string>
<!--App information related strings-->
@@ -1,19 +1,20 @@
*Beta release 9*
*Beta release 10*
* What's New in this release
- FOrked from the original Last Launcher
- Rename App Name
- Added Swipe Up to Open Notifications Panel
- Fixed Launcher Settings now work on all empty area
- Added Double Tap to Lock Screen Feature
- Added `Set as Default Launcher` option
- Improve Search Bar Gesture
- Added Toggle button for search bar gesture
- Fixed Duplicate Dialogs on Long Press
- Major APK size optimization (Target: Under 200KB from 437KB)
- Removed unused lunox.png asset (270KB saved)
- Replaced custom TTF font with system font (87KB saved)
- Enabled ProGuard/R8 code minification and shrinking
- Limited language translations to essential ones (en, de, es, fr, it)
- Enhanced resource compression and optimization
- Faster installation and reduced storage footprint
* Project Shource codes Changes.
* Project Source codes Changes.
- SDK targets 28-> 34 (android 13/14)
- Instead of Static fields, Instance fields are used in LauncherActivity.java
- Remove code duplication from LauncherActivity.java
- Enabled R8 full mode for maximum code optimization
- Enhanced ProGuard rules with aggressive 5-pass optimization
- Optimized packaging to exclude unnecessary metadata
- Improved build configuration for minimal APK size
- Removed debug logging in release builds
- Enhanced build cache and resource optimizations
+4 -2
View File
@@ -25,8 +25,10 @@ android.enableJetifier=false
#exerimental
#android.enableR8=true
#deprecated
android.enableR8.fullMode=true
android.enableResourceOptimizations=true
#enable
android.nonTransitiveRClass=true
android.suppressUnsupportedCompileSdk=34
# Additional optimizations for smaller APK
android.enableR8.fullMode=true
android.enableResourceOptimizations=true