diff --git a/app/src/main/java/app/openconnect/core/OpenConnectManagementThread.java b/app/src/main/java/app/openconnect/core/OpenConnectManagementThread.java index 3c706422..64d2df13 100644 --- a/app/src/main/java/app/openconnect/core/OpenConnectManagementThread.java +++ b/app/src/main/java/app/openconnect/core/OpenConnectManagementThread.java @@ -707,11 +707,12 @@ private boolean runVPN() { mCacheDir = mContext.getCacheDir().getPath(); extractBinaries(); - String userAgent = getStringPref("reported_user_agent"); + String userAgent = getBoolPref("reported_user_agent_override") + ? getStringPref("reported_user_agent") : null; setState(STATE_CONNECTING); synchronized (mMainloopLock) { - if (userAgent.length() > 0) + if (userAgent != null) mOC = new AndroidOC(userAgent); else mOC = new AndroidOC(); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 72e93a60..3c23a030 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -164,8 +164,10 @@ Unknown Batch mode Reported OS + Override reported User-Agent + Use a custom HTTP User-Agent header, instead of OpenConnect's default; some servers are picky about this value. Reported User-Agent - Override the HTTP User-Agent header.\n\nSome Cisco servers accept \"Cisco AnyConnect VPN Agent\"; some Juniper servers accept \"ncsvc\". + Some Cisco servers accept \"Cisco AnyConnect VPN Agent\"; some Juniper servers accept \"ncsvc\". Custom CSD wrapper Split tunnel mode Split tunnel networks diff --git a/app/src/main/res/xml/pref_openconnect.xml b/app/src/main/res/xml/pref_openconnect.xml index 7afe7d83..8c422eab 100644 --- a/app/src/main/res/xml/pref_openconnect.xml +++ b/app/src/main/res/xml/pref_openconnect.xml @@ -79,12 +79,18 @@ android:entries="@array/reported_os_entries" android:entryValues="@array/reported_os_values" android:defaultValue="android" /> + + android:defaultValue="OpenConnect VPN Agent (Java)" />