Program: 162617
Project: 162617
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  sharedPref=PreferenceManager.getDefaultSharedPreferences(getActivity());
  skin=sharedPref.getString("String_Node_Str","String_Node_Str");
  Calendar calendar=Calendar.getInstance();
  int hour=calendar.get(Calendar.HOUR_OF_DAY);
  final Preference ui=(Preference)findPreference("String_Node_Str");
  final int th1=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
  theme=th1;
  if (th1 == 2) {
    ui.setEnabled(false);
    if (hour <= 6 || hour >= 18) {
      theme=1;
    }
 else     theme=0;
  }
  if (th1 == 1) {
    ui.setEnabled(false);
  }
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final String[] sort=getResources().getStringArray(R.array.columns);
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title(R.string.gridcolumnno);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      if (current != 0)       current=current - 2;
 else       current=1;
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + sort[which]).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.build().show();
      return true;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.uimode);
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title(R.string.directorysort);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + which).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.build().show();
      return true;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.hidemode);
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title("String_Node_Str");
      int current=sharedPref.getInt("String_Node_Str",0);
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putInt("String_Node_Str",which).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.build().show();
      return true;
    }
  }
);
  if (Build.VERSION.SDK_INT >= 21)   findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      restartPC(getActivity());
      return false;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.directorysortmode);
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title(R.string.directorysort);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + which).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.build().show();
      return true;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.theme);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + which).commit();
          if (which != 0)           sharedPref.edit().putString("String_Node_Str","String_Node_Str").commit();
          dialog.dismiss();
          restartPC(getActivity());
          return true;
        }
      }
);
      a.title(R.string.theme);
      a.build().show();
      return true;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.sortby);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + which).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.title(R.string.sortby);
      a.build().show();
      return true;
    }
  }
);
  final Preference preference=(Preference)findPreference("String_Node_Str");
  final int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str" + 6));
  preference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str" + 6));
      final String[] colors=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
      final MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      a.positiveText(R.string.cancel);
      a.positiveColor(Color.parseColor(skin));
      a.title(R.string.skin);
      if (theme == 1)       a.theme(Theme.DARK);
      LayoutInflater layoutInflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View view=layoutInflater.inflate(R.layout.list_dialog,null);
      ListView listView=(ListView)view.findViewById(R.id.listView);
      listView.setDivider(null);
      a.customView(view,true);
      a.autoDismiss(true);
      MaterialDialog x=a.build();
      ArrayList<String> arrayList=new ArrayList<String>();
      for (      String c : colors) {
        arrayList.add(c);
      }
      ColorAdapter adapter=new ColorAdapter(getActivity(),arrayList,"String_Node_Str","String_Node_Str");
      listView.setAdapter(adapter);
      x.show();
      return false;
    }
  }
);
  final Preference fabpreference=(Preference)findPreference("String_Node_Str");
  fabpreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str" + 0));
      final String[] colors=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
      final MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      a.positiveText(R.string.cancel);
      a.positiveColor(Color.parseColor(skin));
      a.title(R.string.fab_skin);
      if (th1 == 1)       a.theme(Theme.DARK);
      LayoutInflater layoutInflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View view=layoutInflater.inflate(R.layout.list_dialog,null);
      ListView listView=(ListView)view.findViewById(R.id.listView);
      listView.setDivider(null);
      a.customView(view,true);
      a.autoDismiss(true);
      MaterialDialog x=a.build();
      ArrayList<String> arrayList=new ArrayList<String>();
      for (      String c : colors) {
        arrayList.add(c);
      }
      ColorAdapter adapter=new ColorAdapter(getActivity(),arrayList,"String_Node_Str","String_Node_Str");
      listView.setAdapter(adapter);
      x.show();
      return false;
    }
  }
);
  final CheckBoxPreference checkBoxPreference=(CheckBoxPreference)findPreference("String_Node_Str");
  boolean check=sharedPref.getBoolean("String_Node_Str",false);
  checkBoxPreference.setChecked(check);
  checkBoxPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object o){
      if (!checkBoxPreference.isChecked()) {
        sharedPref.edit().putBoolean("String_Node_Str",true).apply();
        checkBoxPreference.setChecked(true);
      }
 else {
        sharedPref.edit().putBoolean("String_Node_Str",false).apply();
        checkBoxPreference.setChecked(false);
      }
      Toast.makeText(getActivity(),R.string.setRandom,Toast.LENGTH_LONG).show();
      return false;
    }
  }
);
  final CheckBoxPreference rootmode=(CheckBoxPreference)findPreference("String_Node_Str");
  rootmode.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      boolean b=sharedPref.getBoolean("String_Node_Str",false);
      if (b) {
        if (RootTools.isAccessGiven()) {
          rootmode.setChecked(true);
        }
 else {
          rootmode.setChecked(false);
          Toast.makeText(getActivity(),getResources().getString(R.string.rootfailure),Toast.LENGTH_LONG).show();
        }
      }
 else {
        rootmode.setChecked(false);
      }
      return false;
    }
  }
);
  Preference preference4=(Preference)findPreference("String_Node_Str");
  preference4.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      skin=sharedPref.getString("String_Node_Str","String_Node_Str");
      if (theme == 1)       a.theme(Theme.DARK);
      a.positiveText(R.string.close);
      a.positiveColor(Color.parseColor(skin));
      LayoutInflater layoutInflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View view=layoutInflater.inflate(R.layout.authors,null);
      a.customView(view,true);
      a.title(R.string.authors);
      a.callback(new MaterialDialog.ButtonCallback(){
        @Override public void onPositive(        MaterialDialog materialDialog){
          materialDialog.cancel();
        }
        @Override public void onNegative(        MaterialDialog materialDialog){
        }
      }
);
      a.build().show();
      final Intent intent=new Intent(Intent.ACTION_VIEW);
      TextView googlePlus1=(TextView)view.findViewById(R.id.googlePlus1);
      googlePlus1.setTextColor(Color.parseColor(skin));
      TextView googlePlus2=(TextView)view.findViewById(R.id.googlePlus2);
      googlePlus2.setTextColor(Color.parseColor(skin));
      TextView git1=(TextView)view.findViewById(R.id.git1);
      git1.setTextColor(Color.parseColor(skin));
      TextView git2=(TextView)view.findViewById(R.id.git2);
      git2.setTextColor(Color.parseColor(skin));
      googlePlus1.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      googlePlus2.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      git1.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      git2.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      TextView textView=(TextView)view.findViewById(R.id.icon_credits);
      textView.setMovementMethod(LinkMovementMethod.getInstance());
      textView.setLinksClickable(true);
      textView.setText(Html.fromHtml(getActivity().getString(R.string.icon_credits)));
      return false;
    }
  }
);
  Preference preference1=(Preference)findPreference("String_Node_Str");
  preference1.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title(R.string.changelog);
      a.content(Html.fromHtml(getActivity().getString(R.string.changelog_version_5) + getActivity().getString(R.string.changelog_change_5) + getActivity().getString(R.string.changelog_version_4)+ getActivity().getString(R.string.changelog_change_4)+ getActivity().getString(R.string.changelog_version_3)+ getActivity().getString(R.string.changelog_change_3)+ getActivity().getString(R.string.changelog_version_2)+ getActivity().getString(R.string.changelog_change_2)+ getActivity().getString(R.string.changelog_version_1)+ getActivity().getString(R.string.changelog_change_1)));
      a.negativeText(R.string.close);
      a.negativeColor(Color.parseColor(skin));
      a.positiveText(R.string.fullChangelog);
      a.positiveColor(Color.parseColor(skin));
      a.callback(new MaterialDialog.ButtonCallback(){
        @Override public void onPositive(        MaterialDialog materialDialog){
          Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
        @Override public void onNegative(        MaterialDialog materialDialog){
          materialDialog.cancel();
        }
      }
).build().show();
      return false;
    }
  }
);
  Preference preference2=(Preference)findPreference("String_Node_Str");
  final Dialog dialog=new Dialog(getActivity(),android.R.style.Theme_Holo_Light_DialogWhenLarge_NoActionBar);
  LayoutInflater inflater=(LayoutInflater)getActivity().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
  final View dialog_view=inflater.inflate(R.layout.open_source_licenses,null);
  dialog.setContentView(dialog_view);
  preference2.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference arg0){
      String oss_dialog="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      WebView wv=(WebView)dialog_view.findViewById(R.id.webView1);
      wv.loadData(oss_dialog,"String_Node_Str",null);
      dialog.show();
      return false;
    }
  }
);
  Preference preference3=(Preference)findPreference("String_Node_Str");
  preference3.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      Intent intent=new Intent(Intent.ACTION_VIEW);
      intent.setType("String_Node_Str");
      intent.setData(Uri.parse("String_Node_Str"));
      intent.setClassName("String_Node_Str","String_Node_Str");
      intent.putExtra(Intent.EXTRA_SUBJECT,"String_Node_Str");
      startActivity(intent);
      return false;
    }
  }
);
  Preference preference5=(Preference)findPreference("String_Node_Str");
  preference5.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      Intent intent1=new Intent(Intent.ACTION_VIEW);
      intent1.setData(Uri.parse("String_Node_Str"));
      startActivity(intent1);
      return false;
    }
  }
);
  Preference preference6=findPreference("String_Node_Str");
  preference6.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      Uri uri=Uri.parse("String_Node_Str");
      Intent intent=new Intent();
      intent.setData(uri);
      startActivity(intent);
      return false;
    }
  }
);
  Preference studio=findPreference("String_Node_Str");
  studio.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      COUNT++;
      if (COUNT >= 5) {
        if (toast != null)         toast.cancel();
        toast=Toast.makeText(getActivity(),"String_Node_Str" + COUNT,Toast.LENGTH_SHORT);
        toast.show();
        sharedPref.edit().putInt("String_Node_Str",Integer.parseInt(Integer.toString(COUNT) + "String_Node_Str")).apply();
      }
 else {
        sharedPref.edit().putInt("String_Node_Str",0).apply();
      }
      return false;
    }
  }
);
  CheckBoxPreference preference7=(CheckBoxPreference)findPreference("String_Node_Str");
  if (BuildConfig.IS_VERSION_FDROID)   preference7.setEnabled(false);
  CheckBoxPreference preference8=(CheckBoxPreference)findPreference("String_Node_Str");
  if (Build.VERSION.SDK_INT >= 21)   preference8.setEnabled(true);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.xml.preferences);
  sharedPref=PreferenceManager.getDefaultSharedPreferences(getActivity());
  skin=sharedPref.getString("String_Node_Str","String_Node_Str");
  Calendar calendar=Calendar.getInstance();
  int hour=calendar.get(Calendar.HOUR_OF_DAY);
  final int th1=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
  theme=th1;
  if (th1 == 2) {
    if (hour <= 6 || hour >= 18) {
      theme=1;
    }
 else     theme=0;
  }
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final String[] sort=getResources().getStringArray(R.array.columns);
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title(R.string.gridcolumnno);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      if (current != 0)       current=current - 2;
 else       current=1;
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + sort[which]).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.build().show();
      return true;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.hidemode);
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title("String_Node_Str");
      int current=sharedPref.getInt("String_Node_Str",0);
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putInt("String_Node_Str",which).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.build().show();
      return true;
    }
  }
);
  if (Build.VERSION.SDK_INT >= 21)   findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      restartPC(getActivity());
      return false;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.directorysortmode);
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title(R.string.directorysort);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + which).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.build().show();
      return true;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.theme);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + which).commit();
          dialog.dismiss();
          restartPC(getActivity());
          return true;
        }
      }
);
      a.title(R.string.theme);
      a.build().show();
      return true;
    }
  }
);
  findPreference("String_Node_Str").setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      String[] sort=getResources().getStringArray(R.array.sortby);
      int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str"));
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.items(sort).itemsCallbackSingleChoice(current,new MaterialDialog.ListCallbackSingleChoice(){
        @Override public boolean onSelection(        MaterialDialog dialog,        View view,        int which,        CharSequence text){
          sharedPref.edit().putString("String_Node_Str","String_Node_Str" + which).commit();
          dialog.dismiss();
          return true;
        }
      }
);
      a.title(R.string.sortby);
      a.build().show();
      return true;
    }
  }
);
  final Preference preference=(Preference)findPreference("String_Node_Str");
  final int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str" + 6));
  preference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str" + 6));
      final String[] colors=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
      final MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      a.positiveText(R.string.cancel);
      a.positiveColor(Color.parseColor(skin));
      a.title(R.string.skin);
      if (theme == 1)       a.theme(Theme.DARK);
      LayoutInflater layoutInflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View view=layoutInflater.inflate(R.layout.list_dialog,null);
      ListView listView=(ListView)view.findViewById(R.id.listView);
      listView.setDivider(null);
      a.customView(view,true);
      a.autoDismiss(true);
      MaterialDialog x=a.build();
      ArrayList<String> arrayList=new ArrayList<String>();
      for (      String c : colors) {
        arrayList.add(c);
      }
      ColorAdapter adapter=new ColorAdapter(getActivity(),arrayList,"String_Node_Str","String_Node_Str");
      listView.setAdapter(adapter);
      x.show();
      return false;
    }
  }
);
  final Preference fabpreference=(Preference)findPreference("String_Node_Str");
  fabpreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final int current=Integer.parseInt(sharedPref.getString("String_Node_Str","String_Node_Str" + 0));
      final String[] colors=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
      final MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      a.positiveText(R.string.cancel);
      a.positiveColor(Color.parseColor(skin));
      a.title(R.string.fab_skin);
      if (th1 == 1)       a.theme(Theme.DARK);
      LayoutInflater layoutInflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View view=layoutInflater.inflate(R.layout.list_dialog,null);
      ListView listView=(ListView)view.findViewById(R.id.listView);
      listView.setDivider(null);
      a.customView(view,true);
      a.autoDismiss(true);
      MaterialDialog x=a.build();
      ArrayList<String> arrayList=new ArrayList<String>();
      for (      String c : colors) {
        arrayList.add(c);
      }
      ColorAdapter adapter=new ColorAdapter(getActivity(),arrayList,"String_Node_Str","String_Node_Str");
      listView.setAdapter(adapter);
      x.show();
      return false;
    }
  }
);
  final CheckBoxPreference checkBoxPreference=(CheckBoxPreference)findPreference("String_Node_Str");
  boolean check=sharedPref.getBoolean("String_Node_Str",false);
  checkBoxPreference.setChecked(check);
  checkBoxPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
    @Override public boolean onPreferenceChange(    Preference preference,    Object o){
      if (!checkBoxPreference.isChecked()) {
        sharedPref.edit().putBoolean("String_Node_Str",true).apply();
        checkBoxPreference.setChecked(true);
      }
 else {
        sharedPref.edit().putBoolean("String_Node_Str",false).apply();
        checkBoxPreference.setChecked(false);
      }
      Toast.makeText(getActivity(),R.string.setRandom,Toast.LENGTH_LONG).show();
      return false;
    }
  }
);
  final CheckBoxPreference rootmode=(CheckBoxPreference)findPreference("String_Node_Str");
  rootmode.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      boolean b=sharedPref.getBoolean("String_Node_Str",false);
      if (b) {
        if (RootTools.isAccessGiven()) {
          rootmode.setChecked(true);
        }
 else {
          rootmode.setChecked(false);
          Toast.makeText(getActivity(),getResources().getString(R.string.rootfailure),Toast.LENGTH_LONG).show();
        }
      }
 else {
        rootmode.setChecked(false);
      }
      return false;
    }
  }
);
  Preference preference4=(Preference)findPreference("String_Node_Str");
  preference4.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      skin=sharedPref.getString("String_Node_Str","String_Node_Str");
      if (theme == 1)       a.theme(Theme.DARK);
      a.positiveText(R.string.close);
      a.positiveColor(Color.parseColor(skin));
      LayoutInflater layoutInflater=(LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      View view=layoutInflater.inflate(R.layout.authors,null);
      a.customView(view,true);
      a.title(R.string.authors);
      a.callback(new MaterialDialog.ButtonCallback(){
        @Override public void onPositive(        MaterialDialog materialDialog){
          materialDialog.cancel();
        }
        @Override public void onNegative(        MaterialDialog materialDialog){
        }
      }
);
      a.build().show();
      final Intent intent=new Intent(Intent.ACTION_VIEW);
      TextView googlePlus1=(TextView)view.findViewById(R.id.googlePlus1);
      googlePlus1.setTextColor(Color.parseColor(skin));
      TextView googlePlus2=(TextView)view.findViewById(R.id.googlePlus2);
      googlePlus2.setTextColor(Color.parseColor(skin));
      TextView git1=(TextView)view.findViewById(R.id.git1);
      git1.setTextColor(Color.parseColor(skin));
      TextView git2=(TextView)view.findViewById(R.id.git2);
      git2.setTextColor(Color.parseColor(skin));
      googlePlus1.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      googlePlus2.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      git1.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      git2.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View view){
          intent.setData(Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
      }
);
      TextView textView=(TextView)view.findViewById(R.id.icon_credits);
      textView.setMovementMethod(LinkMovementMethod.getInstance());
      textView.setLinksClickable(true);
      textView.setText(Html.fromHtml(getActivity().getString(R.string.icon_credits)));
      return false;
    }
  }
);
  Preference preference1=(Preference)findPreference("String_Node_Str");
  preference1.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      MaterialDialog.Builder a=new MaterialDialog.Builder(getActivity());
      if (theme == 1)       a.theme(Theme.DARK);
      a.title(R.string.changelog);
      a.content(Html.fromHtml(getActivity().getString(R.string.changelog_version_5) + getActivity().getString(R.string.changelog_change_5) + getActivity().getString(R.string.changelog_version_4)+ getActivity().getString(R.string.changelog_change_4)+ getActivity().getString(R.string.changelog_version_3)+ getActivity().getString(R.string.changelog_change_3)+ getActivity().getString(R.string.changelog_version_2)+ getActivity().getString(R.string.changelog_change_2)+ getActivity().getString(R.string.changelog_version_1)+ getActivity().getString(R.string.changelog_change_1)));
      a.negativeText(R.string.close);
      a.negativeColor(Color.parseColor(skin));
      a.positiveText(R.string.fullChangelog);
      a.positiveColor(Color.parseColor(skin));
      a.callback(new MaterialDialog.ButtonCallback(){
        @Override public void onPositive(        MaterialDialog materialDialog){
          Intent intent=new Intent(Intent.ACTION_VIEW,Uri.parse("String_Node_Str"));
          startActivity(intent);
        }
        @Override public void onNegative(        MaterialDialog materialDialog){
          materialDialog.cancel();
        }
      }
).build().show();
      return false;
    }
  }
);
  Preference preference2=(Preference)findPreference("String_Node_Str");
  final Dialog dialog=new Dialog(getActivity(),android.R.style.Theme_Holo_Light_DialogWhenLarge_NoActionBar);
  LayoutInflater inflater=(LayoutInflater)getActivity().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
  final View dialog_view=inflater.inflate(R.layout.open_source_licenses,null);
  dialog.setContentView(dialog_view);
  preference2.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference arg0){
      String oss_dialog="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
      WebView wv=(WebView)dialog_view.findViewById(R.id.webView1);
      wv.loadData(oss_dialog,"String_Node_Str",null);
      dialog.show();
      return false;
    }
  }
);
  Preference preference3=(Preference)findPreference("String_Node_Str");
  preference3.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      Intent intent=new Intent(Intent.ACTION_VIEW);
      intent.setType("String_Node_Str");
      intent.setData(Uri.parse("String_Node_Str"));
      intent.setClassName("String_Node_Str","String_Node_Str");
      intent.putExtra(Intent.EXTRA_SUBJECT,"String_Node_Str");
      startActivity(intent);
      return false;
    }
  }
);
  Preference preference5=(Preference)findPreference("String_Node_Str");
  preference5.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      Intent intent1=new Intent(Intent.ACTION_VIEW);
      intent1.setData(Uri.parse("String_Node_Str"));
      startActivity(intent1);
      return false;
    }
  }
);
  Preference preference6=findPreference("String_Node_Str");
  preference6.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      Uri uri=Uri.parse("String_Node_Str");
      Intent intent=new Intent();
      intent.setData(uri);
      startActivity(intent);
      return false;
    }
  }
);
  Preference studio=findPreference("String_Node_Str");
  studio.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      COUNT++;
      if (COUNT >= 5) {
        if (toast != null)         toast.cancel();
        toast=Toast.makeText(getActivity(),"String_Node_Str" + COUNT,Toast.LENGTH_SHORT);
        toast.show();
        sharedPref.edit().putInt("String_Node_Str",Integer.parseInt(Integer.toString(COUNT) + "String_Node_Str")).apply();
      }
 else {
        sharedPref.edit().putInt("String_Node_Str",0).apply();
      }
      return false;
    }
  }
);
  CheckBoxPreference preference7=(CheckBoxPreference)findPreference("String_Node_Str");
  if (BuildConfig.IS_VERSION_FDROID)   preference7.setEnabled(false);
  CheckBoxPreference preference8=(CheckBoxPreference)findPreference("String_Node_Str");
  if (Build.VERSION.SDK_INT >= 21)   preference8.setEnabled(true);
}