|
|
@@ -1,18 +1,27 @@
|
|
|
package com.usai.util;
|
|
|
|
|
|
-import java.io.BufferedReader;
|
|
|
-import java.io.BufferedWriter;
|
|
|
+import android.content.Context;
|
|
|
+import android.content.SharedPreferences.Editor;
|
|
|
+import android.content.pm.PackageInfo;
|
|
|
+import android.content.pm.PackageManager;
|
|
|
+import android.content.pm.PackageManager.NameNotFoundException;
|
|
|
+import android.database.Cursor;
|
|
|
+import android.database.sqlite.SQLiteDatabase;
|
|
|
+import android.database.sqlite.SQLiteStatement;
|
|
|
+import android.os.Bundle;
|
|
|
+import android.text.TextUtils;
|
|
|
+import android.util.Log;
|
|
|
+
|
|
|
+import com.usai.apex.ApexTrackingApplication;
|
|
|
+
|
|
|
+import org.apache.http.conn.ssl.SSLSocketFactory;
|
|
|
+import org.json.JSONArray;
|
|
|
+import org.json.JSONException;
|
|
|
+import org.json.JSONObject;
|
|
|
+
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
-import java.io.InputStream;
|
|
|
-import java.io.InputStreamReader;
|
|
|
-import java.io.OutputStream;
|
|
|
-import java.io.OutputStreamWriter;
|
|
|
-import java.io.UnsupportedEncodingException;
|
|
|
-import java.net.HttpURLConnection;
|
|
|
import java.net.Socket;
|
|
|
-import java.net.URL;
|
|
|
-import java.net.URLEncoder;
|
|
|
import java.net.UnknownHostException;
|
|
|
import java.security.KeyManagementException;
|
|
|
import java.security.KeyStore;
|
|
|
@@ -20,40 +29,11 @@ import java.security.KeyStoreException;
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
import java.security.UnrecoverableKeyException;
|
|
|
import java.util.Iterator;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
import javax.net.ssl.SSLContext;
|
|
|
import javax.net.ssl.TrustManager;
|
|
|
import javax.net.ssl.X509TrustManager;
|
|
|
|
|
|
-import org.apache.http.conn.ssl.SSLSocketFactory;
|
|
|
-
|
|
|
-
|
|
|
-import org.json.JSONArray;
|
|
|
-import org.json.JSONException;
|
|
|
-import org.json.JSONObject;
|
|
|
-
|
|
|
-
|
|
|
-import com.usai.apex.ApexTrackingApplication;
|
|
|
-
|
|
|
-
|
|
|
-import android.content.Context;
|
|
|
-import android.content.SharedPreferences.Editor;
|
|
|
-import android.content.pm.PackageInfo;
|
|
|
-import android.content.pm.PackageManager;
|
|
|
-import android.content.pm.PackageManager.NameNotFoundException;
|
|
|
-import android.database.Cursor;
|
|
|
-import android.database.sqlite.SQLiteDatabase;
|
|
|
-import android.database.sqlite.SQLiteStatement;
|
|
|
-import android.net.ConnectivityManager;
|
|
|
-import android.net.NetworkInfo;
|
|
|
-import android.os.Bundle;
|
|
|
-import android.os.Environment;
|
|
|
-import android.text.TextUtils;
|
|
|
-import android.util.Log;
|
|
|
-
|
|
|
public class Network
|
|
|
{
|
|
|
public static final int BEHAVIOR_SEARCH = 0;
|
|
|
@@ -89,50 +69,50 @@ public class Network
|
|
|
public static final int RESULT_VER_LOW = -15;
|
|
|
|
|
|
|
|
|
- //release
|
|
|
-// public static String URL_HOME = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_HISTORY = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_KPI = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_UPDATE_AUTH = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_REQUEST_COUNT = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_REQUEST_RECORDS = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_RETRIEVE_PASS = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_ANNOUNCEMENTS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
-// public static String URL_NEWS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
-// public static String URL_LOCATIONS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
-// public static String URL_PUSH = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_LOG = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
-// public static String URL_SEND_COMM_EMAIL = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_CHECK_UPDATE = "https://ra.apexshipping.com/main_new.php";
|
|
|
-
|
|
|
- // 2019.1.5
|
|
|
-// public static String URL_UPLOAD_SQL = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_FETCH_RESULT = "https://ra.apexshipping.com/main_new.php";
|
|
|
-// public static String URL_SAVE_RESULT = "https://ra.apexshipping.com/main_new.php";
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-//
|
|
|
-////debug
|
|
|
- public static String URL_HOME = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_HISTORY = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_KPI = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_UPDATE_AUTH = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_REQUEST_COUNT = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_REQUEST_RECORDS = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_RETRIEVE_PASS = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+//// release
|
|
|
+ public static String URL_HOME = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_HISTORY = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_KPI = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_UPDATE_AUTH = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_REQUEST_COUNT = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_REQUEST_RECORDS = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_RETRIEVE_PASS = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
public static String URL_ANNOUNCEMENTS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
public static String URL_NEWS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
public static String URL_LOCATIONS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
- public static String URL_PUSH = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+ public static String URL_PUSH = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
public static String URL_LOG = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
- public static String URL_SEND_COMM_EMAIL = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_CHECK_UPDATE = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+ public static String URL_SEND_COMM_EMAIL = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_CHECK_UPDATE = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+
|
|
|
+
|
|
|
+ public static String URL_UPLOAD_SQL = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_FETCH_RESULT = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
+ public static String URL_SAVE_RESULT = "https://ra.apexshipping.com/main_new_26.php";
|
|
|
|
|
|
|
|
|
- public static String URL_UPLOAD_SQL = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_FETCH_RESULT = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
- public static String URL_SAVE_RESULT = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+//
|
|
|
+////
|
|
|
+//////debug
|
|
|
+// public static String URL_HOME = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_HISTORY = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_KPI = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_UPDATE_AUTH = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_REQUEST_COUNT = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_REQUEST_RECORDS = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_RETRIEVE_PASS = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_ANNOUNCEMENTS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
+// public static String URL_NEWS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
+// public static String URL_LOCATIONS = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
+// public static String URL_PUSH = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_LOG = "https://ra.apexshipping.com/mobile_news.php";
|
|
|
+// public static String URL_SEND_COMM_EMAIL = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_CHECK_UPDATE = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+//
|
|
|
+//
|
|
|
+// public static String URL_UPLOAD_SQL = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_FETCH_RESULT = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
+// public static String URL_SAVE_RESULT = "http://192.168.0.138:8899/main_new_26.php";
|
|
|
|
|
|
|
|
|
|
|
|
@@ -815,7 +795,7 @@ public class Network
|
|
|
{
|
|
|
|
|
|
String TAG = "net_dbg@get_Auth";
|
|
|
- Log.d(TAG, "u:" + name + ";p:" + password);
|
|
|
+// Log.d(TAG, "u:" + name + ";p:" + password);
|
|
|
if (!Network.NetworkIsAvailable())
|
|
|
{
|
|
|
Log.d(TAG, "network not available!");
|