Program: 175352
Project: 175352
Buggy source:
public static void hook(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
  String pwmClassPath;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    pwmClassPath=PHONE_WINDOW_MANAGER_M;
  }
 else {
    pwmClassPath=PHONE_WINDOW_MANAGER_L;
  }
  Class<?> pwmClass=loadPackageParam.classLoader.loadClass(pwmClassPath);
  XposedBridge.hookAllMethods(pwmClass,"String_Node_Str",new XC_MethodHook(){
    @Override protected void afterHookedMethod(    final MethodHookParam param) throws Throwable {
      final Context mContext=(Context)XposedHelpers.getObjectField(param.thisObject,"String_Node_Str");
      WindowManager wm=(WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
      screenH=wm.getDefaultDisplay().getHeight();
      final Resources resources=mContext.getResources();
      final int resourceId=resources.getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str");
      defaultNavbarH=resources.getDimensionPixelSize(resourceId);
      navbarH=defaultNavbarH;
      if (navbarH == 0) {
        navbarH=150;
      }
      BroadcastReceiver screenShotReceiver=new BroadcastReceiver(){
        @Override public void onReceive(        Context context,        Intent intent){
          try {
            int type=intent.getIntExtra(ConstantStr.TYPE,-1);
switch (type) {
case ConstantStr.TAKE_SCREENSHOT:
              if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
                XposedHelpers.callMethod(param.thisObject,"String_Node_Str",1);
              }
 else {
                XposedHelpers.callMethod(param.thisObject,"String_Node_Str");
              }
            break;
case ConstantStr.HIDE_NAVBAR:
{
            setNavBarDimensions(param.thisObject,0,defaultNavbarH);
          }
        break;
case ConstantStr.NAVBAR_H:
{
        navbarH=resources.getDimensionPixelSize(resourceId);
        navbarH=(int)(navbarH * (((float)intent.getIntExtra(ConstantStr.NAVBAR_HEIGHT,100) / 100)));
        setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
      }
    break;
}
}
 catch (Exception e) {
XpLog.e(e);
}
}
}
;
IntentFilter filter=new IntentFilter(XpNavBarAction.ACTION_PHONE_WINDOW_MANAGER);
mContext.registerReceiver(screenShotReceiver,filter);
gesturesListener=new GesturesListener(mContext,new GesturesListener.Callbacks(){
@Override public void onSwipeFromTop(){
}
@Override public void onSwipeFromBottom(){
setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
}
@Override public void onSwipeFromRight(){
}
@Override public void onDebug(){
}
}
);
}
}
);
}

Fixed version (ground truth):
public static void hook(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
  String pwmClassPath;
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    pwmClassPath=PHONE_WINDOW_MANAGER_M;
  }
 else {
    pwmClassPath=PHONE_WINDOW_MANAGER_L;
  }
  Class<?> pwmClass=loadPackageParam.classLoader.loadClass(pwmClassPath);
  XposedBridge.hookAllMethods(pwmClass,"String_Node_Str",new XC_MethodHook(){
    @Override protected void afterHookedMethod(    final MethodHookParam param) throws Throwable {
      final Context mContext=(Context)XposedHelpers.getObjectField(param.thisObject,"String_Node_Str");
      WindowManager wm=(WindowManager)mContext.getSystemService(Context.WINDOW_SERVICE);
      screenH=wm.getDefaultDisplay().getHeight();
      final Resources resources=mContext.getResources();
      final int resourceId=resources.getIdentifier("String_Node_Str","String_Node_Str","String_Node_Str");
      defaultNavbarH=resources.getDimensionPixelSize(resourceId);
      navbarH=defaultNavbarH;
      if (navbarH == 0) {
        navbarH=150;
      }
      BroadcastReceiver screenShotReceiver=new BroadcastReceiver(){
        @Override public void onReceive(        Context context,        Intent intent){
          try {
            int type=intent.getIntExtra(ConstantStr.TYPE,-1);
switch (type) {
case ConstantStr.TAKE_SCREENSHOT:
              if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
                XposedHelpers.callMethod(param.thisObject,"String_Node_Str",1);
              }
 else {
                XposedHelpers.callMethod(param.thisObject,"String_Node_Str");
              }
            break;
case ConstantStr.HIDE_NAVBAR:
{
            setNavBarDimensions(param.thisObject,0,defaultNavbarH);
          }
        break;
case ConstantStr.NAVBAR_H:
{
        navbarH=resources.getDimensionPixelSize(resourceId);
        navbarH=(int)(navbarH * (((float)intent.getIntExtra(ConstantStr.NAVBAR_HEIGHT,100) / 100)));
        setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
      }
    break;
}
}
 catch (Exception e) {
XpLog.e(e);
}
}
}
;
IntentFilter filter=new IntentFilter(XpNavBarAction.ACTION_PHONE_WINDOW_MANAGER);
mContext.registerReceiver(screenShotReceiver,filter);
gesturesListener=new GesturesListener(mContext,new GesturesListener.Callbacks(){
@Override public void onSwipeFromTop(){
}
@Override public void onSwipeFromBottom(){
setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
}
@Override public void onSwipeFromRight(){
}
@Override public void onDebug(){
}
}
);
}
}
);
XposedHelpers.findAndHookMethod(pwmClass,"String_Node_Str",Display.class,int.class,int.class,int.class,new XC_MethodHook(){
@Override protected void afterHookedMethod(MethodHookParam param) throws Throwable {
setNavBarDimensions(param.thisObject,navbarH,defaultNavbarH);
}
}
);
}