Update Dockerfile
Browse files- Dockerfile +21 -10
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\
|
|
@@ -26,17 +26,26 @@ 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 |
-
|
| 35 |
try {\n\
|
| 36 |
hookActivity("org.telegram.ui.ChatActivity");\n\
|
| 37 |
hookActivity("org.telegram.ui.DialogsActivity");\n\
|
| 38 |
} catch (Exception e) {\n\
|
| 39 |
-
|
| 40 |
}\n\
|
| 41 |
}\n\
|
| 42 |
\n\
|
|
@@ -47,15 +56,15 @@ public class Main {\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 |
-
|
| 51 |
\n\
|
| 52 |
root.postDelayed(() -> {\n\
|
| 53 |
try {\n\
|
| 54 |
findAndApply(root);\n\
|
| 55 |
} catch (Exception e) {\n\
|
| 56 |
-
|
| 57 |
}\n\
|
| 58 |
-
},
|
| 59 |
}\n\
|
| 60 |
});\n\
|
| 61 |
}\n\
|
|
@@ -67,12 +76,12 @@ public class Main {\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 |
-
|
| 75 |
-
|
|
|
|
| 76 |
applyGlass(v);\n\
|
| 77 |
}\n\
|
| 78 |
}\n\
|
|
@@ -81,7 +90,9 @@ public class Main {\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 |
-
|
|
|
|
|
|
|
| 85 |
}\n\
|
| 86 |
v.setOnTouchListener((view, ev) -> {\n\
|
| 87 |
if (ev.getAction() == MotionEvent.ACTION_DOWN) {\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. Генерируем исправленный исходный код
|
| 22 |
RUN printf 'package b.liquidglass;\n\
|
| 23 |
\n\
|
| 24 |
import android.content.Context;\n\
|
|
|
|
| 26 |
import android.graphics.drawable.Drawable;\n\
|
| 27 |
import android.view.*;\n\
|
| 28 |
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 xLog(String msg) {\n\
|
| 35 |
+
Log.i("LiquidGlass", msg);\n\
|
| 36 |
+
try { \n\
|
| 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 |
+
xLog("DEX Loaded. Starting hooks...");\n\
|
| 44 |
try {\n\
|
| 45 |
hookActivity("org.telegram.ui.ChatActivity");\n\
|
| 46 |
hookActivity("org.telegram.ui.DialogsActivity");\n\
|
| 47 |
} catch (Exception e) {\n\
|
| 48 |
+
xLog("Hook setup failed: " + e.toString());\n\
|
| 49 |
}\n\
|
| 50 |
}\n\
|
| 51 |
\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\
|
|
|
|
| 76 |
findAndApply(vg.getChildAt(i));\n\
|
| 77 |
}\n\
|
| 78 |
}\n\
|
|
|
|
| 79 |
int size = v.getMeasuredWidth();\n\
|
| 80 |
if (size > 0 && v.getVisibility() == View.VISIBLE) {\n\
|
| 81 |
float dp = size / v.getContext().getResources().getDisplayMetrics().density;\n\
|
| 82 |
+
// FAB в Телеге обычно от 40 до 60 dp\n\
|
| 83 |
+
if (dp >= 38 && dp <= 62) {\n\
|
| 84 |
+
xLog("FAB detected (size: " + dp + "dp). Applying glass effect.");\n\
|
| 85 |
applyGlass(v);\n\
|
| 86 |
}\n\
|
| 87 |
}\n\
|
|
|
|
| 90 |
private void applyGlass(View v) {\n\
|
| 91 |
v.setBackground(new GlassDrawable());\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\
|