diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 1e06288..5870003 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="7" + android:versionName="@string/version" xmlns:android="http://schemas.android.com/apk/res/android"> diff --git a/res/layout/settings.xml b/res/layout/settings.xml index e534dbb..1879d91 100644 --- a/res/layout/settings.xml +++ b/res/layout/settings.xml @@ -89,6 +89,14 @@ android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/btnDone" /> + + API global token : Your username ID (user_id in Feed URL): Your token (token in Feed URL): + 1.5.3.1 diff --git a/src/fr/gaulupeau/apps/Poche/Poche.java b/src/fr/gaulupeau/apps/Poche/Poche.java index 305ae0e..7487f8c 100644 --- a/src/fr/gaulupeau/apps/Poche/Poche.java +++ b/src/fr/gaulupeau/apps/Poche/Poche.java @@ -352,9 +352,19 @@ import static fr.gaulupeau.apps.Poche.ArticlesSQLiteOpenHelper.ARTICLE_SYNC; // Set the url (you will need to change this to your RSS URL url = new URL(pocheUrl + "/?feed&type=home&user_id=" + apiUsername + "&token=" + apiToken ); // Setup the connection - trustEveryone(); - HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); - if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) + HttpsURLConnection conn_s = null; + HttpURLConnection conn = null; + if (pocheUrl.startsWith("https") ) { + trustEveryone(); + conn_s = (HttpsURLConnection) url.openConnection(); + }else{ + conn = (HttpURLConnection) url.openConnection(); + } + + if ( + ((conn != null) && (conn.getResponseCode() == HttpURLConnection.HTTP_OK)) + || ((conn_s != null) && (conn_s.getResponseCode() == HttpURLConnection.HTTP_OK)) + ) { // Retreive the XML from the URL