Преглед на файлове

Apex Mobile
修复首页列表加载后闪退的bug。这个是因为昨天写的时候,后台还没有,导致app和后台数据类型不一致。
修复Detail 分享没有带上邮件收件人,主题等参数的bug。
测试混淆和打包,解决混淆报错的问题。
关闭消息推送功能。新的消息推送会在以后加上,未来这部分可能会有大的修改。
去掉中文支持

Ray Zhang преди 8 години
родител
ревизия
91f6dd08a9

+ 4 - 0
Apex Mobile/app/app.iml

@@ -93,9 +93,12 @@
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged-not-compiled-resources" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/multi-dex" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard-rules" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
+      <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res_stripped" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
@@ -103,6 +106,7 @@
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
       <excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
       <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
+      <excludeFolder url="file://$MODULE_DIR$/build/reports" />
       <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
     </content>
     <orderEntry type="jdk" jdkName="Android API 26 Platform" jdkType="Android SDK" />

+ 1 - 1
Apex Mobile/app/proguard-project.txt

@@ -23,7 +23,7 @@
 
 -dontwarn android.support.v4.** 
 -dontwarn com.google.android.gms.** 
-
+-dontwarn javax.naming.**
 
 # Remove all Verbose/Debug logging
 -optimizations code/removal/simple,code/removal/advanced

+ 18 - 16
Apex Mobile/app/src/main/AndroidManifest.xml

@@ -109,28 +109,30 @@
         </provider>
 
         <!-- release key -->
-        <!-- <meta-data -->
-        <!-- android:name="com.google.android.maps.v2.API_KEY" -->
-        <!-- android:value="AIzaSyDdbk58Lx6QzaXcB_hNpSHVp3l_CJeNpoo" /> -->
+         <meta-data
+         android:name="com.google.android.maps.v2.API_KEY"
+         android:value="AIzaSyDdbk58Lx6QzaXcB_hNpSHVp3l_CJeNpoo" />
 
 
-        <!-- <meta-data -->
-        <!-- android:name="com.baidu.lbsapi.API_KEY" -->
-        <!-- android:value="nqBQoSDbxrslhuzW91uViQX7" /> -->
-
-
-        <!-- debug key -->
-
-        <meta-data
-            android:name="com.google.android.maps.v2.API_KEY"
-            android:value="AIzaSyD6Snyg2SDUGtkC3sOAr979__IDCZnGGuU" />
-        <meta-data
-            android:name="com.baidu.lbsapi.API_KEY"
-            android:value="tznWFxd3RvSoul1TGQp6GSzo" />
+         <meta-data
+         android:name="com.baidu.lbsapi.API_KEY"
+         android:value="nqBQoSDbxrslhuzW91uViQX7" />
         <meta-data
             android:name="com.google.android.gms.version"
             android:value="@integer/google_play_services_version" />
 
+        <!-- debug key -->
+
+        <!--<meta-data-->
+            <!--android:name="com.google.android.maps.v2.API_KEY"-->
+            <!--android:value="AIzaSyD6Snyg2SDUGtkC3sOAr979__IDCZnGGuU" />-->
+        <!--<meta-data-->
+            <!--android:name="com.baidu.lbsapi.API_KEY"-->
+            <!--android:value="tznWFxd3RvSoul1TGQp6GSzo" />-->
+        <!--<meta-data-->
+            <!--android:name="com.google.android.gms.version"-->
+            <!--android:value="@integer/google_play_services_version" />-->
+
         <activity
             android:name=".DetailActivity"
             android:label="@string/title_activity_detail"

+ 3 - 1
Apex Mobile/app/src/main/java/com/usai/apex/ApexTrackingApplication.java

@@ -6,7 +6,6 @@ import android.app.PendingIntent;
 import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
-import android.os.Environment;
 import android.os.SystemClock;
 import android.text.TextUtils;
 import android.util.Log;
