Advertisement
stirante

Timer

Dec 27th, 2015
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. final Paint p = new Paint();
  2.         p.setColor(Color.WHITE);
  3.         p.setTextSize(100);
  4.         p.setStrokeWidth(10);
  5.         p.setAntiAlias(true);
  6.         XposedHelpers.findAndHookMethod("com.snapchat.android.ui.camera.TakeSnapButton", packageParam.classLoader, "onDraw", Canvas.class, new XC_MethodHook() {
  7.             @Override
  8.             protected void afterHookedMethod(MethodHookParam param) throws Throwable {
  9.                 if (XposedHelpers.getBooleanField(param.thisObject, "b") && XposedHelpers.getBooleanField(param.thisObject, "d")) {
  10.                     Canvas c = (Canvas) param.args[0];
  11.                     long time = SystemClock.elapsedRealtime() - XposedHelpers.getLongField(param.thisObject, "a");
  12.                     String t = String.valueOf(time / 1000);
  13.                     Rect rekt = new Rect();
  14.                     p.getTextBounds(t, 0, t.length(), rekt);
  15.                     c.drawText(t, XposedHelpers.getFloatField(param.thisObject, "m") - (rekt.width() / 2) - 5, XposedHelpers.getFloatField(param.thisObject, "n") + (rekt.height() / 2) - 5, p);
  16.                 }
  17.             }
  18.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement