Program: 94125
Project: 94125
Buggy source:
public static void addSaveButtonsAndGestures(XC_InitPackageResources.InitPackageResourcesParam resparam,final XModuleResources mResources,final Context localContext){
  final GestureEvent gestureEvent=new GestureEvent();
  Logger.log("String_Node_Str");
  final FrameLayout.LayoutParams layoutParams=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT,Gravity.BOTTOM | Gravity.START);
  final Bitmap saveImg=BitmapFactory.decodeResource(mResources,R.mipmap.snap_button);
  resparam.res.hookLayout(Common.PACKAGE_SNAP,"String_Node_Str","String_Node_Str",new XC_LayoutInflated(){
    @Override public void handleLayoutInflated(    LayoutInflatedParam liparam) throws Throwable {
      final FrameLayout frameLayout=(FrameLayout)liparam.view.findViewById(liparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP)).getParent();
      saveStoryButton=new ImageButton(localContext);
      saveStoryButton.setLayoutParams(layoutParams);
      saveStoryButton.setBackgroundColor(0);
      saveStoryButton.setImageBitmap(saveImg);
      saveStoryButton.setAlpha(0.8f);
      saveStoryButton.setVisibility(Preferences.mModeStory == Preferences.SAVE_BUTTON ? View.VISIBLE : View.INVISIBLE);
      frameLayout.setOnTouchListener(new View.OnTouchListener(){
        @Override public boolean onTouch(        View v,        MotionEvent event){
          if (Preferences.mModeStory != Preferences.SAVE_S2S)           return false;
          return gestureEvent.onTouch(v,event);
        }
      }
);
      frameLayout.addView(saveStoryButton);
      saveStoryButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Logger.printTitle("String_Node_Str");
          Saving.performButtonSave();
        }
      }
);
    }
  }
);
  resparam.res.hookLayout(Common.PACKAGE_SNAP,"String_Node_Str","String_Node_Str",new XC_LayoutInflated(){
    @Override public void handleLayoutInflated(    LayoutInflatedParam liparam) throws Throwable {
      final FrameLayout frameLayout=(FrameLayout)liparam.view.findViewById(liparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP)).getParent();
      saveSnapButton=new ImageButton(localContext);
      saveSnapButton.setLayoutParams(layoutParams);
      saveSnapButton.setBackgroundColor(0);
      saveSnapButton.setAlpha(0.8f);
      saveSnapButton.setImageBitmap(saveImg);
      saveSnapButton.setVisibility(Preferences.mModeSave == Preferences.SAVE_BUTTON ? View.VISIBLE : View.INVISIBLE);
      frameLayout.setOnTouchListener(new View.OnTouchListener(){
        @Override public boolean onTouch(        View v,        MotionEvent event){
          if (Preferences.mModeSave != Preferences.SAVE_S2S)           return false;
          return gestureEvent.onTouch(v,event);
        }
      }
);
      frameLayout.addView(saveSnapButton);
      saveSnapButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Logger.printTitle("String_Node_Str");
          Saving.performButtonSave();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
public static void addSaveButtonsAndGestures(XC_InitPackageResources.InitPackageResourcesParam resparam,final XModuleResources mResources,final Context localContext){
  final GestureEvent gestureEvent=new GestureEvent();
  Logger.log("String_Node_Str",false,true);
  Logger.log("String_Node_Str" + resparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP),false,true);
  Logger.log("String_Node_Str" + resparam.res.getResourceName(+2130837625),false,true);
  int intIconID=resparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP);
  final BitmapDrawable saveImg=(BitmapDrawable)resparam.res.getDrawable(intIconID);
  saveImg.setBounds(0,0,50,50);
  if (saveImg == null)   throw new NullPointerException("String_Node_Str");
  final FrameLayout.LayoutParams layoutParams=new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,FrameLayout.LayoutParams.WRAP_CONTENT,Gravity.BOTTOM | Gravity.START);
  resparam.res.hookLayout(Common.PACKAGE_SNAP,"String_Node_Str","String_Node_Str",new XC_LayoutInflated(){
    @Override public void handleLayoutInflated(    LayoutInflatedParam liparam) throws Throwable {
      final FrameLayout frameLayout=(FrameLayout)liparam.view.findViewById(liparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP)).getParent();
      saveStoryButton=new ImageButton(localContext);
      saveStoryButton.setLayoutParams(layoutParams);
      saveStoryButton.setBackgroundColor(Color.argb(50,255,255,255));
      saveStoryButton.setImageDrawable(saveImg);
      saveStoryButton.setAlpha(0.8f);
      saveStoryButton.setVisibility(Preferences.mModeStory == Preferences.SAVE_BUTTON ? View.VISIBLE : View.INVISIBLE);
      frameLayout.setOnTouchListener(new View.OnTouchListener(){
        @Override public boolean onTouch(        View v,        MotionEvent event){
          return Preferences.mModeStory == Preferences.SAVE_S2S && gestureEvent.onTouch(v,event);
        }
      }
);
      frameLayout.addView(saveStoryButton);
      saveStoryButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Logger.printTitle("String_Node_Str");
          Saving.performButtonSave();
        }
      }
);
    }
  }
);
  resparam.res.hookLayout(Common.PACKAGE_SNAP,"String_Node_Str","String_Node_Str",new XC_LayoutInflated(){
    @Override public void handleLayoutInflated(    LayoutInflatedParam liparam) throws Throwable {
      final FrameLayout frameLayout=(FrameLayout)liparam.view.findViewById(liparam.res.getIdentifier("String_Node_Str","String_Node_Str",Common.PACKAGE_SNAP)).getParent();
      saveSnapButton=new ImageButton(localContext);
      saveSnapButton.setLayoutParams(layoutParams);
      saveSnapButton.setBackgroundColor(0);
      saveSnapButton.setAlpha(0.8f);
      saveSnapButton.setImageDrawable(saveImg);
      saveSnapButton.setVisibility(Preferences.mModeSave == Preferences.SAVE_BUTTON ? View.VISIBLE : View.INVISIBLE);
      frameLayout.setOnTouchListener(new View.OnTouchListener(){
        @Override public boolean onTouch(        View v,        MotionEvent event){
          if (Preferences.mModeSave != Preferences.SAVE_S2S)           return false;
          return gestureEvent.onTouch(v,event);
        }
      }
);
      frameLayout.addView(saveSnapButton);
      saveSnapButton.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          Logger.printTitle("String_Node_Str");
          Saving.performButtonSave();
        }
      }
);
    }
  }
);
}