Java Code Examples for de.blinkt.openvpn.core.VpnStatus#logException()

The following examples show how to use de.blinkt.openvpn.core.VpnStatus#logException() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VpnProfile.java    From android with GNU General Public License v3.0 6 votes vote down vote up
public Intent prepareStartService(Context context) {
    Intent intent = getStartServiceIntent(context);


    if (mAuthenticationType == VpnProfile.TYPE_KEYSTORE || mAuthenticationType == VpnProfile.TYPE_USERPASS_KEYSTORE) {
        if (getKeyStoreCertificates(context) == null)
            return null;
    }


    try {
        FileWriter cfg = new FileWriter(VPNLaunchHelper.getConfigFilePath(context));
        cfg.write(getConfigFile(context, false));
        cfg.flush();
        cfg.close();
    } catch (IOException e) {
        VpnStatus.logException(e);
    }

    return intent;
}
 
Example 2
Source File: VpnProfile.java    From Cake-VPN with GNU General Public License v2.0 5 votes vote down vote up
private String getVersionEnvString(Context c) {
    String version = "unknown";
    try {
        PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
        version = packageinfo.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        VpnStatus.logException(e);
    }
    return String.format(Locale.US, "%s %s", c.getPackageName(), version);
}
 
Example 3
Source File: VpnProfile.java    From SimpleOpenVpn-Android with Apache License 2.0 5 votes vote down vote up
public String getVersionEnvString(Context c) {
    String version = "unknown";
    try {
        PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
        version = packageinfo.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        VpnStatus.logException(e);
    }
    return String.format(Locale.US, "%s %s", c.getPackageName(), version);

}
 
Example 4
Source File: VpnProfile.java    From Cybernet-VPN with GNU General Public License v3.0 5 votes vote down vote up
private String getVersionEnvString(Context c) {
    String version = "unknown";
    try {
        PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
        version = packageinfo.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        VpnStatus.logException(e);
    }
    return String.format(Locale.US, "%s %s", c.getPackageName(), version);
}
 
Example 5
Source File: VpnProfile.java    From EasyVPN-Free with GNU General Public License v3.0 5 votes vote down vote up
public String getVersionEnvString(Context c) {
    String version = "unknown";
    try {
        PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
        version = packageinfo.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        VpnStatus.logException(e);
    }
    return String.format(Locale.US, "%s %s", c.getPackageName(), version);

}
 
Example 6
Source File: VpnProfile.java    From android with GNU General Public License v3.0 5 votes vote down vote up
public String getVersionEnvString(Context c) {
    String version = "unknown";
    try {
        PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
        version = packageinfo.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        VpnStatus.logException(e);
    }
    return String.format(Locale.US, "%s %s", c.getPackageName(), version);

}
 
Example 7
Source File: VpnProfile.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
public String getVersionEnvString(Context c) {
    String version = "unknown";
    try {
        PackageInfo packageinfo = c.getPackageManager().getPackageInfo(c.getPackageName(), 0);
        version = packageinfo.versionName;
    } catch (PackageManager.NameNotFoundException e) {
        VpnStatus.logException(e);
    }
    return String.format(Locale.US, "%s %s", c.getPackageName(), version);

}
 
Example 8
Source File: LaunchVPN.java    From bitmask_android with GNU General Public License v3.0 5 votes vote down vote up
private void execeuteSUcmd(String command) {
    try {
        ProcessBuilder pb = new ProcessBuilder("su", "-c", command);
        Process p = pb.start();
        int ret = p.waitFor();
        if (ret == 0)
            mCmfixed = true;
    } catch (InterruptedException | IOException e) {
        VpnStatus.logException("SU command", e);
    }
}