From 377c086f35d78312cb9da787f8647e989d89037f Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 10 Mar 2014 16:21:39 +0100 Subject: Catch SecurityExceptions when opening streams --- .../main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java | 2 ++ main/src/main/java/de/blinkt/openvpn/fragments/Utils.java | 2 +- main/src/main/java/de/blinkt/openvpn/views/FileSelectLayout.java | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'main/src') diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java index 834ec82b..6ce9c915 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Authentication.java @@ -195,6 +195,8 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen setTlsAuthSummary(mTlsAuthFileData); } catch (IOException e) { VpnStatus.logException(e); + } catch (SecurityException se) { + VpnStatus.logException(se); } } } diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java index fc86243a..f7038877 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java @@ -180,7 +180,7 @@ public class Utils { return buffer.toByteArray(); } - public static String getFilePickerResult(FileType ft, Intent result, Context c) throws IOException { + public static String getFilePickerResult(FileType ft, Intent result, Context c) throws IOException, SecurityException { Uri uri = result.getData(); if (uri == null) diff --git a/main/src/main/java/de/blinkt/openvpn/views/FileSelectLayout.java b/main/src/main/java/de/blinkt/openvpn/views/FileSelectLayout.java index e2affe93..665b525f 100644 --- a/main/src/main/java/de/blinkt/openvpn/views/FileSelectLayout.java +++ b/main/src/main/java/de/blinkt/openvpn/views/FileSelectLayout.java @@ -35,6 +35,8 @@ public class FileSelectLayout extends LinearLayout implements OnClickListener { } catch (IOException e) { VpnStatus.logException(e); + } catch (SecurityException e) { + VpnStatus.logException(e); } -- cgit v1.2.3