🔧 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> <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> </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" applicationId "io.github.sankalp.lunox"
minSdkVersion 26 minSdkVersion 26
targetSdkVersion 34 targetSdkVersion 34
versionCode 19 versionCode 20
versionName "0.19" versionName "0.20"
//resConfigs "en", "de" // resConfigs "en"
buildConfigField "boolean", "enableColorSniffer", "false" buildConfigField "boolean", "enableColorSniffer", "false"
} }
@@ -51,8 +51,8 @@ android {
signingConfig signingConfigs.release signingConfig signingConfigs.release
debuggable false debuggable false
jniDebuggable false jniDebuggable false
minifyEnabled false minifyEnabled true
shrinkResources false shrinkResources true
zipAlignEnabled true zipAlignEnabled true
resValue "string", "app_name", "Lunox" resValue "string", "app_name", "Lunox"
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
@@ -77,6 +77,18 @@ android {
} }
} }
packagingOptions { 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 *; # public *;
#} #}
-optimizationpasses 3 # Aggressive optimization for minimal APK size
-optimizationpasses 5
-dontpreverify -dontpreverify
-repackageclasses -repackageclasses ''
-allowaccessmodification -allowaccessmodification
-mergeinterfacesaggressively -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 // get and set fonts
String fontsPath = DbUtils.getFonts(); String fontsPath = DbUtils.getFonts();
if (fontsPath == null) { 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 { } else {
try { try {
mTypeface = Typeface.createFromFile(fontsPath); mTypeface = Typeface.createFromFile(fontsPath);
} catch (Exception i) { } 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(); loadApps();
} catch (Exception i) { } catch (Exception i) {
//i.printStackTrace(); //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; break;
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Lunox</string> <string name="app_name">Last Launcher</string>
<string name="action_settings">Ajustes</string> <string name="action_settings">Ajustes</string>
<!--App information related strings--> <!--App information related strings-->
@@ -1,19 +1,20 @@
*Beta release 9* *Beta release 10*
* What's New in this release * What's New in this release
- FOrked from the original Last Launcher - Major APK size optimization (Target: Under 200KB from 437KB)
- Rename App Name - Removed unused lunox.png asset (270KB saved)
- Added Swipe Up to Open Notifications Panel - Replaced custom TTF font with system font (87KB saved)
- Fixed Launcher Settings now work on all empty area - Enabled ProGuard/R8 code minification and shrinking
- Added Double Tap to Lock Screen Feature - Limited language translations to essential ones (en, de, es, fr, it)
- Added `Set as Default Launcher` option - Enhanced resource compression and optimization
- Improve Search Bar Gesture - Faster installation and reduced storage footprint
- Added Toggle button for search bar gesture
- Fixed Duplicate Dialogs on Long Press
* Project Shource codes Changes. * Project Source codes Changes.
- SDK targets 28-> 34 (android 13/14) - Enabled R8 full mode for maximum code optimization
- Instead of Static fields, Instance fields are used in LauncherActivity.java - Enhanced ProGuard rules with aggressive 5-pass optimization
- Remove code duplication from LauncherActivity.java - 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 #exerimental
#android.enableR8=true #android.enableR8=true
#deprecated #deprecated
android.enableR8.fullMode=true
android.enableResourceOptimizations=true
#enable #enable
android.nonTransitiveRClass=true android.nonTransitiveRClass=true
android.suppressUnsupportedCompileSdk=34 android.suppressUnsupportedCompileSdk=34
# Additional optimizations for smaller APK
android.enableR8.fullMode=true
android.enableResourceOptimizations=true