@@ -117,6 +116,9 @@ public class ApexTrackingApplication extends Application
 
 	public static void startalarm(String caller)
 	{
+		// 新版暂时停用通知
+		if(true)
+			return;
 		SharedPreferences pref = get_instance()
 				.getSharedPreferences("Apex", 0);
 		boolean autologin = pref.getBoolean("autologin", false);

+ 3 - 4
Apex Mobile/app/src/main/java/com/usai/apex/DetailActivity.java

@@ -24,7 +24,6 @@ import android.widget.TextView;
 
 import com.usai.apex.Result.AMResultActivity;
 import com.usai.apex.mainframe.RootActivity;
-import com.usai.util.RAUtil;
 import com.usai.util.commonUtil;
 import com.usai.util.dbUtil;
 
@@ -52,7 +51,7 @@ public class DetailActivity extends AppCompatActivity implements
 	String							cargo_criterion;
 	int								criterion_type;
 
-
+	String email_to = null,email_subject = null,email_content = null;
 	TextView mtitleview;
 	@Override
 	public void setTitle(CharSequence title) {
@@ -104,7 +103,7 @@ public class DetailActivity extends AppCompatActivity implements
 	}
 
 
-	String email_to = null,email_subject = null,email_content = null;
+//	String email_to = null,email_subject = null,email_content = null;
 
 	public void save_content(String which,String content)
 	{
@@ -548,7 +547,7 @@ public class DetailActivity extends AppCompatActivity implements
 //				share.putExtra(Intent.EXTRA_STREAM, uri);
 				share.setType("text/plain");
 
-				String email_to = null,email_subject = null,email_content = null;
+
 
 
 				if (email_content != null) {

+ 5 - 1
Apex Mobile/app/src/main/java/com/usai/apex/mainframe/HistoryFragment.java

@@ -5,6 +5,7 @@ import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.ListView;
@@ -225,6 +226,9 @@ public class HistoryFragment extends TrackingListFragment {
 
 
         String cargo_criterion = (String) searchresult.getData().get(position).get("hbol");
+        String serial_no = (String) searchresult.getData().get(position).get("serial_no");
+        if(TextUtils.isEmpty(serial_no))
+            serial_no = "dumb";
 
         Intent intent = new Intent();
         intent.setClass(getContext(), DetailActivity.class);
@@ -234,7 +238,7 @@ public class HistoryFragment extends TrackingListFragment {
 
         intent.putExtra("cargo_criterion", cargo_criterion);
         intent.putExtra("actions_count", 1);
-        intent.putExtra("_id", "dumb");
+        intent.putExtra("_id", serial_no);
 
         intent.putExtra("criterion_type", 0);
         String h_field = "h_bol";

+ 6 - 1
Apex Mobile/app/src/main/java/com/usai/apex/mainframe/HomeFragment.java

@@ -5,6 +5,7 @@ import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.widget.ListView;
@@ -157,6 +158,9 @@ public class HomeFragment extends TrackingListFragment {
 
         String cargo_criterion = (String) searchresult.getData().get(position).get("hbol");
 
+        String serial_no = (String) searchresult.getData().get(position).get("serial_no");
+if(TextUtils.isEmpty(serial_no))
+    serial_no = "dumb";
         Intent intent = new Intent();
         intent.setClass(getContext(), DetailActivity.class);
 
@@ -165,7 +169,8 @@ public class HomeFragment extends TrackingListFragment {
 
         intent.putExtra("cargo_criterion", cargo_criterion);
         intent.putExtra("actions_count", 1);
-        intent.putExtra("_id", "dumb");
+        intent.putExtra("_id", serial_no);
+
 
         intent.putExtra("criterion_type", 0);
         String h_field = "h_bol";

+ 6 - 5
Apex Mobile/app/src/main/java/com/usai/apex/mainframe/TrackingListFragment.java

@@ -8,6 +8,7 @@ import android.support.v4.app.Fragment;
 import android.support.v4.app.ListFragment;
 import android.support.v4.widget.SwipeRefreshLayout;
 import android.support.v7.app.AlertDialog;
+import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -236,13 +237,13 @@ public class TrackingListFragment extends ListFragment {
             View v=(View) convertView
                     .findViewById(R.id.v_transport_stage);
 
-            Object o =result.getData().get(position).get("transport_stage");
+            String sstransport_stage =result.getData().get(position).get("transport_stage").toString();
 
-            if(o==null)
-                 o=0;
-            int  transport_stage = (int)o;
+            if(TextUtils.isEmpty(sstransport_stage))
+                sstransport_stage="0";
+            int  transport_stage = Integer.valueOf(sstransport_stage).intValue();
 
-             switch(9)
+             switch(transport_stage)
              {
 
                  case 0:

+ 1 - 1
Apex Mobile/app/src/main/java/com/usai/apex/swipemenulistview/SwipeMenuLayout.java

@@ -132,7 +132,7 @@ public class SwipeMenuLayout extends FrameLayout {
 		LayoutParams contentParams = new LayoutParams(
 				LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
 		mContentView.setLayoutParams(contentParams);
-		if (mContentView.getId() < 1) {
+		if ((int)mContentView.getId() < 1) {
 			mContentView.setId(CONTENT_VIEW_ID);
 		}
 

+ 105 - 21
Apex Mobile/app/src/main/java/com/usai/util/Network.java

@@ -104,6 +104,8 @@ public class Network
 	public static final int		RESULT_SESSION_EXPIRED			= -13;
 	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";
 
@@ -118,6 +120,25 @@ public class Network
 	public static String		URL_LOG						= "https://ra.apexshipping.com/mobile_news.php";
 
 
+//
+////debug
+//	public static String		URL_HOME				= "http://192.168.0.155/Online/Online/main_new.php";
+//	public static String		URL_HISTORY				= "http://192.168.0.155/Online/Online/main_new.php";
+//
+//	public static String		URL_UPDATE_AUTH					= "http://192.168.0.155/Online/Online/login.php";
+//	public static String		URL_REQUEST_COUNT				= "http://192.168.0.155/Online/Online/main_new.php";
+//	public static String		URL_REQUEST_RECORDS				= "http://192.168.0.155/Online/Online/main_new.php";
+//	public static String		URL_RETRIEVE_PASS				= "http://192.168.0.155/Online/Online/main_new.php";
+//	public static String		URL_ANNOUNCEMENTS				= "http://192.168.0.155/Online/Online/mobile_news.php";
+//	public static String		URL_NEWS						= "http://192.168.0.155/Online/Online/mobile_news.php";
+//	public static String		URL_LOCATIONS					= "http://192.168.0.155/Online/Online/mobile_news.php";
+//	public static String		URL_PUSH						= "http://192.168.0.155/Online/Online/main_new.php";
+//	public static String		URL_LOG						= "http://192.168.0.155/Online/Online/mobile_news.php";
+//
+
+
+	
+
 	private static HttpClient getNewHttpClient()
 	{
 		try
@@ -800,6 +821,8 @@ public class Network
 
 	public static String check_push()
 	{
+	    if(true)
+	        return null;
 		String TAG = "net_dbg@check_push";
 		Bundle parms = new Bundle();
 		parms.putString("action", "handset_search");
@@ -1379,6 +1402,81 @@ public class Network
 		return bavailable;
 	}
 
+//	public static class SSLSocketFactoryEx extends SSLSocketFactory
+//	{
+//
+//		SSLContext	sslContext	= SSLContext.getInstance("TLS");
+//
+//		public SSLSocketFactoryEx(KeyStore truststore)
+//				throws NoSuchAlgorithmException, KeyManagementException,
+//				KeyStoreException, UnrecoverableKeyException
+//		{
+//			super(truststore);
+//
+//			TrustManager tm = new X509TrustManager()
+//			{
+//				public java.security.cert.X509Certificate[] getAcceptedIssuers()
+//				{
+//					return null;
+//				}
+//
+//				@Override
+//				public void checkClientTrusted(
+//						java.security.cert.X509Certificate[] chain,
+//						String authType)
+//						throws java.security.cert.CertificateException
+//				{
+//				}
+//
+////				@Override
+////				public void checkServerTrusted(
+////						java.security.cert.X509Certificate[] chain,
+////						String authType)
+////						throws java.security.cert.CertificateException
+////				{
+////				}
+////				@Override
+////				public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
+////	                try {
+////	                    chain[0].checkValidity();
+////	                } catch (java.security.cert.CertificateExpiredException e) {
+////	                   // Logger.e(TAG, "CertificateExpiredException");
+////	                    throw new java.security.cert.CertificateException("CertificateExpiredException");
+////	                } catch (java.security.cert.CertificateNotYetValidException e) {
+////	                    //Logger.e(TAG, "CertificateNotYetValidException");
+////	                    throw new java.security.cert.CertificateException("CertificateNotYetValidException");
+////	                }
+////	            }@Override
+////				public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
+////	                try {
+////	                    chain[0].checkValidity();
+////	                } catch (java.security.cert.CertificateExpiredException e) {
+////	                   // Logger.e(TAG, "CertificateExpiredException");
+////	                    throw new java.security.cert.CertificateException("CertificateExpiredException");
+////	                } catch (java.security.cert.CertificateNotYetValidException e) {
+////	                    //Logger.e(TAG, "CertificateNotYetValidException");
+////	                    throw new java.security.cert.CertificateException("CertificateNotYetValidException");
+////	                }
+////	            }
+//			};
+//			sslContext.init(null, new TrustManager[] { tm }, null);
+//		}
+//
+//		@Override
+//		public Socket createSocket(Socket socket, String host, int port,
+//				boolean autoClose) throws IOException, UnknownHostException
+//		{
+//			return sslContext.getSocketFactory().createSocket(socket, host,
+//					port, autoClose);
+//		}
+//
+//		@Override
+//		public Socket createSocket() throws IOException
+//		{
+//			return sslContext.getSocketFactory().createSocket();
+//		}
+//	}
+
 	public static class SSLSocketFactoryEx extends SSLSocketFactory
 	{
 
@@ -1405,33 +1503,20 @@ public class Network
 				{
 				}
 
-//				@Override
-//				public void checkServerTrusted(
-//						java.security.cert.X509Certificate[] chain,
-//						String authType)
-//						throws java.security.cert.CertificateException
-//				{
-//				}
 				@Override
-				public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
-	                try {
-	                    chain[0].checkValidity();
-	                } catch (java.security.cert.CertificateExpiredException e) {
-	                   // Logger.e(TAG, "CertificateExpiredException");
-	                    throw new java.security.cert.CertificateException("CertificateExpiredException");
-	                } catch (java.security.cert.CertificateNotYetValidException e) {
-	                    //Logger.e(TAG, "CertificateNotYetValidException");
-	                    throw new java.security.cert.CertificateException("CertificateNotYetValidException");
-	                }
-	            }
+				public void checkServerTrusted(
+						java.security.cert.X509Certificate[] chain,
+						String authType)
+						throws java.security.cert.CertificateException
+				{
+				}
 			};
 			sslContext.init(null, new TrustManager[] { tm }, null);
 		}
 
 		@Override
 		public Socket createSocket(Socket socket, String host, int port,
-				boolean autoClose) throws IOException, UnknownHostException
-		{
+								   boolean autoClose) throws IOException {
 			return sslContext.getSocketFactory().createSocket(socket, host,
 					port, autoClose);
 		}
@@ -1442,7 +1527,6 @@ public class Network
 			return sslContext.getSocketFactory().createSocket();
 		}
 	}
-
 	private static String createPostParameters(Bundle parms) throws UnsupportedEncodingException {
 		StringBuilder result = new StringBuilder();
 		boolean first = true;