Update Dockerfile
Browse files- Dockerfile +50 -53
Dockerfile
CHANGED
|
@@ -18,82 +18,93 @@ 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
|
| 28 |
-
import android.view.View;\n\
|
| 29 |
-
import android.view.animation.OvershootInterpolator;\n\
|
| 30 |
import android.util.Log;\n\
|
| 31 |
import de.robv.android.xposed.XC_MethodHook;\n\
|
| 32 |
import de.robv.android.xposed.XposedBridge;\n\
|
| 33 |
import java.lang.reflect.Field;\n\
|
| 34 |
\n\
|
| 35 |
public class Main {\n\
|
|
|
|
|
|
|
| 36 |
public void start() {\n\
|
|
|
|
| 37 |
try {\n\
|
| 38 |
Class<?> chatActivity = Class.forName("org.telegram.ui.ChatActivity");\n\
|
| 39 |
XposedBridge.hookMethod(chatActivity.getDeclaredMethod("createView", Context.class), new XC_MethodHook() {\n\
|
| 40 |
@Override\n\
|
| 41 |
protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n\
|
|
|
|
| 42 |
final Object fragment = param.thisObject;\n\
|
| 43 |
final View root = (View) param.getResult();\n\
|
| 44 |
if (root == null) return;\n\
|
|
|
|
| 45 |
root.postDelayed(() -> {\n\
|
| 46 |
try {\n\
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
} catch (Exception e) {\n\
|
| 52 |
-
Log.e(
|
| 53 |
}\n\
|
| 54 |
-
},
|
| 55 |
}\n\
|
| 56 |
});\n\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
} catch (Exception e) {\n\
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
}\n\
|
|
|
|
| 60 |
}\n\
|
| 61 |
\n\
|
| 62 |
-
private void
|
| 63 |
v.setBackground(new GlassDrawable());\n\
|
| 64 |
-
// Нативное размытие для Android 12+\n\
|
| 65 |
if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
|
| 66 |
-
|
| 67 |
-
v.setRenderEffect(RenderEffect.createBlurEffect(20f, 20f, Shader.TileMode.CLAMP));\n\
|
| 68 |
-
} catch (Exception ignored) {}\n\
|
| 69 |
}\n\
|
| 70 |
-
//
|
| 71 |
-
v.setOnTouchListener((view, ev) -> {\n\
|
| 72 |
-
if (ev.getAction() == MotionEvent.ACTION_DOWN) {\n\
|
| 73 |
-
view.animate().scaleX(0.85f).scaleY(0.85f).alpha(0.8f).setDuration(150).start();\n\
|
| 74 |
-
} else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {\n\
|
| 75 |
-
view.animate().scaleX(1f).scaleY(1f).alpha(1f).setDuration(500)\n\
|
| 76 |
-
.setInterpolator(new OvershootInterpolator(3.0f)).start();\n\
|
| 77 |
-
}\n\
|
| 78 |
-
return false;\n\
|
| 79 |
-
});\n\
|
| 80 |
}\n\
|
| 81 |
\n\
|
| 82 |
static class GlassDrawable extends Drawable {\n\
|
| 83 |
-
private
|
| 84 |
-
|
| 85 |
-
public GlassDrawable() {\n\
|
| 86 |
-
p.setColor(Color.argb(160, 255, 255, 255)); // Основной фон (стекло)\n\
|
| 87 |
-
s.setStyle(Paint.Style.STROKE);\n\
|
| 88 |
-
s.setStrokeWidth(3f);\n\
|
| 89 |
-
s.setColor(Color.argb(120, 255, 255, 255)); // Блик обводки\n\
|
| 90 |
-
}\n\
|
| 91 |
@Override\n\
|
| 92 |
public void draw(Canvas c) {\n\
|
| 93 |
RectF rf = new RectF(getBounds());\n\
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
c.drawRoundRect(rf,
|
|
|
|
| 97 |
}\n\
|
| 98 |
@Override public void setAlpha(int a) {}\n\
|
| 99 |
@Override public void setColorFilter(ColorFilter cf) {}\n\
|
|
@@ -101,22 +112,8 @@ public class Main {\n\
|
|
| 101 |
}\n\
|
| 102 |
}' > Main.java
|
| 103 |
|
| 104 |
-
# 3. Компиляция в байт-код
|
| 105 |
RUN javac -cp android.jar:aliuhook.jar -d . Main.java
|
| 106 |
-
|
| 107 |
-
# 4. Конвертация в .dex
|
| 108 |
-
RUN java -cp d8.jar com.android.tools.r8.D8 \
|
| 109 |
-
--release \
|
| 110 |
-
--lib android.jar \
|
| 111 |
-
--classpath aliuhook.jar \
|
| 112 |
-
--output . \
|
| 113 |
-
b/liquidglass/Main*.class
|
| 114 |
-
|
| 115 |
-
# 5. Переименование результата
|
| 116 |
RUN mv classes.dex LiquidGlass.dex
|
| 117 |
-
|
| 118 |
-
# 6. Запуск сервера для скачивания
|
| 119 |
EXPOSE 7860
|
| 120 |
-
CMD
|
| 121 |
-
echo "https://$SPACE_HOST/LiquidGlass.dex" && \
|
| 122 |
-
python3 -m http.server 7860
|
|
|
|
| 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\
|
|
|
|
| 112 |
}\n\
|
| 113 |
}' > Main.java
|
| 114 |
|
|
|
|
| 115 |
RUN javac -cp android.jar:aliuhook.jar -d . Main.java
|
| 116 |
+
RUN java -cp d8.jar com.android.tools.r8.D8 --release --lib android.jar --classpath aliuhook.jar --output . b/liquidglass/Main*.class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
RUN mv classes.dex LiquidGlass.dex
|
|
|
|
|
|
|
| 118 |
EXPOSE 7860
|
| 119 |
+
CMD python3 -m http.server 7860
|
|
|
|
|
|