Program: 171224
Project: 171224
Buggy source:
/** 
 * 此方法完成的逻辑： fitSystemWindowLayoutView 为微信主界面的 rootView 往此 View 中添加子 View 来实现助手界面 注意添加下标一定要小于聊天View -> TestTimeChatting 的下标 <p> 此部分同时包含一个黑色遮罩的逻辑，用来防止在助手界面软键盘弹出瞬间的View穿透问题，此逻辑一般不会触发，可以省略。 <p> 同时为了确保助手View 尺寸正确，将会获取主界面聊天列表的布局参数，复制到助手的布局参数中，添加此逻辑主要来规避某些手机上虚拟按键和状态栏不准确的问题。
 * @param param
 */
private void hookFitSystemWindowLayoutViewConstructor(final XC_MethodHook.MethodHookParam param){
  final ViewGroup fitSystemWindowLayoutView=(ViewGroup)param.thisObject;
  fitSystemWindowLayoutView.setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener(){
    @Override public void onChildViewAdded(    View parent,    View child){
      View chattingView;
      int chattingViewPosition;
      int fitWindowChildCount=0;
      int chatRoomViewPosition=0;
      int officialViewPosition=0;
      int maskViewPosition=0;
      if (isWechatHighVersion(AppSaveInfoUtils.INSTANCE.wechatVersionInfo())) {
        fitWindowChildCount=3;
        chattingViewPosition=2;
        chatRoomViewPosition=2;
        officialViewPosition=3;
        maskViewPosition=4;
      }
 else {
        fitWindowChildCount=2;
        chattingViewPosition=1;
        chatRoomViewPosition=1;
        officialViewPosition=2;
        maskViewPosition=3;
      }
      chattingView=fitSystemWindowLayoutView.getChildAt(chattingViewPosition);
      if (fitSystemWindowLayoutView.getChildCount() != fitWindowChildCount)       return;
      if (!(fitSystemWindowLayoutView.getChildAt(0) instanceof LinearLayout))       return;
      if (!chattingView.getClass().getSimpleName().equals("String_Node_Str"))       return;
      fitSystemWindowLayoutView.addView(chatRoomViewPresenter.getPresenterView(),chatRoomViewPosition);
      fitSystemWindowLayoutView.addView(officialViewPresenter.getPresenterView(),officialViewPosition);
      maskView=new View(context);
      maskView.setBackgroundColor(0xff000000);
      maskView.setVisibility(View.INVISIBLE);
      FrameLayout.LayoutParams maskParams=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT);
      maskView.setLayoutParams(maskParams);
      fitSystemWindowLayoutView.addView(maskView,maskViewPosition);
      if (((ViewGroup)fitSystemWindowLayoutView.getChildAt(0)).getChildCount() != 2)       return;
      final View mainView=((ViewGroup)fitSystemWindowLayoutView.getChildAt(0)).getChildAt(1);
      mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
        @Override public void onGlobalLayout(){
          int left=mainView.getLeft();
          int right=mainView.getRight();
          int top=mainView.getTop();
          int bottom=mainView.getBottom();
          int width=right - left;
          int height=bottom - top;
          if (width == 0 || height == 0)           return;
          ViewGroup chatRoomViewPresenterPresenterView=chatRoomViewPresenter.getPresenterView();
          ViewGroup officialViewPresenterPresenterView=officialViewPresenter.getPresenterView();
          int left1=chatRoomViewPresenterPresenterView.getLeft();
          int top1=chatRoomViewPresenterPresenterView.getTop();
          int right1=chatRoomViewPresenterPresenterView.getRight();
          int bottom1=chatRoomViewPresenterPresenterView.getBottom();
          if (new Rect(left1,top1,right1,bottom1).equals(new Rect(left,top,right,bottom)))           return;
          FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(width,height);
          params.setMargins(0,top,0,0);
          chatRoomViewPresenterPresenterView.setLayoutParams(params);
          officialViewPresenterPresenterView.setLayoutParams(params);
          maskView.setLayoutParams(params);
        }
      }
);
    }
    @Override public void onChildViewRemoved(    View parent,    View child){
    }
  }
);
}

