Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/build.gradle
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/build.gradle	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/build.gradle	(working copy)
@@ -14,8 +14,8 @@
         minSdk 24
         //noinspection EditedTargetSdkVersion
         targetSdk 33
-        versionCode 79
-        versionName "v3.1.2"
+        versionCode 82
+        versionName "v3.1.3"
         setProperty("archivesBaseName", "MotionProGlobal-" + versionName + "-" + (new Date().format('yyyyMMddHH')))
         /**
          * Author: Yunting
@@ -91,10 +91,10 @@
 
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation 'androidx.legacy:legacy-support-v13:1.0.0'
-    implementation 'androidx.appcompat:appcompat:1.5.1' // TODO: 1.6.0 need SDK 33...
+    implementation 'androidx.appcompat:appcompat:1.6.1'
     implementation 'androidx.cardview:cardview:1.0.0'
     implementation 'com.google.android.material:material:1.9.0'
-    implementation 'androidx.annotation:annotation:1.6.0'
+    implementation 'androidx.annotation:annotation:1.7.0'
     implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
     implementation 'androidx.legacy:legacy-support-v4:1.0.0'
     implementation 'junit:junit:4.13.2'
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/AndroidManifest.xml
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/AndroidManifest.xml	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/AndroidManifest.xml	(working copy)
@@ -80,6 +80,13 @@
     <uses-permission android:name="net.arraynetworks.mobilenow.downloader.permission.ACCESS_ALL_DOWNLOADS" />
     <uses-permission android:name="net.arraynetworks.mobilenow.downloader.permission.UPDATE_DEVICE_STATS" />
 
+    <!--
+    Author: Yunting
+    Date: 231003
+    Modify: fix Bug 278, android 13 needs this permission to show notification
+    -->
+    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
+
     <!-- 适配android 11无法唤起第三方apk -->
     <queries>
         <!-- RD Client -->
@@ -225,17 +232,17 @@
             android:launchMode="singleInstance">
             <!--
             Author: Yunting
-            Date: 230817
-            Modify: WebAuth login is performed by WebAuthActivity
+            Date: 231003
+            Modify: fix Bug 309, user can use post method to make MotionPro connect VPN
             -->
-            <!--intent-filter>
+            <intent-filter>
                 <data android:scheme="motionproplus"/>
 
                 <action android:name="android.intent.action.VIEW" />
 
                 <category android:name="android.intent.category.DEFAULT" />
                 <category android:name="android.intent.category.BROWSABLE" />
-            </intent-filter-->
+            </intent-filter>
         </activity>
 
         <!-- SMX Activity -->
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/AppIntentHandler.java
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/AppIntentHandler.java	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/AppIntentHandler.java	(working copy)
@@ -126,19 +126,30 @@
 			if (data != null) {
 				/**
 				 * Author: Yunting
-				 * Date: 230831
-				 * Modify: change to match for IDPass
+				 * Date: 231003
+				 * Modify: fix Bug 309, user can use post method to make MotionPro connect VPN
 				 * */
-
-				/*String scheme = data.getScheme();
+				/*
+				String scheme = data.getScheme();
 				if (!"motionproplus".equals(scheme)) {
 					return;
 				}*/
 
