sterepando commited on
Commit
d92875c
·
verified ·
1 Parent(s): d0546ee

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +66 -54
Dockerfile CHANGED
@@ -18,7 +18,7 @@ RUN curl -L -f "https://maven.aliucord.com/snapshots/com/aliucord/Aliuhook/1.1.3
18
  # d8 (DEX compiler)
19
  RUN curl -L -f "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar" -o d8.jar
20
 
21
- # 2. Создаем исходный код (БЕЗ использования XposedBridge.log во избежание конфликтов типов)
22
  RUN printf 'package b.liquidglass;\n\
23
  \n\
24
  import android.content.Context;\n\
@@ -29,88 +29,100 @@ import android.view.animation.OvershootInterpolator;\n\
29
  import android.util.Log;\n\
30
  import de.robv.android.xposed.XC_MethodHook;\n\
31
  import de.robv.android.xposed.XposedBridge;\n\
 
32
  \n\
33
  public class Main {\n\
34
  private static final String TAG = "LiquidGlass";\n\
35
  \n\
36
  public void start() {\n\
37
- Log.i(TAG, "DEX Loaded and start() triggered");\n\
38
  try {\n\
39
- Class<?> chatActivity = Class.forName("org.telegram.ui.ChatActivity");\n\
40
- XposedBridge.hookMethod(chatActivity.getDeclaredMethod("createView", Context.class), new XC_MethodHook() {\n\
41
- @Override\n\
42
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n\
43
- final View root = (View) param.getResult();\n\
44
- if (root == null) return;\n\
45
- Log.i(TAG, "Activity created, starting FAB scan...");\n\
46
- \n\
47
- // Задержка, чтобы FAB успел отрисоваться в Телеге\n\
48
- root.postDelayed(() -> {\n\
49
- try {\n\
50
- findAndApply(root);\n\
51
- } catch (Exception e) {\n\
52
- Log.e(TAG, "Scan error: " + e.getMessage());\n\
53
- }\n\
54
- }, 1000);\n\
55
- }\n\
56
- });\n\
57
  } catch (Exception e) {\n\
58
- Log.e(TAG, "Hook setup failed: " + e.toString());\n\
59
  }\n\
60
  }\n\
61
  \n\
62
- private void findAndApply(View v) {\n\
63
- if (v instanceof ViewGroup) {\n\
64
- ViewGroup vg = (ViewGroup) v;\n\
65
- for (int i = 0; i < vg.getChildCount(); i++) {\n\
66
- findAndApply(vg.getChildAt(i));\n\
67
- }\n\
68
- }\n\
69
- // Ищем вьюху размером с FAB (обычно 56dp)\n\
70
- int w = v.getMeasuredWidth();\n\
71
- if (w > 0 && v.getVisibility() == View.VISIBLE) {\n\
72
- float dp = w / v.getContext().getResources().getDisplayMetrics().density;\n\
73
- if (dp >= 40 && dp <= 60) {\n\
74
- Log.i(TAG, "FAB detected (" + dp + "dp). Applying Liquid Glass effect.");\n\
75
- applyGlass(v);\n\
 
 
 
 
 
 
 
 
76
  }\n\
77
- }\n\
78
  }\n\
79
  \n\
80
- private void applyGlass(View v) {\n\
81
- v.setBackground(new GlassDrawable());\n\
82
- // Нативное размытие для Android 12+\n\
 
 
83
  if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
84
  try {\n\
85
- v.setRenderEffect(RenderEffect.createBlurEffect(20f, 20f, Shader.TileMode.CLAMP));\n\
86
- } catch (Exception ignored) { }\n\
87
  }\n\
88
- // Живая анимация при касании\n\
 
89
  v.setOnTouchListener((view, ev) -> {\n\
90
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {\n\
91
- view.animate().scaleX(0.85f).scaleY(0.85f).alpha(0.8f).setDuration(150).start();\n\
92
  } else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {\n\
93
- view.animate().scaleX(1f).scaleY(1f).alpha(1f).setDuration(500)\n\
94
  .setInterpolator(new OvershootInterpolator(3.0f)).start();\n\
95
  }\n\
96
  return false;\n\
97
  });\n\
98
  }\n\
99
  \n\
100
- static class GlassDrawable extends Drawable {\n\
101
- private final Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);\n\
102
- public GlassDrawable() { p.setColor(Color.argb(150, 255, 255, 255)); }\n\
 
 
 
 
 
 
 
 
 
 
 
103
  @Override\n\
104
  public void draw(Canvas c) {\n\
105
  RectF rf = new RectF(getBounds());\n\
106
- float r = Math.min(rf.width(), rf.height()) / 2f;\n\
107
- c.drawRoundRect(rf, r, r, p);\n\
108
- p.setStyle(Paint.Style.STROKE); p.setStrokeWidth(3f); p.setColor(Color.argb(100, 255, 255, 255));\n\
109
- c.drawRoundRect(rf, r, r, p);\n\
110
- p.setStyle(Paint.Style.FILL); p.setColor(Color.argb(150, 255, 255, 255));\n\
 
111
  }\n\
112
- @Override public void setAlpha(int a) { }\n\
113
- @Override public void setColorFilter(ColorFilter cf) { }\n\
 
114
  @Override public int getOpacity() { return PixelFormat.TRANSLUCENT; }\n\
115
  }\n\
116
  }' > Main.java
 
18
  # d8 (DEX compiler)
