Update Dockerfile
Browse files- Dockerfile +17 -17
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.
|
| 22 |
RUN printf 'package b.liquidglass;\n\
|
| 23 |
\n\
|
| 24 |
import android.content.Context;\n\
|
|
@@ -29,16 +29,12 @@ 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
|
| 36 |
-
Log.i("LiquidGlass", m);\n\
|
| 37 |
-
XposedBridge.log("[LG] " + m);\n\
|
| 38 |
-
}\n\
|
| 39 |
\n\
|
| 40 |
public void start() {\n\
|
| 41 |
-
|
| 42 |
try {\n\
|
| 43 |
Class<?> chatActivity = Class.forName("org.telegram.ui.ChatActivity");\n\
|
| 44 |
XposedBridge.hookMethod(chatActivity.getDeclaredMethod("createView", Context.class), new XC_MethodHook() {\n\
|
|
@@ -46,34 +42,36 @@ public class Main {\n\
|
|
| 46 |
protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n\
|
| 47 |
final View root = (View) param.getResult();\n\
|
| 48 |
if (root == null) return;\n\
|
| 49 |
-
|
| 50 |
\n\
|
|
|
|
| 51 |
root.postDelayed(() -> {\n\
|
| 52 |
try {\n\
|
| 53 |
-
|
| 54 |
} catch (Exception e) {\n\
|
| 55 |
-
|
| 56 |
}\n\
|
| 57 |
-
},
|
| 58 |
}\n\
|
| 59 |
});\n\
|
| 60 |
} catch (Exception e) {\n\
|
| 61 |
-
|
| 62 |
}\n\
|
| 63 |
}\n\
|
| 64 |
\n\
|
| 65 |
-
private void
|
| 66 |
if (v instanceof ViewGroup) {\n\
|
| 67 |
ViewGroup vg = (ViewGroup) v;\n\
|
| 68 |
for (int i = 0; i < vg.getChildCount(); i++) {\n\
|
| 69 |
-
|
| 70 |
}\n\
|
| 71 |
}\n\
|
|
|
|
| 72 |
int w = v.getMeasuredWidth();\n\
|
| 73 |
if (w > 0 && v.getVisibility() == View.VISIBLE) {\n\
|
| 74 |
float dp = w / v.getContext().getResources().getDisplayMetrics().density;\n\
|
| 75 |
-
if (dp >=
|
| 76 |
-
|
| 77 |
applyGlass(v);\n\
|
| 78 |
}\n\
|
| 79 |
}\n\
|
|
@@ -81,11 +79,13 @@ public class Main {\n\
|
|
| 81 |
\n\
|
| 82 |
private void applyGlass(View v) {\n\
|
| 83 |
v.setBackground(new GlassDrawable());\n\
|
|
|
|
| 84 |
if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
|
| 85 |
try {\n\
|
| 86 |
v.setRenderEffect(RenderEffect.createBlurEffect(20f, 20f, Shader.TileMode.CLAMP));\n\
|
| 87 |
} catch (Exception ignored) { }\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\
|
|
@@ -103,7 +103,7 @@ public class Main {\n\
|
|
| 103 |
@Override\n\
|
| 104 |
public void draw(Canvas c) {\n\
|
| 105 |
RectF rf = new RectF(getBounds());\n\
|
| 106 |
-
float r = rf.width() / 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\
|
|
|
|
| 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 |
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\
|
|
|
|
| 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\
|
|
|
|
| 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\
|
|
|
|
| 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\
|