From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Damir Modyarov <damir@otomir23.me>
Date: Tue, 28 Apr 2026 15:27:42 +0300
Subject: add custom resource loader for icon replacement

---
 .../main/java/org/telegram/ui/LaunchActivity.java  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java
@@ -27,7 +27,9 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.SharedPreferences;
+import android.content.res.AssetManager;
 import android.content.res.Configuration;
+import android.content.res.Resources;
 import android.database.Cursor;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
@@ -392,6 +394,18 @@ public class LaunchActivity extends BasePermissionsActivity implements INavigati
     private FrameMetricsOverlayView frameMetricsOverlayView;
     // private RefreshRateController refreshRateController;
 
+    private desu.inugram.helpers.icons.IconsResources customResources;
+
+    @Override
+    public Resources getResources() {
+        Resources baseResources = super.getResources();
+        if (customResources == null) {
+            customResources = new desu.inugram.helpers.icons.IconsResources(baseResources);
+        }
+        customResources.syncConfigurationFrom(baseResources);
+        return customResources;
+    }
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         isActive = true;
