sterepando commited on
Commit
cfe7617
·
verified ·
1 Parent(s): aefd0e9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +55 -56
Dockerfile CHANGED
@@ -18,93 +18,92 @@ 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. Исходник с мощным логированием
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.util.Log;\n\
29
  import de.robv.android.xposed.XC_MethodHook;\n\
30
  import de.robv.android.xposed.XposedBridge;\n\
31
- import java.lang.reflect.Field;\n\
32
  \n\
33
  public class Main {\n\
34
- private static final String TAG = "LiquidGlass-DEX";\n\
35
- \n\
36
  public void start() {\n\
37
- Log.i(TAG, ">>> DEX LOADED AND START() CALLED <<<");\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
- Log.i(TAG, "ChatActivity.createView() hooked!");\n\
44
- final Object fragment = param.thisObject;\n\
45
- final View root = (View) param.getResult();\n\
46
- if (root == null) return;\n\
47
- \n\
48
- root.postDelayed(() -> {\n\
49
- try {\n\
50
- View fab = findFAB(fragment);\n\
51
- if (fab != null) {\n\
52
- Log.i(TAG, "FAB found! Applying effect...");\n\
53
- applyEffect(fab);\n\
54
- } else {\n\
55
- Log.e(TAG, "FAB NOT FOUND in ChatActivity");\n\
56
- }\n\
57
- } catch (Exception e) {\n\
58
- Log.e(TAG, "Error during FAB processing: " + e.getMessage());\n\
59
- }\n\
60
- }, 500);\n\
61
- }\n\
62
- });\n\
63
- Log.i(TAG, "Hook successfully registered on ChatActivity");\n\
64
  } catch (Exception e) {\n\
65
- Log.e(TAG, "Critical Start Error: " + e.toString());\n\
66
  }\n\
67
  }\n\
68
  \n\
69
- private View findFAB(Object fragment) throws Exception {\n\
70
- // Пробуем прямое имя\n\
71
- try {\n\
72
- Field f = fragment.getClass().getDeclaredField("floatingButton");\n\
73
- f.setAccessible(true);\n\
74
- return (View) f.get(fragment);\n\
75
- } catch (Exception e) {\n\
76
- // Если не вышло, ищем по типу View\n\
77
- for (Field f : fragment.getClass().getDeclaredFields()) {\n\
78
- if (f.getType().getName().contains("View") || f.getType().getName().contains("ImageView")) {\n\
79
- f.setAccessible(true);\n\
80
- Object val = f.get(fragment);\n\
81
- if (val instanceof View && ((View)val).getContentDescription() != null) {\n\
82
- return (View) val;\n\
83
  }\n\
84
- }\n\
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  }\n\
86
  }\n\
87
- return null;\n\
88
  }\n\
89
  \n\
90
- private void applyEffect(View v) {\n\
91
  v.setBackground(new GlassDrawable());\n\
92
  if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
93
  v.setRenderEffect(RenderEffect.createBlurEffect(20f, 20f, Shader.TileMode.CLAMP));\n\
94
  }\n\
95
- v.setScaleX(1.2f); v.setScaleY(1.2f); // Делаем чуть больше, чтобы точно заметить\n\
 
 
 
 
 
 
 
96
  }\n\
97
  \n\
98
  static class GlassDrawable extends Drawable {\n\
99
- private Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);\n\
100
- public GlassDrawable() { p.setColor(Color.argb(180, 255, 255, 255)); }\n\
101
  @Override\n\
102
  public void draw(Canvas c) {\n\
103
  RectF rf = new RectF(getBounds());\n\
104
- c.drawRoundRect(rf, rf.width()/2, rf.height()/2, p);\n\
105
- p.setStyle(Paint.Style.STROKE); p.setStrokeWidth(5f); p.setColor(Color.WHITE);\n\
106
- c.drawRoundRect(rf, rf.width()/2, rf.height()/2, p);\n\
107
- p.setStyle(Paint.Style.FILL); p.setColor(Color.argb(180, 255, 255, 255));\n\
 
108
  }\n\
109
  @Override public void setAlpha(int a) {}\n\
110
  @Override public void setColorFilter(ColorFilter cf) {}\n\
 
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. Исходник с выводом логов в Python консоль через XposedBridge.log
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 de.robv.android.xposed.XC_MethodHook;\n\
30
  import de.robv.android.xposed.XposedBridge;\n\
 