19
  RUN curl -L -f "https://maven.google.com/com/android/tools/r8/3.3.28/r8-3.3.28.jar" -o d8.jar
20
 
21
+ # 2. Исходник Main.java (Таргетируем конкретно FAB контейнеры)
22
  RUN printf 'package b.liquidglass;\n\
23
  \n\
24
  import android.content.Context;\n\
 
29
  import android.util.Log;\n\
30
  import de.robv.android.xposed.XC_MethodHook;\n\
31
  import de.robv.android.xposed.XposedBridge;\n\
32
+ import java.lang.reflect.Field;\n\
33
  \n\
34
  public class Main {\n\
35
  private static final String TAG = "LiquidGlass";\n\
36
  \n\
37
  public void start() {\n\
38
+ Log.i(TAG, "DEX Started. Targeting FAB fields...");\n\
39
  try {\n\
40
+ // 1. Главный экран (DialogsActivity)\n\
41
+ hookActivity("org.telegram.ui.DialogsActivity", new String[]{"floatingButtonContainer", "floatingButton2Container"});\n\
42
+ \n\
43
+ // 2. Экран чата (ChatActivity)\n\
44
+ hookActivity("org.telegram.ui.ChatActivity", new String[]{"floatingButton"});\n\
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  } catch (Exception e) {\n\
46
+ Log.e(TAG, "Global hook error: " + e.toString());\n\
47
  }\n\
48
  }\n\
49
  \n\
50
+ private void hookActivity(String className, String[] fields) throws Exception {\n\
51
+ Class<?> clazz = Class.forName(className);\n\
52
+ XposedBridge.hookMethod(clazz.getDeclaredMethod("createView", Context.class), new XC_MethodHook() {\n\
53
+ @Override\n\
54
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n\
55
+ final Object fragment = param.thisObject;\n\
56
+ final View root = (View) param.getResult();\n\
57
+ if (root == null) return;\n\
58
+ \n\
59
+ root.postDelayed(() -> {\n\
60
+ for (String fieldName : fields) {\n\
61
+ try {\n\
62
+ Field f = fragment.getClass().getDeclaredField(fieldName);\n\
63
+ f.setAccessible(true);\n\
64
+ View fab = (View) f.get(fragment);\n\
65
+ if (fab != null) {\n\
66
+ Log.i(TAG, "Found FAB field: " + fieldName + ". Applying effect...");\n\
67
+ applyLiquidGlass(fab);\n\
68
+ }\n\
69
+ } catch (Exception ignored) {}\n\
70
+ }\n\
71
+ }, 500);\n\
72
  }\n\
73
+ });\n\
74
  }\n\
75
  \n\
76
+ private void applyLiquidGlass(View v) {\n\
77
+ // Устанавливаем Apple Glass фон\n\
78
+ v.setBackground(new AppleGlassDrawable());\n\
79
+ \n\
80
+ // Блюр заднего плана (Android 12+)\n\
81
  if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
82
  try {\n\
83
+ v.setRenderEffect(RenderEffect.createBlurEffect(25f, 25f, Shader.TileMode.CLAMP));\n\
84
+ } catch (Exception ignored) {}\n\
85
  }\n\
86
+ \n\
87
+ // Liquid анимация (Apple-style bouncy)\n\
88
  v.setOnTouchListener((view, ev) -> {\n\
89
  if (ev.getAction() == MotionEvent.ACTION_DOWN) {\n\
90
+ view.animate().scaleX(0.88f).scaleY(0.88f).alpha(0.7f).setDuration(120).start();\n\
91
  } else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {\n\
92
+ view.animate().scaleX(1f).scaleY(1f).alpha(1f).setDuration(400)\n\
93
  .setInterpolator(new OvershootInterpolator(3.0f)).start();\n\
94
  }\n\
95
  return false;\n\
96
  });\n\
97
  }\n\
98
  \n\
99
+ static class AppleGlassDrawable extends Drawable {\n\
100
+ private final Paint glassPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n\
101
+ private final Paint specPaint = new Paint(Paint.ANTI_ALIAS_FLAG);\n\
102
+ \n\
103
+ public AppleGlassDrawable() {\n\
104
+ // Основное "запотевшее" стекло (50% белый)\n\
105
+ glassPaint.setColor(Color.argb(130, 255, 255, 255));\n\
106
+ \n\
107
+ // Тонкая обводка (Specular Highlight)\n\
108
+ specPaint.setStyle(Paint.Style.STROKE);\n\
109
+ specPaint.setStrokeWidth(2.5f);\n\
110
+ specPaint.setColor(Color.argb(180, 255, 255, 255));\n\
111
+ }\n\
112
+ \n\
113
  @Override\n\
114
  public void draw(Canvas c) {\n\
115
  RectF rf = new RectF(getBounds());\n\
116
+ float radius = Math.min(rf.width(), rf.height()) / 2f;\n\
117
+ \n\
118
+ // Рисуем тело кнопки\n\
119
+ c.drawRoundRect(rf, radius, radius, glassPaint);\n\
120
+ // Рисуем яркую обводку по краю\n\
121
+ c.drawRoundRect(rf, radius, radius, specPaint);\n\
122
  }\n\
123
+ \n\
124
+ @Override public void setAlpha(int a) {}\n\
125
+ @Override public void setColorFilter(ColorFilter cf) {}\n\
126
  @Override public int getOpacity() { return PixelFormat.TRANSLUCENT; }\n\
127
  }\n\
128
  }' > Main.java