+				/*
 				String path = data.getPath();
 				if(path != null) {
 					if (!path.startsWith("/motionproglobal"))
 						return;
+				}*/
+
+				String scheme = data.getScheme();
+				String path = data.getPath();
+
+				if(path != null) {
+					if (!path.startsWith("/motionproglobal")) {
+						if (!"motionproplus".equals(scheme))
+							return;
+					}
 				}
 
 				mHost = data.getHost();
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/IntentHandlerActivity.java
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/IntentHandlerActivity.java	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/IntentHandlerActivity.java	(working copy)
@@ -43,46 +43,46 @@
 		int status = AppIntentHandler.getInstance().getAction();
 		Log.i(TAG, "handleIntent : status = " + status);
 		switch (status) {
-		case AppIntentHandler.ACTION_CONNECTED:
-			if (AppIntentHandler.getInstance().showUI()) {
-				startResourceActivityIfNeed();
-			}
-			AppIntentHandler.getInstance().onMotionProStatusChanged(VpnMsg.MSG_VPN_CONNECTED);
-			break;
-		case AppIntentHandler.ACTION_CONNECTED_TO_ANOTHER_SITE:
-			String format = getString(R.string.already_connect);
-			String message = String.format(format, ArrayVpn.getInstance().getCurPortal());
-			AppIntentHandler.getInstance().showInfoToast(message);
-			break;
-		case AppIntentHandler.ACTION_DISCONNECTING:
-			AppIntentHandler.getInstance().showInfoToast(R.string.disconnect_wait);
-			break;
-		case AppIntentHandler.ACTION_START_MP:
-			if (!startResourceActivityIfNeed()) {
-				startPortalistActivity();
-			}
-			break;
-		case AppIntentHandler.ACTION_START_AND_LOGIN:
-			startMotionPro();
-			break;
-		case AppIntentHandler.ACTION_START_VPN_BY_SESSION:
-			startMotionProVpnTunnel();
-			break;
-		case AppIntentHandler.ACTION_STOP_VPN:
-			stopMotionProVpnTunnel();
-			break;
-		case AppIntentHandler.ACTION_LOGOUT_MP:
-			logoutMotionPro();
-			break;
-		case AppIntentHandler.ACTION_STATUS:
-			Intent intent = new Intent();
-			intent.putExtra(AppIntentHandler.VPN_STATUS, ArrayVpn.getInstance().getStatus());
-			intent.putExtra(AppIntentHandler.MP_DEVICEID, ArrayVpn.getInstance().getDeviceId());
-			setResult(Activity.RESULT_OK, intent);
-			break;
-		case AppIntentHandler.ACTION_DONOTHING:
-		default:
-			break;
+			case AppIntentHandler.ACTION_CONNECTED:
+				if (AppIntentHandler.getInstance().showUI()) {
+					startResourceActivityIfNeed();
+				}
+				AppIntentHandler.getInstance().onMotionProStatusChanged(VpnMsg.MSG_VPN_CONNECTED);
+				break;
+			case AppIntentHandler.ACTION_CONNECTED_TO_ANOTHER_SITE:
+				String format = getString(R.string.already_connect);
+				String message = String.format(format, ArrayVpn.getInstance().getCurPortal());
+				AppIntentHandler.getInstance().showInfoToast(message);
+				break;
+			case AppIntentHandler.ACTION_DISCONNECTING:
+				AppIntentHandler.getInstance().showInfoToast(R.string.disconnect_wait);
+				break;
+			case AppIntentHandler.ACTION_START_MP:
+				if (!startResourceActivityIfNeed()) {
+					startPortalistActivity();
+				}
+				break;
+			case AppIntentHandler.ACTION_START_AND_LOGIN:
+				startMotionPro();
+				break;
+			case AppIntentHandler.ACTION_START_VPN_BY_SESSION:
+				startMotionProVpnTunnel();
+				break;
+			case AppIntentHandler.ACTION_STOP_VPN:
+				stopMotionProVpnTunnel();
+				break;
+			case AppIntentHandler.ACTION_LOGOUT_MP:
+				logoutMotionPro();
+				break;
+			case AppIntentHandler.ACTION_STATUS:
+				Intent intent = new Intent();
+				intent.putExtra(AppIntentHandler.VPN_STATUS, ArrayVpn.getInstance().getStatus());
+				intent.putExtra(AppIntentHandler.MP_DEVICEID, ArrayVpn.getInstance().getDeviceId());
+				setResult(Activity.RESULT_OK, intent);
+				break;
+			case AppIntentHandler.ACTION_DONOTHING:
+			default:
+				break;
 		}
 		finish();
 		overridePendingTransition(0, 0);
@@ -95,9 +95,15 @@
 	private void stopMotionProVpnTunnel() {
 		ArrayVpn.getInstance().stopTunnelOnly();
 	}
-	
+
 	private void startMotionPro() {
 		AppIntentHandler.getInstance().startVpn();
+		/**
+		 * Author: Yunting
+		 * Date: 231004
+		 * Modify: fix Bug 309, user can use post method to make MotionPro connect VPN and make it to foreground
+		 * */
+		startPortalistActivity();
 	}
 	
 	private void logoutMotionPro() {
@@ -106,7 +112,7 @@
 		ArrayVpn.getInstance().stop();
 		return;
 	}
