@FixWhenMinSdkVersion(9) // IOException(String, Throwable) will be available
  public static void restrictAccessToOwnerOnly(String path) throws IOException {
    // IMPLEMENTATION NOTE: The code below simply invokes the hidden API
    // android.os.FileUtils.setPermissions(path, 0700, -1, -1) via Reflection.

    int errorCode;
    try {
      errorCode = (Integer) Class.forName("android.os.FileUtils")
          .getMethod("setPermissions", String.class, int.class, int.class, int.class)
          .invoke(null, path, 0700, -1, -1);
    } catch (Exception e) {
      // Can't chain exception because IOException doesn't have the right constructor on Froyo
      // and below
      throw new IOException("Failed to set permissions: " + e);
    }
    if (errorCode != 0) {
      throw new IOException("FileUtils.setPermissions failed with error code " + errorCode);
    }
  }
Restricts the file permissions of the provided path so that only the owner (UID)
can access it.
java/com/google/android/apps/authenticator/util/FileUtilities.java