Update Dockerfile
Browse files- Dockerfile +38 -45
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,59 +29,51 @@ 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 void
|
| 35 |
-
Log.i("LiquidGlass",
|
| 36 |
-
|
| 37 |
-
// Aliuhook требует Throwable для логирования\n\
|
| 38 |
-
XposedBridge.log(new Throwable("[LiquidGlass-Native] " + msg)); \n\
|
| 39 |
-
} catch(Exception e) {}\n\
|
| 40 |
}\n\
|
| 41 |
\n\
|
| 42 |
public void start() {\n\
|
| 43 |
-
|
| 44 |
try {\n\
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
} catch (Exception e) {\n\
|
| 48 |
-
|
| 49 |
}\n\
|
| 50 |
}\n\
|
| 51 |
\n\
|
| 52 |
-
private void
|
| 53 |
-
Class<?> clazz = Class.forName(className);\n\
|
| 54 |
-
XposedBridge.hookMethod(clazz.getDeclaredMethod("createView", Context.class), new XC_MethodHook() {\n\
|
| 55 |
-
@Override\n\
|
| 56 |
-
protected void afterHookedMethod(MethodHookParam param) throws Throwable {\n\
|
| 57 |
-
final View root = (View) param.getResult();\n\
|
| 58 |
-
if (root == null) return;\n\
|
| 59 |
-
xLog("View created for " + param.thisObject.getClass().getSimpleName());\n\
|
| 60 |
-
\n\
|
| 61 |
-
root.postDelayed(() -> {\n\
|
| 62 |
-
try {\n\
|
| 63 |
-
findAndApply(root);\n\
|
| 64 |
-
} catch (Exception e) {\n\
|
| 65 |
-
xLog("Scan error: " + e.getMessage());\n\
|
| 66 |
-
}\n\
|
| 67 |
-
}, 800);\n\
|
| 68 |
-
}\n\
|
| 69 |
-
});\n\
|
| 70 |
-
}\n\
|
| 71 |
-
\n\
|
| 72 |
-
private void findAndApply(View v) {\n\
|
| 73 |
if (v instanceof ViewGroup) {\n\
|
| 74 |
ViewGroup vg = (ViewGroup) v;\n\
|
| 75 |
for (int i = 0; i < vg.getChildCount(); i++) {\n\
|
| 76 |
-
|
| 77 |
}\n\
|
| 78 |
}\n\
|
| 79 |
-
int
|
| 80 |
-
if (
|
| 81 |
-
float dp =
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
xLog("FAB detected (size: " + dp + "dp). Applying glass effect.");\n\
|
| 85 |
applyGlass(v);\n\
|
| 86 |
}\n\
|
| 87 |
}\n\
|
|
@@ -92,13 +84,14 @@ public class Main {\n\
|
|
| 92 |
if (android.os.Build.VERSION.SDK_INT >= 31) {\n\
|
| 93 |
try {\n\
|
| 94 |
v.setRenderEffect(RenderEffect.createBlurEffect(20f, 20f, Shader.TileMode.CLAMP));\n\
|
| 95 |
-
} catch (Exception ignored) {}\n\
|
| 96 |
}\n\
|
| 97 |
v.setOnTouchListener((view, ev) -> {\n\
|
| 98 |
if (ev.getAction() == MotionEvent.ACTION_DOWN) {\n\
|
| 99 |
-
view.animate().scaleX(0.85f).scaleY(0.85f).setDuration(150).start();\n\
|
| 100 |
} else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {\n\
|
| 101 |
-
view.animate().scaleX(1f).scaleY(1f).
|
|
|
|
| 102 |
}\n\
|
| 103 |
return false;\n\
|
| 104 |
});\n\
|
|
@@ -110,14 +103,14 @@ public class Main {\n\
|
|
| 110 |
@Override\n\
|
| 111 |
public void draw(Canvas c) {\n\
|
| 112 |
RectF rf = new RectF(getBounds());\n\
|
| 113 |
-
float r =
|
| 114 |
c.drawRoundRect(rf, r, r, p);\n\
|
| 115 |
p.setStyle(Paint.Style.STROKE); p.setStrokeWidth(3f); p.setColor(Color.argb(100, 255, 255, 255));\n\
|
| 116 |
c.drawRoundRect(rf, r, r, p);\n\
|
| 117 |
p.setStyle(Paint.Style.FILL); p.setColor(Color.argb(150, 255, 255, 255));\n\
|
| 118 |
}\n\
|
| 119 |
-
@Override public void setAlpha(int a) {}\n\
|
| 120 |
-
@Override public void setColorFilter(ColorFilter cf) {}\n\
|
| 121 |
@Override public int getOpacity() { return PixelFormat.TRANSLUCENT; }\n\
|
| 122 |
}\n\
|
| 123 |
}' > 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. Пишем исправленный код (используем только публичный log(String))
|
| 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 void logger(String m) {\n\
|
| 36 |
+
Log.i("LiquidGlass", m);\n\
|
| 37 |
+
XposedBridge.log("[LG] " + m);\n\
|
|
|
|
|
|
|
|
|
|
| 38 |
}\n\
|
| 39 |
\n\
|
| 40 |
public void start() {\n\
|
| 41 |
+
logger("DEX Loaded! Setting up hooks...");\n\
|
| 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\
|
| 45 |
+
@Override\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 |
+
logger("ChatActivity created");\n\
|
| 50 |
+
\n\
|
| 51 |
+
root.postDelayed(() -> {\n\
|
| 52 |
+
try {\n\
|
| 53 |
+
findFAB(root);\n\
|
| 54 |
+
} catch (Exception e) {\n\
|
| 55 |
+
logger("Error: " + e.getMessage());\n\
|
| 56 |
+
}\n\
|
| 57 |
+
}, 800);\n\
|
| 58 |
+
}\n\
|
| 59 |
+
});\n\
|
| 60 |
} catch (Exception e) {\n\
|
| 61 |
+
logger("Critical Error: " + e.toString());\n\
|
| 62 |
}\n\
|
| 63 |
}\n\
|
| 64 |
\n\
|
| 65 |
+
private void findFAB(View v) {\n\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
if (v instanceof ViewGroup) {\n\
|
| 67 |
ViewGroup vg = (ViewGroup) v;\n\
|
| 68 |
for (int i = 0; i < vg.getChildCount(); i++) {\n\
|
| 69 |
+
findFAB(vg.getChildAt(i));\n\
|
| 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 >= 35 && dp <= 65) {\n\
|
| 76 |
+
logger("FAB found (" + dp + "dp). Applying Apple Glass...");\n\
|
|
|
|
| 77 |
applyGlass(v);\n\
|
| 78 |
}\n\
|
| 79 |
}\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\
|
| 92 |
} else if (ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL) {\n\
|
| 93 |
+
view.animate().scaleX(1f).scaleY(1f).alpha(1f).setDuration(500)\n\
|
| 94 |
+
.setInterpolator(new OvershootInterpolator(3.0f)).start();\n\
|
| 95 |
}\n\
|
| 96 |
return false;\n\
|
| 97 |
});\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\
|
| 110 |
p.setStyle(Paint.Style.FILL); p.setColor(Color.argb(150, 255, 255, 255));\n\
|
| 111 |
}\n\
|
| 112 |
+
@Override public void setAlpha(int a) { }\n\
|
| 113 |
+
@Override public void setColorFilter(ColorFilter cf) { }\n\
|
| 114 |
@Override public int getOpacity() { return PixelFormat.TRANSLUCENT; }\n\
|
| 115 |
}\n\
|
| 116 |
}' > Main.java
|