private void uninstall() {
    // hack to get theme applied (which is not automatically applied due to activity's
    // Theme.NoDisplay
    ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId());

    final boolean isInstalled = PrivilegedInstaller.isExtensionInstalled(this);

    if (isInstalled) {
      String message = InstallExtension.create(getApplicationContext()).getWarningString();

      AlertDialog.Builder builder =
          new AlertDialog.Builder(theme)
              .setTitle(R.string.system_uninstall)
              .setMessage(Html.fromHtml(message))
              .setPositiveButton(
                  R.string.system_uninstall_button,
                  new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                      checkRootTask.execute();
                    }
                  })
              .setNegativeButton(
                  R.string.cancel,
                  new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                      InstallExtensionDialogActivity.this.setResult(Activity.RESULT_CANCELED);
                      InstallExtensionDialogActivity.this.finish();
                    }
                  });
      builder.create().show();
    } else {
      throw new RuntimeException("Uninstall invoked, but extension is not installed!");
    }
  }