Update Dockerfile
Browse files- 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.
|
| 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
|
| 38 |
try {\n\
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 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, "
|
| 59 |
}\n\
|
| 60 |
}\n\
|
| 61 |
\n\
|
| 62 |
-
private void
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
}\n\
|
| 77 |
-
}
|
| 78 |
}\n\
|
| 79 |
\n\
|
| 80 |
-
private void
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
| 83 |
if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
|
| 84 |
try {\n\
|
| 85 |
-
v.setRenderEffect(RenderEffect.createBlurEffect(
|
| 86 |
-
} catch (Exception ignored) {
|
| 87 |
}\n\
|
| 88 |
-
|
|
|
|
| 89 |
v.setOnTouchListener((view, ev) -> {\n\
|
| 90 |
if (ev.getAction() == MotionEvent.ACTION_DOWN) {\n\
|
| 91 |
-
view.animate().scaleX(0.
|
| 92 |
} else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {\n\
|
| 93 |
-
view.animate().scaleX(1f).scaleY(1f).alpha(1f).setDuration(
|
| 94 |
.setInterpolator(new OvershootInterpolator(3.0f)).start();\n\
|
| 95 |
}\n\
|
| 96 |
return false;\n\
|
| 97 |
});\n\
|
| 98 |
}\n\
|
| 99 |
\n\
|
| 100 |
-
static class
|
| 101 |
-
private final Paint
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
@Override\n\
|
| 104 |
public void draw(Canvas c) {\n\
|
| 105 |
RectF rf = new RectF(getBounds());\n\
|
| 106 |
-
float
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
c.drawRoundRect(rf,
|
| 110 |
-
|
|
|
|
| 111 |
}\n\
|
| 112 |
-
|
| 113 |
-
@Override public void
|
|
|
|
| 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
|