diff options
5 files changed, 14 insertions, 18 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/api/ExternalAppDatabase.java b/main/src/main/java/de/blinkt/openvpn/api/ExternalAppDatabase.java index c6cc1beb..57e82778 100644 --- a/main/src/main/java/de/blinkt/openvpn/api/ExternalAppDatabase.java +++ b/main/src/main/java/de/blinkt/openvpn/api/ExternalAppDatabase.java @@ -29,7 +29,7 @@ public class ExternalAppDatabase { mContext =c; } - private final String PREFERENCES_KEY = "allowed_apps"; + private final static String PREFERENCES_KEY = "allowed_apps"; boolean isAllowed(String packagename) { Set<String> allowedapps = getExtAppList(); diff --git a/main/src/main/java/de/blinkt/openvpn/core/VPNLaunchHelper.java b/main/src/main/java/de/blinkt/openvpn/core/VPNLaunchHelper.java index 7c1722e0..7fb01032 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/VPNLaunchHelper.java +++ b/main/src/main/java/de/blinkt/openvpn/core/VPNLaunchHelper.java @@ -51,7 +51,7 @@ public class VPNLaunchHelper { } } - throw new RuntimeException("Cannot find any execulte for this device's ABIs " + abis.toString()); + throw new RuntimeException("Cannot find any execulte for this device's ABIs " + Arrays.toString(abis)); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) @@ -79,17 +79,13 @@ public class VPNLaunchHelper { String binaryName = writeMiniVPN(c); // Add fixed paramenters //args.add("/data/data/de.blinkt.openvpn/lib/openvpn"); - if (binaryName == null) { - VpnStatus.logError("Error writing minivpn binary"); - return null; - } args.add(binaryName); args.add("--config"); args.add(getConfigFilePath(c)); - return args.toArray(new String[args.size()]); + return args.toArray(new String[0]); } private static boolean writeMiniVPNBinary(Context context, String abi, File mvpnout) { @@ -106,7 +102,7 @@ public class VPNLaunchHelper { FileOutputStream fout = new FileOutputStream(mvpnout); - byte buf[] = new byte[4096]; + byte[] buf = new byte[4096]; int lenread = mvpn.read(buf); while (lenread > 0) { diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/AboutFragment.java b/main/src/ui/java/de/blinkt/openvpn/fragments/AboutFragment.java index 6ab6e2cc..ec07a77c 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/AboutFragment.java +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/AboutFragment.java @@ -45,6 +45,7 @@ import java.util.Vector; import de.blinkt.openvpn.R; import de.blinkt.openvpn.core.VpnStatus; +import kotlin.text.Charsets; public class AboutFragment extends Fragment implements View.OnClickListener { @@ -305,7 +306,7 @@ public class AboutFragment extends Fragment implements View.OnClickListener { try { mvpn = getActivity().getAssets().open("full_licenses.html"); - BufferedReader reader = new BufferedReader(new InputStreamReader(mvpn)); + BufferedReader reader = new BufferedReader(new InputStreamReader(mvpn, Charsets.UTF_8)); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { diff --git a/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java b/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java index 6eb85e9b..c450bf22 100644 --- a/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java +++ b/remoteExample/src/main/java/de/blinkt/openvpn/remote/MainFragment.java @@ -78,22 +78,22 @@ public class MainFragment extends Fragment implements View.OnClickListener, Hand { try { InputStream conf = getActivity().getAssets().open("test.conf"); - InputStreamReader isr = new InputStreamReader(conf); - BufferedReader br = new BufferedReader(isr); - String config=""; + BufferedReader br = new BufferedReader(new InputStreamReader(conf)); + StringBuilder config= new StringBuilder(); String line; while(true) { line = br.readLine(); if(line == null) break; - config += line + "\n"; + config.append(line).append("\n"); } - br.readLine(); + br.close(); + conf.close(); if (addNew) - mService.addNewVPNProfile("nonEditable", false, config); + mService.addNewVPNProfile("nonEditable", false, config.toString()); else - mService.startVPN(config); + mService.startVPN(config.toString()); } catch (IOException | RemoteException e) { e.printStackTrace(); } diff --git a/tlsexternalcertprovider/src/main/AndroidManifest.xml b/tlsexternalcertprovider/src/main/AndroidManifest.xml index 44af9254..47e15ac5 100644 --- a/tlsexternalcertprovider/src/main/AndroidManifest.xml +++ b/tlsexternalcertprovider/src/main/AndroidManifest.xml @@ -33,8 +33,7 @@ </activity> - <service - android:name=".ExternalCertService" + <service android:name=".ExternalCertService" tools:ignore="ExportedService"> <intent-filter> <action android:name="de.blinkt.openvpn.api.ExternalCertificateProvider"/> |