Advertisement
stirante

Button

Feb 7th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.93 KB | None | 0 0
  1.         XposedHelpers.findAndHookMethod("com.snapchat.android.fragments.addfriends.ProfileFragment", packageParam.classLoader, "onCreateView", LayoutInflater.class, ViewGroup.class, Bundle.class, new XC_MethodHook() {
  2.             @Override
  3.             protected void afterHookedMethod(MethodHookParam param) throws Throwable {
  4.                 TableLayout navigation = (TableLayout) ((LinearLayout) XposedHelpers.getObjectField(param.thisObject, "z")).getChildAt(0);
  5.                 ImageView orig = (ImageView) ((TableRow) navigation.getChildAt(0)).getChildAt(0);//hardcoding much
  6.                 TextView orig1 = (TextView) ((TableRow) navigation.getChildAt(0)).getChildAt(1);//hardcoding much
  7.                 TableRow row = new TableRow(navigation.getContext());
  8.                 row.setLayoutParams(navigation.getChildAt(0).getLayoutParams());//hardcoding much
  9.                 ImageView iv = new ImageView(navigation.getContext());
  10.                 iv.setImageResource(NotificationUtil.DEFAULT_ICON);//here set icon
  11.                 iv.setLayoutParams(orig.getLayoutParams());
  12.                 TextView textView = new TextView(navigation.getContext());
  13.                 textView.setText("Open Snapprefs");//customize text?
  14.                 textView.setTextColor(orig1.getCurrentTextColor());
  15.                 textView.setTextSize(24);//trail and error font xD
  16.                 textView.setLayoutParams(orig1.getLayoutParams());
  17.                 row.setOnClickListener(new View.OnClickListener() {
  18.                     @Override
  19.                     public void onClick(View v) {
  20.                         Intent launchIntent = ctx.getPackageManager().getLaunchIntentForPackage("com.stirante.quizcheat");//change package!
  21.                         ctx.startActivity(launchIntent);
  22.                     }
  23.                 });
  24.                 row.addView(iv);
  25.                 row.addView(textView);
  26.                 navigation.addView(row);
  27.             }
  28.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement