From 5a1a4dcbd5ca115b6d1bf2e0a01e800234d3666b Mon Sep 17 00:00:00 2001 From: Gilles Dubois Date: Fri, 10 Nov 2017 11:33:32 +0100 Subject: [PATCH 1/2] Update user agent --- app/src/main/res/values/strings_nt.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings_nt.xml b/app/src/main/res/values/strings_nt.xml index 4369cf8..93d4fff 100644 --- a/app/src/main/res/values/strings_nt.xml +++ b/app/src/main/res/values/strings_nt.xml @@ -29,6 +29,6 @@ 900000 OCS-NG_Android_agent_v2.0 - OCS-NG_Android_agent_v2.3 + OCS-NG_Android_agent_v2.3.1 . \ No newline at end of file From fbeac15cf9dd657aea83e04a00afe1015ada3010 Mon Sep 17 00:00:00 2001 From: Gilles Dubois Date: Fri, 10 Nov 2017 11:35:25 +0100 Subject: [PATCH 2/2] Add check when no proxy adress is set but http proxy option is activated --- .../java/org/ocs/android/actions/OCSProtocol.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/ocs/android/actions/OCSProtocol.java b/app/src/main/java/org/ocs/android/actions/OCSProtocol.java index b37d04e..44415af 100644 --- a/app/src/main/java/org/ocs/android/actions/OCSProtocol.java +++ b/app/src/main/java/org/ocs/android/actions/OCSProtocol.java @@ -22,6 +22,7 @@ import android.content.Context; import android.os.AsyncTask; +import android.text.TextUtils; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; @@ -191,9 +192,13 @@ public String sendmethod(File pFile, String server, boolean gziped) throws OCSPr DefaultHttpClient httpClient = getNewHttpClient(OCSSettings.getInstance().isSSLStrict()); if (ocssettings.isProxy()) { - ocslog.debug("Use proxy : " + ocssettings.getProxyAdr()); - HttpHost proxy = new HttpHost(ocssettings.getProxyAdr(), ocssettings.getProxyPort()); - httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); + if(!TextUtils.isEmpty(ocssettings.getProxyAdr())){ + ocslog.debug("Use proxy : " + ocssettings.getProxyAdr()); + HttpHost proxy = new HttpHost(ocssettings.getProxyAdr(), ocssettings.getProxyPort()); + httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); + }else{ + ocslog.debug("Invalid proxy settings"); + } } if (ocssettings.isAuth()) { ocslog.debug("Use AUTH : " + ocssettings.getLogin() + "/*****");