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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +110 -108
Dockerfile CHANGED
@@ -18,114 +18,116 @@ 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. Исходник Main.java (Таргетируем конкретно FAB контейнеры)
22
- RUN printf 'package b.liquidglass;\n\
23
- \n\
24
- import android.content.Context;\n\
25
- import android.graphics.*;\n\
26
- import android.graphics.drawable.Drawable;\n\
27
- import android.view.*;\n\
28
- 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
- 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
 
 
129
 
130
  RUN javac -cp android.jar:aliuhook.jar -d . Main.java
131
  RUN java -cp d8.jar com.android.tools.r8.D8 --release --lib android.jar --classpath aliuhook.jar --output . b/liquidglass/Main*.class
 
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. Создаем исходник через Heredoc (это не ломает билд)
22
+ RUN cat << 'EOF' > Main.java
23
+ package b.liquidglass;
24
+
25
+ import android.content.Context;
26
+ import android.graphics.*;
27
+ import android.graphics.drawable.Drawable;
28
+ import android.view.*;
29
+ import android.view.animation.OvershootInterpolator;
30
+ import android.util.Log;
31
+ import de.robv.android.xposed.XC_MethodHook;
32
+ import de.robv.android.xposed.XposedBridge;
33
+ import java.lang.reflect.Field;
34
+
35
+ public class Main {
36
+ private void xLog(String m) {
37
+ XposedBridge.log("[LiquidGlass] " + m);
38
+ }
39
+
40
+ public void start() {
41
+ xLog("DEX Started. Targeting FAB Fields...");
42
+ try {
43
+ // Список полей из custom_fab.plugin.py
44
+ String[] fabFields = {"floatingButtonContainer", "floatingButton2Container", "floatingButton"};
45
+
46
+ // Хукаем список чатов
47
+ hookActivity("org.telegram.ui.DialogsActivity", fabFields);
48
+ // Хукаем экран внутри чата
49
+ hookActivity("org.telegram.ui.ChatActivity", fabFields);
50
+
51
+ } catch (Exception e) {
52
+ xLog("Global Error: " + e.toString());
53
+ }
54
+ }
55
+
56
+ private void hookActivity(String clsName, String[] fields) throws Exception {
57
+ Class<?> cls = Class.forName(clsName);
58
+ XposedBridge.hookMethod(cls.getDeclaredMethod("createView", Context.class), new XC_MethodHook() {
59
+ @Override
60
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
61
+ final Object fragment = param.thisObject;
62
+ final View root = (View) param.getResult();
63
+ if (root == null) return;
64
+
65
+ // Задержка, чтобы Телега успела создать кнопки
66
+ root.postDelayed(() -> {
67
+ for (String fName : fields) {
68
+ try {
69
+ Field f = fragment.getClass().getDeclaredField(fName);
70
+ f.setAccessible(true);
71
+ View fab = (View) f.get(fragment);
72
+ if (fab != null) {
73
+ xLog("Target found: " + fName + ". Applying Apple Glass.");
74
+ applyGlassEffect(fab);
75
+ }
76
+ } catch (Exception ignored) {}
77
+ }
78
+ }, 700);
79
+ }
80
+ });
81
+ }
82
+
83
+ private void applyGlassEffect(View v) {
84
+ // Устанавливаем Apple Liquid Glass фон
85
+ v.setBackground(new AppleGlassDrawable());
86
+
87
+ // Включаем Backdrop Blur (Android 12+)
88
+ if (android.os.Build.VERSION.SDK_INT >= 31) {
89
+ try {
90
+ v.setRenderEffect(RenderEffect.createBlurEffect(25f, 25f, Shader.TileMode.CLAMP));
91
+ } catch (Exception ignored) {}
92
+ }
93
+
94
+ // Настраиваем Liquid анимацию при касании
95
+ v.setOnTouchListener((view, ev) -> {
96
+ if (ev.getAction() == MotionEvent.ACTION_DOWN) {
97
+ view.animate().scaleX(0.88f).scaleY(0.88f).alpha(0.7f).setDuration(120).start();
98
+ } else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {
99
+ view.animate().scaleX(1f).scaleY(1f).alpha(1f).setDuration(400)
100
+ .setInterpolator(new OvershootInterpolator(3.0f)).start();
101
+ }
102
+ return false;
103
+ });
104
+ }
105
+
106
+ static class AppleGlassDrawable extends Drawable {
107
+ private final Paint glass = new Paint(Paint.ANTI_ALIAS_FLAG);
108
+ private final Paint border = new Paint(Paint.ANTI_ALIAS_FLAG);
109
+
110
+ public AppleGlassDrawable() {
111
+ glass.setColor(0x82FFFFFF); // rgba(255, 255, 255, 0.5)
112
+ border.setStyle(Paint.Style.STROKE);
113
+ border.setStrokeWidth(3f);
114
+ border.setColor(0xB4FFFFFF); // rgba(255, 255, 255, 0.7) - Specular Highlight
115
+ }
116
+
117
+ @Override
118
+ public void draw(Canvas c) {
119
+ RectF rf = new RectF(getBounds());
120
+ float r = Math.min(rf.width(), rf.height()) / 2f;
121
+ c.drawRoundRect(rf, r, r, glass);
122
+ c.drawRoundRect(rf, r, r, border);
123
+ }
124
+
125
+ @Override public void setAlpha(int a) {}
126
+ @Override public void setColorFilter(ColorFilter cf) {}
127
+ @Override public int getOpacity() { return PixelFormat.TRANSLUCENT; }
128
+ }
129
+ }
130
+ EOF
131
 
132
  RUN javac -cp android.jar:aliuhook.jar -d . Main.java
133
  RUN java -cp d8.jar com.android.tools.r8.D8 --release --lib android.jar --classpath aliuhook.jar --output . b/liquidglass/Main*.class