-	
+
 	private void startPortalistActivity() {
 		Intent intent = new Intent(this, PortalList.class);
 		intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/MainActivity.java
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/MainActivity.java	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/portal/MainActivity.java	(working copy)
@@ -4,12 +4,15 @@
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.IntentFilter;
+
 import androidx.databinding.BaseObservable;
 import androidx.databinding.Bindable;
 import androidx.databinding.DataBindingUtil;
+
 import android.os.Bundle;
 import android.app.Activity;
 import android.os.RemoteException;
+
 import androidx.fragment.app.Fragment;
 import androidx.fragment.app.FragmentActivity;
 import androidx.fragment.app.FragmentManager;
@@ -120,17 +123,17 @@
         }
 
         // [YT] NavBar Resource
-        public void onResourceTabSelected(){
+        public void onResourceTabSelected() {
             MainActivity.this.binding.viewPager.setCurrentItem(RESOURCE_TAB);
         }
 
         // [YT] NavBar Status
-        public void onStatusTabSelected(){
+        public void onStatusTabSelected() {
             MainActivity.this.binding.viewPager.setCurrentItem(STATUS_TAB);
         }
 
         // [YT] NavBar Setting
-        public void onSettingsTabSelected(){
+        public void onSettingsTabSelected() {
             MainActivity.this.binding.viewPager.setCurrentItem(SETTINGS_TAB);
         }
 
@@ -350,6 +353,7 @@
 
     @Override
     protected void onActivityResult(int request, int result, Intent intent) {
+        super.onActivityResult(request, result, intent);
         VpnOnDemand.getInstance().onActivityResult(request, result);
     }
 
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/util/RequestPermissions.java
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/util/RequestPermissions.java	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/java/net/arraynetworks/mobilenow/util/RequestPermissions.java	(working copy)
@@ -9,6 +9,8 @@
 import android.net.Uri;
 import android.os.Build;
 import android.provider.Settings;
+
+import androidx.annotation.RequiresApi;
 import androidx.core.app.ActivityCompat;
 import androidx.core.content.ContextCompat;
 import androidx.appcompat.app.AlertDialog;
@@ -29,6 +31,12 @@
 	public final static int REQUEST_WRITE_EXTERNAL_PERMISSION = 1;
 	/**
 	 * Author: Yunting
+	 * Date: 231003
+	 * Modify: fix Bug 278, add type for android.permission.POST_NOTIFICATIONS permission
+	 * */
+	public final static int MY_PERMISSIONS_REQUEST_NOTIFICATIONS = 4;
+	/**
+	 * Author: Yunting
 	 * Date: 230906
 	 * Modify: change for GooglePlay store, comment code is for Huawei App Store
 	 * */
@@ -52,9 +60,29 @@
 		return ContextCompat.checkSelfPermission(mActivity,
 				Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
 	}
+
+	/**
+	 * Author: Yunting
+	 * Date: 231003
+	 * Modify: fix Bug 278, when sdk version >= 33, ask for notification permission
+	 * */
+	@RequiresApi(api = Build.VERSION_CODES.TIRAMISU)
+	private boolean has_POST_NOTIFICATION() {
+		return ContextCompat.checkSelfPermission(mActivity,
+				Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
+	}
 	
 	public boolean allPermissionsGranted() {
-		return has_READ_PHONE_STATE() && has_WRITE_EXTERNAL_STORAGE();
+		/**
+		 * Author: Yunting
+		 * Date: 231003
+		 * Modify: fix Bug 278, when sdk version >= 33, ask for notification permission
+		 * */
+		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+			return has_READ_PHONE_STATE() && has_WRITE_EXTERNAL_STORAGE() && has_POST_NOTIFICATION();
+		} else {
+			return has_READ_PHONE_STATE() && has_WRITE_EXTERNAL_STORAGE();
+		}
 	}
 
 	public void setCallback(CommonCallback callback){
@@ -62,12 +90,28 @@
 	}
 
 	public boolean requestPermissions() {
-		if ((!has_READ_PHONE_STATE()) || (!has_WRITE_EXTERNAL_STORAGE())) {
-			ActivityCompat.requestPermissions(mActivity, new String[] {
-					Manifest.permission.READ_PHONE_STATE,
-					Manifest.permission.WRITE_EXTERNAL_STORAGE },
-					MY_PERMISSIONS_REQUEST_PERMISSIONS);
-			return false;
+		/**
+		 * Author: Yunting
+		 * Date: 231003
+		 * Modify: fix Bug 278, when sdk version >= 33, ask for notification permission
+		 * */
+		if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+			if ((!has_READ_PHONE_STATE()) || (!has_WRITE_EXTERNAL_STORAGE()) || (!has_POST_NOTIFICATION())) {
+				ActivityCompat.requestPermissions(mActivity, new String[] {
+								Manifest.permission.READ_PHONE_STATE,
+								Manifest.permission.WRITE_EXTERNAL_STORAGE,
+								Manifest.permission.POST_NOTIFICATIONS},
+						MY_PERMISSIONS_REQUEST_PERMISSIONS);
+				return false;
+			}
+		} else {
+			if ((!has_READ_PHONE_STATE()) || (!has_WRITE_EXTERNAL_STORAGE())) {
+				ActivityCompat.requestPermissions(mActivity, new String[] {
+								Manifest.permission.READ_PHONE_STATE,
+								Manifest.permission.WRITE_EXTERNAL_STORAGE },
+						MY_PERMISSIONS_REQUEST_PERMISSIONS);
+				return false;
+			}
 		}
 		return true;
 	}
@@ -121,6 +165,22 @@
 				break;
 		// other 'case' lines to check for other
 		// permissions this app might request
+
+			/**
+			 * Author: Yunting
+			 * Date: 231003
+			 * Modify: fix Bug 278, case for notification type
+			 * */
+			case MY_PERMISSIONS_REQUEST_NOTIFICATIONS: {
+				if (granted) {
+					if (callback != null) callback.result("", CommonConstant.COMMON_CONSTANT_SUCCESS);
+				} else {
+					if (callback != null) callback.result("", CommonConstant.COMMON_CONSTANT_ERROR);
+					DialogUtils.getInstence().oneBtnDialog(mActivity,mActivity.getString(R.string.privacy_agreement_tip_title),
+							mActivity.getString(R.string.permission_notification),mActivity.getString(R.string.ok),null);
+				}
+				break;
+			}
 		}
 	}
 
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res/values-zh/strings.xml
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res/values-zh/strings.xml	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res/values-zh/strings.xml	(working copy)
@@ -574,6 +574,7 @@
     <string name="request_phone_permission">我们需要通过获取电话权限来获取手机的唯一标识</string>
 	<string name="permission_deny_info">拒绝此权限后应用无法正常工作。\n\n请通过设置->应用和通知->权限管理->MotionPro手动开启 “读写手机存储” 及 “电话” 权限。</string>
     <string name="permission_write_deny_info">拒绝此权限后应用无法正常工作。\n\n请通过设置->应用和通知->权限管理->MotionPro手动开启 “读写手机存储” 权限。</string>
+    <string name="permission_notification">拒绝此权限后应用无法正常工作。\n\n请通过设置->应用和通知->权限管理->MotionPro手动开启 “通知” 权限。</string>
 	<string name="privacy_policy">隐私权政策</string>
     <string name="disconnect_wait">MotionPro正在断开，请稍后。</string>
 	<string name="already_connect">MotionPro已经连接至 %s，请先注销。</string>
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res	(working copy)

Property changes on: motionpro_android/app/src/main/res
___________________________________________________________________
Added: svn:global-ignores
## -0,0 +1 ##
+values-zh
Added: svn:ignore
## -0,0 +1 ##
+values-zh
Index: /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res/values/strings.xml
===================================================================
--- /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res/values/strings.xml	(revision 8419)
+++ /branches/ag_client_motionpro_android_3.1.3/motionpro_android/app/src/main/res/values/strings.xml	(working copy)
@@ -1125,6 +1125,7 @@
     <string name="request_phone_permission">We need to obtain the unique identification of the mobile phone by obtaining the phone permission</string>
     <string name="permission_deny_info">The app will not work properly if the permission is denied. You should manually enable the permissions "Read/Write Mobile Phone Storage" and "Phone" \n\nvia Settings->Application&#38;Notifications->Permission Manager->MotionPro.</string>
     <string name="permission_write_deny_info">The app will not work properly if the permission is denied. You should manually enable the permissions "Read/Write Mobile Phone Storage" \n\nvia Settings->Application&#38;Notifications->Permission Manager->MotionPro.</string>
+    <string name="permission_notification">The app will not work properly if the permission is denied. You should manually enable the permissions "Post Notifications" \n\nvia Settings->Application&#38;Notifications->Permission Manager->MotionPro.</string>
     <string name="privacy_policy">Privacy Policy</string>
     <string name="disconnect_wait">MotionPro is disconnecting, please wait.</string>
     <string name="already_connect">MotionPro is connected to %s, please logout first!</string>
