diff --git a/recovery.cpp b/recovery.cpp
index 7e539ce..dc2cc08 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -820,7 +820,7 @@
         std::bind(&Device::HandleMenuKey, device, std::placeholders::_1, std::placeholders::_2));
     if (entries[chosen_item] == "Back") break;
 
-    ui->ShowFile(entries[chosen_item].c_str());
+    ui->ShowFile(entries[chosen_item]);
   }
 }
 
diff --git a/screen_ui.cpp b/screen_ui.cpp
index aaeb18c..d3f373e 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -42,7 +42,6 @@
 #include <android-base/strings.h>
 #include <minui/minui.h>
 
-#include "common.h"
 #include "device.h"
 #include "ui.h"
 
@@ -373,19 +372,22 @@
   // Write the header and descriptive texts.
   SetColor(INFO);
   std::string header = "Show background text image";
-  text_y += DrawTextLine(text_x, text_y, header.c_str(), true);
+  text_y += DrawTextLine(text_x, text_y, header, true);
   std::string locale_selection = android::base::StringPrintf(
       "Current locale: %s, %zu/%zu", locales_entries[sel].c_str(), sel, locales_entries.size());
-  const char* instruction[] = { locale_selection.c_str(),
-                                "Use volume up/down to switch locales and power to exit.",
-                                nullptr };
+  // clang-format off
+  std::vector<std::string> instruction = {
+    locale_selection,
+    "Use volume up/down to switch locales and power to exit."
+  };
+  // clang-format on
   text_y += DrawWrappedTextLines(text_x, text_y, instruction);
 
   // Iterate through the text images and display them in order for the current locale.
   for (const auto& p : surfaces) {
     text_y += line_spacing;
     SetColor(LOG);
-    text_y += DrawTextLine(text_x, text_y, p.first.c_str(), false);
+    text_y += DrawTextLine(text_x, text_y, p.first, false);
     gr_color(255, 255, 255, 255);
     gr_texticon(text_x, text_y, p.second.get());
     text_y += gr_get_height(p.second.get());
@@ -452,24 +454,23 @@
   gr_texticon(x, y, surface);
 }
 
-int ScreenRecoveryUI::DrawTextLine(int x, int y, const char* line, bool bold) const {
-  gr_text(gr_sys_font(), x, y, line, bold);
+int ScreenRecoveryUI::DrawTextLine(int x, int y, const std::string& line, bool bold) const {
+  gr_text(gr_sys_font(), x, y, line.c_str(), bold);
   return char_height_ + 4;
 }
 
-int ScreenRecoveryUI::DrawTextLines(int x, int y, const char* const* lines) const {
+int ScreenRecoveryUI::DrawTextLines(int x, int y, const std::vector<std::string>& lines) const {
   int offset = 0;
-  for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) {
-    offset += DrawTextLine(x, y + offset, lines[i], false);
+  for (const auto& line : lines) {
+    offset += DrawTextLine(x, y + offset, line, false);
   }
   return offset;
 }
 
-int ScreenRecoveryUI::DrawWrappedTextLines(int x, int y, const char* const* lines) const {
+int ScreenRecoveryUI::DrawWrappedTextLines(int x, int y,
+                                           const std::vector<std::string>& lines) const {
   int offset = 0;
-  for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) {
-    // The line will be wrapped if it exceeds text_cols_.
-    std::string line(lines[i]);
+  for (const auto& line : lines) {
     size_t next_start = 0;
     while (next_start < line.size()) {
       std::string sub = line.substr(next_start, text_cols_ + 1);
@@ -479,7 +480,7 @@
         // Line too long and must be wrapped to text_cols_ columns.
         size_t last_space = sub.find_last_of(" \t\n");
         if (last_space == std::string::npos) {
-          // No space found, just draw as much as we can
+          // No space found, just draw as much as we can.
           sub.resize(text_cols_);
           next_start += text_cols_;
         } else {
@@ -487,23 +488,12 @@
           next_start += last_space + 1;
         }
       }
-      offset += DrawTextLine(x, y + offset, sub.c_str(), false);
+      offset += DrawTextLine(x, y + offset, sub, false);
     }
   }
   return offset;
 }
 
-static const char* REGULAR_HELP[] = {
-  "Use volume up/down and power.",
-  nullptr,
-};
-
-static const char* LONG_PRESS_HELP[] = {
-  "Any button cycles highlight.",
-  "Long-press activates.",
-  nullptr,
-};
-
 // Redraws everything on the screen. Does not flip pages. Should only be called with updateMutex
 // locked.
 void ScreenRecoveryUI::draw_screen_locked() {
@@ -516,11 +506,21 @@
   gr_color(0, 0, 0, 255);
   gr_clear();
 
+  // clang-format off
+  static std::vector<std::string> REGULAR_HELP = {
+    "Use volume up/down and power.",
+  };
+  static std::vector<std::string> LONG_PRESS_HELP = {
+    "Any button cycles highlight.",
+    "Long-press activates.",
+  };
+  // clang-format on
   draw_menu_and_text_buffer_locked(HasThreeButtons() ? REGULAR_HELP : LONG_PRESS_HELP);
 }
 
 // Draws the menu and text buffer on the screen. Should only be called with updateMutex locked.
-void ScreenRecoveryUI::draw_menu_and_text_buffer_locked(const char* const* help_message) {
+void ScreenRecoveryUI::draw_menu_and_text_buffer_locked(
+    const std::vector<std::string>& help_message) {
   int y = kMarginHeight;
   if (menu_) {
     static constexpr int kMenuIndent = 4;
@@ -531,22 +531,32 @@
     std::string recovery_fingerprint =
         android::base::GetProperty("ro.bootimage.build.fingerprint", "");
     for (const auto& chunk : android::base::Split(recovery_fingerprint, ":")) {
-      y += DrawTextLine(x, y, chunk.c_str(), false);
+      y += DrawTextLine(x, y, chunk, false);
     }
 
     y += DrawTextLines(x, y, help_message);
 
+    auto convert_to_vector = [](const char* const* items) -> std::vector<std::string> {
+      if (items == nullptr) return {};
+
+      std::vector<std::string> result;
+      for (size_t i = 0; items[i] != nullptr; ++i) {
+        result.emplace_back(items[i]);
+      }
+      return result;
+    };
+
     // Draw menu header.
     SetColor(HEADER);
     if (!menu_->scrollable()) {
-      y += DrawWrappedTextLines(x, y, menu_->text_headers());
+      y += DrawWrappedTextLines(x, y, convert_to_vector(menu_->text_headers()));
     } else {
-      y += DrawTextLines(x, y, menu_->text_headers());
+      y += DrawTextLines(x, y, convert_to_vector(menu_->text_headers()));
       // Show the current menu item number in relation to total number if items don't fit on the
       // screen.
       std::string cur_selection_str;
       if (menu_->ItemsOverflow(&cur_selection_str)) {
-        y += DrawTextLine(x, y, cur_selection_str.c_str(), true);
+        y += DrawTextLine(x, y, cur_selection_str, true);
       }
     }
 
@@ -570,7 +580,7 @@
         bold = true;
       }
 
-      y += DrawTextLine(x, y, menu_->TextItem(i).c_str(), bold);
+      y += DrawTextLine(x, y, menu_->TextItem(i), bold);
 
       SetColor(MENU);
     }
@@ -951,10 +961,10 @@
   }
 }
 
-void ScreenRecoveryUI::ShowFile(const char* filename) {
-  FILE* fp = fopen_path(filename, "re");
-  if (fp == nullptr) {
-    Print("  Unable to open %s: %s\n", filename, strerror(errno));
+void ScreenRecoveryUI::ShowFile(const std::string& filename) {
+  std::unique_ptr<FILE, decltype(&fclose)> fp(fopen(filename.c_str(), "re"), fclose);
+  if (!fp) {
+    Print("  Unable to open %s: %s\n", filename.c_str(), strerror(errno));
     return;
   }
 
@@ -966,8 +976,7 @@
   text_ = file_viewer_text_;
   ClearText();
 
-  ShowFile(fp);
-  fclose(fp);
+  ShowFile(fp.get());
 
   text_ = old_text;
   text_col_ = old_text_col;
diff --git a/screen_ui.h b/screen_ui.h
index 837d346..b0cbbdb 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -133,7 +133,7 @@
   // printing messages
   void Print(const char* fmt, ...) override __printflike(2, 3);
   void PrintOnScreenOnly(const char* fmt, ...) override __printflike(2, 3);
-  void ShowFile(const char* filename) override;
+  void ShowFile(const std::string& filename) override;
 
   // menu display
   int ShowMenu(const char* const* headers, const char* const* items, int initial_selection,
@@ -178,7 +178,7 @@
   virtual void draw_background_locked();
   virtual void draw_foreground_locked();
   virtual void draw_screen_locked();
-  virtual void draw_menu_and_text_buffer_locked(const char* const* help_message);
+  virtual void draw_menu_and_text_buffer_locked(const std::vector<std::string>& help_message);
   virtual void update_screen_locked();
   virtual void update_progress_locked();
 
@@ -212,7 +212,7 @@
   // Draws a horizontal rule at Y. Returns the offset it should be moving along Y-axis.
   virtual int DrawHorizontalRule(int y) const;
   // Draws a line of text. Returns the offset it should be moving along Y-axis.
-  virtual int DrawTextLine(int x, int y, const char* line, bool bold) const;
+  virtual int DrawTextLine(int x, int y, const std::string& line, bool bold) const;
   // Draws surface portion (sx, sy, w, h) at screen location (dx, dy).
   virtual void DrawSurface(GRSurface* surface, int sx, int sy, int w, int h, int dx, int dy) const;
   // Draws rectangle at (x, y) - (x + w, y + h).
@@ -220,10 +220,10 @@
   // Draws given surface (surface->pixel_bytes = 1) as text at (x, y).
   virtual void DrawTextIcon(int x, int y, GRSurface* surface) const;
   // Draws multiple text lines. Returns the offset it should be moving along Y-axis.
-  int DrawTextLines(int x, int y, const char* const* lines) const;
+  int DrawTextLines(int x, int y, const std::vector<std::string>& lines) const;
   // Similar to DrawTextLines() to draw multiple text lines, but additionally wraps long lines.
   // Returns the offset it should be moving along Y-axis.
-  int DrawWrappedTextLines(int x, int y, const char* const* lines) const;
+  int DrawWrappedTextLines(int x, int y, const std::vector<std::string>& lines) const;
 
   Icon currentIcon;
 
diff --git a/stub_ui.h b/stub_ui.h
index 3c36fcf..362aab4 100644
--- a/stub_ui.h
+++ b/stub_ui.h
@@ -17,6 +17,9 @@
 #ifndef RECOVERY_STUB_UI_H
 #define RECOVERY_STUB_UI_H
 
+#include <functional>
+#include <string>
+
 #include "ui.h"
 
 // Stub implementation of RecoveryUI for devices without screen.
@@ -51,7 +54,7 @@
     va_end(ap);
   }
   void PrintOnScreenOnly(const char* /* fmt */, ...) override {}
-  void ShowFile(const char* /* filename */) override {}
+  void ShowFile(const std::string& /* filename */) override {}
 
   // menu display
   int ShowMenu(const char* const* /* headers */, const char* const* /* items */,
diff --git a/ui.h b/ui.h
index 636c2ff..c468992 100644
--- a/ui.h
+++ b/ui.h
@@ -88,7 +88,9 @@
   virtual void Print(const char* fmt, ...) __printflike(2, 3) = 0;
   virtual void PrintOnScreenOnly(const char* fmt, ...) __printflike(2, 3) = 0;
 
-  virtual void ShowFile(const char* filename) = 0;
+  // Shows the contents of the given file. Caller ensures the patition that contains the file has
+  // been mounted.
+  virtual void ShowFile(const std::string& filename) = 0;
 
   // --- key handling ---
 
diff --git a/vr_ui.cpp b/vr_ui.cpp
index a58c99e..b1ef646 100644
--- a/vr_ui.cpp
+++ b/vr_ui.cpp
@@ -39,9 +39,9 @@
   gr_texticon(x - kStereoOffset + ScreenWidth(), y, surface);
 }
 
-int VrRecoveryUI::DrawTextLine(int x, int y, const char* line, bool bold) const {
-  gr_text(gr_sys_font(), x + kStereoOffset, y, line, bold);
-  gr_text(gr_sys_font(), x - kStereoOffset + ScreenWidth(), y, line, bold);
+int VrRecoveryUI::DrawTextLine(int x, int y, const std::string& line, bool bold) const {
+  gr_text(gr_sys_font(), x + kStereoOffset, y, line.c_str(), bold);
+  gr_text(gr_sys_font(), x - kStereoOffset + ScreenWidth(), y, line.c_str(), bold);
   return char_height_ + 4;
 }
 
diff --git a/vr_ui.h b/vr_ui.h
index eeb4589..08384ce 100644
--- a/vr_ui.h
+++ b/vr_ui.h
@@ -17,6 +17,8 @@
 #ifndef RECOVERY_VR_UI_H
 #define RECOVERY_VR_UI_H
 
+#include <string>
+
 #include "screen_ui.h"
 
 class VrRecoveryUI : public ScreenRecoveryUI {
@@ -36,7 +38,7 @@
   void DrawHighlightBar(int x, int y, int width, int height) const override;
   void DrawFill(int x, int y, int w, int h) const override;
   void DrawTextIcon(int x, int y, GRSurface* surface) const override;
-  int DrawTextLine(int x, int y, const char* line, bool bold) const override;
+  int DrawTextLine(int x, int y, const std::string& line, bool bold) const override;
 };
 
 #endif  // RECOVERY_VR_UI_H
diff --git a/wear_ui.cpp b/wear_ui.cpp
index 118e435..e4473ba 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -61,13 +61,6 @@
   }
 }
 
-static const char* SWIPE_HELP[] = {
-  "Swipe up/down to move.",
-  "Swipe left/right to select.",
-  "",
-  nullptr,
-};
-
 void WearRecoveryUI::draw_screen_locked() {
   draw_background_locked();
   if (!show_text) {
@@ -76,6 +69,13 @@
     SetColor(TEXT_FILL);
     gr_fill(0, 0, gr_fb_width(), gr_fb_height());
 
+    // clang-format off
+    static std::vector<std::string> SWIPE_HELP = {
+      "Swipe up/down to move.",
+      "Swipe left/right to select.",
+      "",
+    };
+    // clang-format on
     draw_menu_and_text_buffer_locked(SWIPE_HELP);
   }
 }
@@ -99,4 +99,4 @@
     update_screen_locked();
   }
   pthread_mutex_unlock(&updateMutex);
-}
\ No newline at end of file
+}