Fixed version (ground truth):
/** 
 * 此方法完成的逻辑： fitSystemWindowLayoutView 为微信主界面的 rootView 往此 View 中添加子 View 来实现助手界面 注意添加下标一定要小于聊天View -> TestTimeChatting 的下标 <p> 此部分同时包含一个黑色遮罩的逻辑，用来防止在助手界面软键盘弹出瞬间的View穿透问题，此逻辑一般不会触发，可以省略。 <p> 同时为了确保助手View 尺寸正确，将会获取主界面聊天列表的布局参数，复制到助手的布局参数中，添加此逻辑主要来规避某些手机上虚拟按键和状态栏不准确的问题。
 * @param param
 */
private void hookFitSystemWindowLayoutViewConstructor(final XC_MethodHook.MethodHookParam param){
  final ViewGroup fitSystemWindowLayoutView=(ViewGroup)param.thisObject;
  fitSystemWindowLayoutView.setOnHierarchyChangeListener(new ViewGroup.OnHierarchyChangeListener(){
    @Override public void onChildViewAdded(    View parent,    View child){
      View chattingView;
      int chattingViewPosition;
      int fitWindowChildCount=0;
      int chatRoomViewPosition=0;
      int officialViewPosition=0;
      int maskViewPosition=0;
      if (isWechatHighVersion(AppSaveInfoUtils.INSTANCE.wechatVersionInfo())) {
        fitWindowChildCount=3;
        chattingViewPosition=2;
        chatRoomViewPosition=2;
        officialViewPosition=3;
        maskViewPosition=4;
      }
 else {
        fitWindowChildCount=2;
        chattingViewPosition=1;
        chatRoomViewPosition=1;
        officialViewPosition=2;
        maskViewPosition=3;
      }
      chattingView=fitSystemWindowLayoutView.getChildAt(chattingViewPosition);
      if (fitSystemWindowLayoutView.getChildCount() != fitWindowChildCount)       return;
      if (!(fitSystemWindowLayoutView.getChildAt(0) instanceof LinearLayout))       return;
      if (!chattingView.getClass().getSimpleName().equals("String_Node_Str"))       return;
      LogUtils.INSTANCE.log("String_Node_Str");
      if (chatRoomViewPresenter == null)       chatRoomViewPresenter=new ChatRoomViewPresenter(context,Type.CHAT_ROOMS);
      if (officialViewPresenter == null)       officialViewPresenter=new ChatRoomViewPresenter(context,Type.OFFICIAL);
      fitSystemWindowLayoutView.addView(chatRoomViewPresenter.getPresenterView(),chatRoomViewPosition);
      fitSystemWindowLayoutView.addView(officialViewPresenter.getPresenterView(),officialViewPosition);
      maskView=new View(context);
      maskView.setBackgroundColor(0xff000000);
      maskView.setVisibility(View.INVISIBLE);
      FrameLayout.LayoutParams maskParams=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT);
      maskView.setLayoutParams(maskParams);
      fitSystemWindowLayoutView.addView(maskView,maskViewPosition);
      if (((ViewGroup)fitSystemWindowLayoutView.getChildAt(0)).getChildCount() != 2)       return;
      final View mainView=((ViewGroup)fitSystemWindowLayoutView.getChildAt(0)).getChildAt(1);
      mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
        @Override public void onGlobalLayout(){
          int left=mainView.getLeft();
          int right=mainView.getRight();
          int top=mainView.getTop();
          int bottom=mainView.getBottom();
          int width=right - left;
          int height=bottom - top;
          if (width == 0 || height == 0)           return;
          ViewGroup chatRoomViewPresenterPresenterView=chatRoomViewPresenter.getPresenterView();
          ViewGroup officialViewPresenterPresenterView=officialViewPresenter.getPresenterView();
          int left1=chatRoomViewPresenterPresenterView.getLeft();
          int top1=chatRoomViewPresenterPresenterView.getTop();
          int right1=chatRoomViewPresenterPresenterView.getRight();
          int bottom1=chatRoomViewPresenterPresenterView.getBottom();
          if (new Rect(left1,top1,right1,bottom1).equals(new Rect(left,top,right,bottom)))           return;
          FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(width,height);
          params.setMargins(0,top,0,0);
          chatRoomViewPresenterPresenterView.setLayoutParams(params);
          officialViewPresenterPresenterView.setLayoutParams(params);
          maskView.setLayoutParams(params);
        }
      }
);
    }
    @Override public void onChildViewRemoved(    View parent,    View child){
    }
  }
);
}