Program: 94077
Project: 94077
Buggy source:
public static void addShareIcon(final XC_InitPackageResources.InitPackageResourcesParam resparam){
  try {
    resparam.res.hookLayout(Common.PACKAGE_SNAP,"String_Node_Str","String_Node_Str",new XC_LayoutInflated(){
      public void handleLayoutInflated(      LayoutInflatedParam liparam) throws Throwable {
        final int padding=px(10f);
        final int topMargin=0;
        final int size=px((int)resparam.res.getDimension(resparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP)));
        final RelativeLayout relativeLayout=(RelativeLayout)liparam.view.findViewById(liparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP));
        final RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT | RelativeLayout.ALIGN_PARENT_TOP);
        layoutParams.rightMargin=px(50);
        layoutParams.topMargin=topMargin;
        upload=new ImageButton(HookMethods.SnapContext);
        upload.setLayoutParams(layoutParams);
        upload.setPadding(padding,padding,padding,padding);
        upload.setBackgroundColor(0);
        String[] projection=new String[]{MediaStore.Images.ImageColumns._ID,MediaStore.Images.ImageColumns.DATA,MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,MediaStore.Images.ImageColumns.DATE_TAKEN,MediaStore.Images.ImageColumns.MIME_TYPE};
        final Cursor cursor=HookMethods.SnapContext.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,projection,null,null,MediaStore.Images.ImageColumns.DATE_TAKEN + "String_Node_Str");
        if (cursor != null && cursor.moveToFirst()) {
          String imageLocation=cursor.getString(1);
          File imageFile=new File(imageLocation);
          if (imageFile.exists()) {
            Bitmap bm=BitmapFactory.decodeFile(imageLocation);
            Bitmap resized=Bitmap.createScaledBitmap(bm,size,size,false);
            int w=resized.getWidth();
            int h=resized.getHeight();
            int radius=Math.min(h / 2,w / 2);
            Bitmap output=Bitmap.createBitmap(w + 8,h + 8,Bitmap.Config.ARGB_8888);
            Paint p=new Paint();
            p.setAntiAlias(true);
            Canvas c=new Canvas(output);
            c.drawARGB(0,0,0,0);
            p.setStyle(Paint.Style.FILL);
            c.drawCircle((w / 2) + 4,(h / 2) + 4,radius,p);
            p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
            c.drawBitmap(resized,4,4,p);
            p.setXfermode(null);
            p.setStyle(Paint.Style.STROKE);
            p.setColor(Color.WHITE);
            p.setStrokeWidth(px(4));
            c.drawCircle((w / 2) + 4,(h / 2) + 4,radius,p);
            upload.setImageDrawable(new BitmapDrawable(output));
          }
          cursor.close();
        }
        upload.setScaleX((float)0.65);
        upload.setScaleY((float)0.65);
        upload.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View v){
            Intent launchIntent=new Intent(Intent.ACTION_RUN);
            launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
            launchIntent.setComponent(new ComponentName("String_Node_Str","String_Node_Str"));
            HookMethods.context.startActivity(launchIntent);
          }
        }
);
        relativeLayout.addView(upload);
      }
    }
);
  }
 catch (  Resources.NotFoundException ignore) {
  }
}

Fixed version (ground truth):
public static void addShareIcon(final XC_InitPackageResources.InitPackageResourcesParam resparam){
  try {
    resparam.res.hookLayout(Common.PACKAGE_SNAP,"String_Node_Str","String_Node_Str",new XC_LayoutInflated(){
      public void handleLayoutInflated(      LayoutInflatedParam liparam) throws Throwable {
        final int padding=px(10f);
        final int topMargin=0;
        final int size=px((int)resparam.res.getDimension(resparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP)));
        final RelativeLayout relativeLayout=(RelativeLayout)liparam.view.findViewById(liparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP));
        final RelativeLayout.LayoutParams layoutParams=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT | RelativeLayout.ALIGN_PARENT_TOP);
        layoutParams.rightMargin=px(50);
        layoutParams.topMargin=topMargin;
        upload=new ImageButton(HookMethods.SnapContext);
        upload.setLayoutParams(layoutParams);
        upload.setPadding(padding,padding,padding,padding);
        upload.setBackgroundColor(0);
        String[] projection=new String[]{MediaStore.Images.ImageColumns._ID,MediaStore.Images.ImageColumns.DATA,MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,MediaStore.Images.ImageColumns.DATE_TAKEN,MediaStore.Images.ImageColumns.MIME_TYPE};
        final Cursor cursor=HookMethods.SnapContext.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,projection,null,null,MediaStore.Images.ImageColumns.DATE_TAKEN + "String_Node_Str");
        if (cursor != null && cursor.moveToFirst()) {
          String imageLocation=cursor.getString(1);
          File imageFile=new File(imageLocation);
          if (imageFile.exists()) {
            Bitmap bm=BitmapFactory.decodeFile(imageLocation);
            Bitmap resized=Bitmap.createScaledBitmap(bm,size,size,false);
            int w=resized.getWidth();
            int h=resized.getHeight();
            int radius=Math.min(h / 2,w / 2);
            Bitmap output=Bitmap.createBitmap(w + 8,h + 8,Bitmap.Config.ARGB_8888);
            Paint p=new Paint();
            p.setAntiAlias(true);
            Canvas c=new Canvas(output);
            c.drawARGB(0,0,0,0);
            p.setStyle(Paint.Style.FILL);
            c.drawCircle((w / 2) + 4,(h / 2) + 4,radius,p);
            p.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
            c.drawBitmap(resized,4,4,p);
            p.setXfermode(null);
            p.setStyle(Paint.Style.STROKE);
            p.setColor(Color.WHITE);
            p.setStrokeWidth(px(8));
            c.drawCircle((w / 2) + 4,(h / 2) + 4,radius,p);
            upload.setImageDrawable(new BitmapDrawable(output));
          }
          cursor.close();
        }
        upload.setScaleX((float)0.65);
        upload.setScaleY((float)0.65);
        upload.setOnClickListener(new View.OnClickListener(){
          @Override public void onClick(          View v){
            Intent launchIntent=new Intent(Intent.ACTION_RUN);
            launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
            launchIntent.setComponent(new ComponentName("String_Node_Str","String_Node_Str"));
            HookMethods.context.startActivity(launchIntent);
          }
        }
);
        relativeLayout.addView(upload);
      }
    }
);
  }
 catch (  Resources.NotFoundException ignore) {
  }
}