31
  \n\
32
  public class Main {\n\
 
 
33
  public void start() {\n\
34
+ XposedBridge.log("[LiquidGlass-Native] Plugin start called");\n\
35
  try {\n\
36
+ hookActivity("org.telegram.ui.ChatActivity");\n\
37
+ hookActivity("org.telegram.ui.DialogsActivity");\n\
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  } catch (Exception e) {\n\
39
+ XposedBridge.log("[LiquidGlass-Native] Hook failed: " + e.toString());\n\
40
  }\n\
41
  }\n\
42
  \n\
43
+ private void hookActivity(String className) throws Exception {\n\
44
+ Class<?> clazz = Class.forName(className);\n\
45
+ XposedBridge.hookMethod(clazz.getDeclaredMethod("createView", Context.class), new XC_MethodHook() {\n\
46
+ @Override\n\
47
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n\
48
+ final View root = (View) param.getResult();\n\
49
+ if (root == null) return;\n\
50
+ XposedBridge.log("[LiquidGlass-Native] Activity created: " + param.thisObject.getClass().getSimpleName());\n\
51
+ \n\
52
+ root.postDelayed(() -> {\n\
53
+ try {\n\
54
+ findAndApply(root);\n\
55
+ } catch (Exception e) {\n\
56
+ XposedBridge.log("[LiquidGlass-Native] Scan error: " + e.getMessage());\n\
57
  }\n\
58
+ }, 600);\n\
59
+ }\n\
60
+ });\n\
61
+ }\n\
62
+ \n\
63
+ private void findAndApply(View v) {\n\
64
+ if (v instanceof ViewGroup) {\n\
65
+ ViewGroup vg = (ViewGroup) v;\n\
66
+ for (int i = 0; i < vg.getChildCount(); i++) {\n\
67
+ findAndApply(vg.getChildAt(i));\n\
68
+ }\n\
69
+ }\n\
70
+ // Ищем вьюху размером 56dp (стандарт FAB)\n\
71
+ int size = v.getMeasuredWidth();\n\
72
+ if (size > 0 && v.getVisibility() == View.VISIBLE) {\n\
73
+ float dp = size / v.getContext().getResources().getDisplayMetrics().density;\n\
74
+ if (dp >= 50 && dp <= 65) {\n\
75
+ XposedBridge.log("[LiquidGlass-Native] FAB detected by size! Applying glass...");\n\
76
+ applyGlass(v);\n\
77
  }\n\
78
  }\n\
 
79
  }\n\
80
  \n\
81
+ private void applyGlass(View v) {\n\
82
  v.setBackground(new GlassDrawable());\n\
83
  if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
84
  v.setRenderEffect(RenderEffect.createBlurEffect(20f, 20f, Shader.TileMode.CLAMP));\n\
85
  }\n\
86
+ v.setOnTouchListener((view, ev) -> {\n\
87
+ if (ev.getAction() == MotionEvent.ACTION_DOWN) {\n\
88
+ view.animate().scaleX(0.85f).scaleY(0.85f).setDuration(150).start();\n\
89
+ } else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {\n\
90
+ view.animate().scaleX(1f).scaleY(1f).setDuration(400).setInterpolator(new OvershootInterpolator(2f)).start();\n\
91
+ }\n\
92
+ return false;\n\
93
+ });\n\
94
  }\n\
95
  \n\
96
  static class GlassDrawable extends Drawable {\n\
97
+ private final Paint p = new Paint(Paint.ANTI_ALIAS_FLAG);\n\
98
+ public GlassDrawable() { p.setColor(Color.argb(150, 255, 255, 255)); }\n\
99
  @Override\n\
100
  public void draw(Canvas c) {\n\
101
  RectF rf = new RectF(getBounds());\n\
102
+ float r = Math.min(rf.width(), rf.height()) / 2f;\n\
103
+ c.drawRoundRect(rf, r, r, p);\n\
104
+ p.setStyle(Paint.Style.STROKE); p.setStrokeWidth(3f); p.setColor(Color.argb(100, 255, 255, 255));\n\
105
+ c.drawRoundRect(rf, r, r, p);\n\
106
+ p.setStyle(Paint.Style.FILL); p.setColor(Color.argb(150, 255, 255, 255));\n\
107
  }\n\
108
  @Override public void setAlpha(int a) {}\n\
109
  @Override public void setColorFilter(ColorFilter cf) {}\n\