import org.evergreen_ils.searchCatalog.Library;
import org.opensrf.util.JSONException;
import org.opensrf.util.JSONReader;
+import org.w3c.dom.Text;
import java.util.*;
libraries.clear();
if (isDebuggable()) {
- Library library = new Library("https://demo.evergreencatalog.com", "evergreencatalog.com Demo", "0ut There, US (evergreencatalog.com Demo)", null);
- //Library library = new Library("http://mlnc4.mvlcstaff.org", "MVLC Demo", "0ut There, US (MVLC Demo)", null);// SSL not working
+ //Library library = new Library("https://demo.evergreencatalog.com", "evergreencatalog.com Demo", "0ut There, US (evergreencatalog.com Demo)", null);
+ Library library = new Library(cleartextHack("https://mlnc4.mvlcstaff.org"), "MVLC Demo", "0ut There, US (MVLC Demo)", null);// SSL not working
libraries.add(library);
}
}
for (Map<String, ?> map : l) {
String url = (String) map.get("url");
+ url = cleartextHack(url);
String directory_name = (String) map.get("directory_name");
String short_name = (String) map.get("short_name");
Double latitude = (Double) map.get("latitude");
}
}
+ private String cleartextHack(String url) {
+ // fixes SSL issue with gapines and other sites
+ if (TextUtils.equals(url, "https://gapines.org")
+ || TextUtils.equals(url, "https://mlnc4.mvlcstaff.org"))
+ {
+ try {
+ String new_url = url.replaceFirst("^https:", "http:");
+ return new_url;
+ } catch (Exception e) {
+ Log.d(TAG, "caught", e);
+ }
+ }
+ return url;
+ }
+
public boolean isDebuggable() {
return (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE));
}
@SuppressWarnings("unchecked")
public static String signIn(String library_url, String username, String password) throws AuthenticationException {
- Log.d(TAG, "signIn> "+username);
+ Log.d(TAG, "signIn> "+username+" "+library_url);
HttpConnection conn;
try {
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<!-- uses-feature elements are used in Play Store device matching -->
+ <uses-feature android:name="android.hardware.location" android:required="false" />
+ <uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
<uses-feature android:name="android.hardware.screen.portrait" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<application
android:allowBackup="true"
android:icon="@drawable/evergreen_launcher_icon"
- android:label="@string/ou_library_name"
+ android:label="@string/ou_app_label"
android:theme="@style/Theme.AppCompat" >
<!-- Notification receiver -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.kenstir.apps.hemlock"
android:installLocation="auto"
- android:versionCode="5"
+ android:versionCode="6"
android:versionName="1.0">
<uses-sdk
<uses-feature android:name="android.hardware.screen.landscape" android:required="false" />
<uses-feature android:name="android.hardware.screen.portrait" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
+
<application
android:allowBackup="true"
android:icon="@drawable/evergreen_launcher_icon"
} catch (java.io.IOException ex) {
failed = true;
failure = ex;
+ Log.d(TAG, "caught exception", ex);
}
return this;
} catch (java.io.IOException ex) {
failed = true;
failure = ex;
+ Log.d(TAG, "caught exception", ex);
}
readComplete = true;
// not using URLEncoder because it replaces ' ' with '+'.
uri = new URI("http", "", null, postData.toString(), null);
} catch (java.net.URISyntaxException ex) {
- ex.printStackTrace();
+ Log.d(TAG, "caught exception", ex);
}
return uri.getRawQuery();