优化配置项;优化VPN模式按钮;优化验证码倒计时;优化“检查更新”

This commit is contained in:
ZhanG committed 2022-12-12 12:11:53 +08:00
1 parent cea9a70622
commit 2e32b6f573
12 files changed
+300 -112

No files matched your search

+7 -1
View File
@@ -25,11 +25,17 @@ android {
// APK导出时需要的身份签名(内含APP所属单位、APP版本号信息)
signingConfigs {
debug {
v1SigningEnabled true
v2SigningEnabled true
}
release {
keyAlias 'pkukey'
keyPassword 'pkusz111'
storeFile file('pkukey.jks')
storePassword 'pkusz111'
v1SigningEnabled true
v2SigningEnabled true
}
}
@@ -43,7 +49,7 @@ android {
minSdkVersion 24
targetSdkVersion 30
versionCode 2
versionName "2.1.4"
versionName "2.1.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -9,6 +9,8 @@ package com.pkusz.min_vpn_client.activity.loginSMS;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;
@@ -67,6 +69,7 @@ public class LoginSMSActivity extends MINVpnBaseActivity<LoginSMSActivityPresent
private VerificationCodeEditText etSMSNumber; // 短信验证码
private CountDownButton getSMScode;
private CircularProgressButton btnLogin;
private Handler handler;
@Override
@@ -83,6 +86,12 @@ public class LoginSMSActivity extends MINVpnBaseActivity<LoginSMSActivityPresent
etSMSNumber=findViewById(R.id.etSMSNumber);
getSMScode=findViewById(R.id.getSMScode);
btnLogin=findViewById(R.id.btnLoginWithSMS);
handler=new Handler(){
@Override
public void handleMessage(Message msg) {
getSMScode.removeCountDown();
}
};
initView();
}
@@ -118,16 +127,49 @@ public class LoginSMSActivity extends MINVpnBaseActivity<LoginSMSActivityPresent
if (rawUsername.isEmpty() || phoenNumber.isEmpty() ) {
showWarning("请将确认已经填写手机及名字");
btnLogin.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
if (!AccountValidatorRegexUtil.INSTANCE.isUsername(rawUsername)) {
showWarning("请输入有效的用户名,用户名为3-20位,包含字母、数字、下划线,且以字母开头");
btnLogin.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
if (!AccountValidatorRegexUtil.INSTANCE.isMobile(phoenNumber)) {
showWarning("请输入有效的手机号");
btnLogin.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
MISAuthenticationRequest smsRequest=new MISAuthenticationRequest("/"+rawUsername,
@@ -54,10 +54,10 @@ public class MainActivity extends MINVpnBaseActivity<MainActivityPresenter>
//界面变量区
private EasyBar easyBar;
private TextView VPNstatus;
private RadioGroup etProxyMode;
// private RadioGroup etProxyMode;
// private RadioButton ruleProxy;
private RadioButton globalProxy;
private RadioButton serverSettingProxy;
// private RadioButton globalProxy;
// private RadioButton serverSettingProxy;
private SpinKitView spinKit;
private TinImageView btnConnect;
@@ -68,10 +68,10 @@ public class MainActivity extends MINVpnBaseActivity<MainActivityPresenter>
// 初始化界面组件
easyBar=findViewById(R.id.easyBar);
VPNstatus=findViewById(R.id.VPNstatus);
etProxyMode=findViewById(R.id.etProxyMode);
// etProxyMode=findViewById(R.id.etProxyMode);
// ruleProxy=findViewById(R.id.ruleProxy);
globalProxy=findViewById(R.id.globalProxy);
serverSettingProxy=findViewById(R.id.serverSettingProxy);
// globalProxy=findViewById(R.id.globalProxy);
// serverSettingProxy=findViewById(R.id.serverSettingProxy);
spinKit=findViewById(R.id.spinKit);
btnConnect=findViewById(R.id.btnConnect);
@@ -107,25 +107,26 @@ public class MainActivity extends MINVpnBaseActivity<MainActivityPresenter>
mPresenter.getLocalPrefix();
// 根据MINVpnAPI显示当前VPN的模式
int flag= MINVpnSettingAPI.INSTANCE.getProxyMode();
if(flag==1){
etProxyMode.check(globalProxy.getId()); // 全局,外网
}else if(flag==2){
etProxyMode.check(serverSettingProxy.getId());// 服务器设定,内网
}
etProxyMode.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
if(!isConnected){
// 执行连接流程
// connectVpn();
}else{
// 执行断开流程
disconnectVpn();
}
}
});
// int flag= MINVpnSettingAPI.INSTANCE.getProxyMode();
// if(flag==1){
// etProxyMode.check(globalProxy.getId()); // 全局,外网
// }else if(flag==2){
// etProxyMode.check(serverSettingProxy.getId());// 服务器设定,内网
// }
// etProxyMode.check(serverSettingProxy.getId());// 服务器设定,内网
//
// etProxyMode.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
// @Override
// public void onCheckedChanged(RadioGroup group, int checkedId) {
// if(!isConnected){
// // 执行连接流程
//// connectVpn();
// }else{
// // 执行断开流程
// disconnectVpn();
// }
// }
// });
// 动画SpinKitView
spinKit.setIndeterminateDrawable(new DoubleBounce());
@@ -139,12 +140,13 @@ public class MainActivity extends MINVpnBaseActivity<MainActivityPresenter>
// 执行连接流程
connectVpn();
// 更新选定的模式
int cacheflag=etProxyMode.getCheckedRadioButtonId();
if(cacheflag==globalProxy.getId()){
MINVpnSettingAPI.INSTANCE.updateProxyMode(1); // 全局
}else if(cacheflag==serverSettingProxy.getId()){
MINVpnSettingAPI.INSTANCE.updateProxyMode(2);// 服务器设定
}
// int cacheflag=etProxyMode.getCheckedRadioButtonId();
// if(cacheflag==globalProxy.getId()){
// MINVpnSettingAPI.INSTANCE.updateProxyMode(1); // 全局
// }else if(cacheflag==serverSettingProxy.getId()){
// MINVpnSettingAPI.INSTANCE.updateProxyMode(2);// 服务器设定
// }
MINVpnSettingAPI.INSTANCE.updateProxyMode(1);// 服务器设定
}else{
// 执行断开流程
disconnectVpn();
@@ -8,6 +8,8 @@ package com.pkusz.min_vpn_client.activity.register;
*/
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
@@ -62,6 +64,7 @@ public class RegisterActivity extends MINVpnBaseActivity<RegisterActivityPresent
private VerificationCodeEditText etSMSNumber;
private CountDownButton getSMScode;
private ConstraintLayout SMSRegion;
private Handler handler;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -80,8 +83,15 @@ public class RegisterActivity extends MINVpnBaseActivity<RegisterActivityPresent
etSMSNumber=findViewById(R.id.Register_etSMSNumber);
getSMScode=findViewById(R.id.Register_getSMScode);
SMSRegion=findViewById(R.id.Register_SMSRegion);
handler=new Handler(){
@Override
public void handleMessage(Message msg) {
getSMScode.removeCountDown();
}
};
initView();
}
private void initView(){
@@ -108,7 +118,7 @@ public class RegisterActivity extends MINVpnBaseActivity<RegisterActivityPresent
// etUsername.setText("wefree");
// etPassword.setText("free@1898");
// etRePassword.setText("free@1898");
// etPhoneNumber.setText("15239970973");
// etPhoneNumber.setText("17817733391");
// etEmail.setText("255526727@qq.com");
// etInviteCode.setText("1234");
@@ -121,16 +131,49 @@ public class RegisterActivity extends MINVpnBaseActivity<RegisterActivityPresent
if (rawUsername.isEmpty() || phoenNumber.isEmpty() ) {
showWarning("请确认已经填写手机及名字");
btnRegister.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
if (!AccountValidatorRegexUtil.INSTANCE.isUsername(rawUsername)) {
showWarning("请输入有效的用户名,用户名为3-20位,包含字母、数字、下划线,且以字母开头");
btnRegister.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
if (!AccountValidatorRegexUtil.INSTANCE.isMobile(phoenNumber)) {
showWarning("请输入有效的手机号");
btnRegister.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
MISAuthenticationRequest smsRequest=new MISAuthenticationRequest("/"+rawUsername,
@@ -314,6 +357,17 @@ public class RegisterActivity extends MINVpnBaseActivity<RegisterActivityPresent
@Override
public void getCodeFailed(String errMsg) {
showWarning("获取验证码失败: "+errMsg);
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
@Override
@@ -9,6 +9,8 @@ package com.pkusz.min_vpn_client.activity.reset;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;
@@ -67,6 +69,7 @@ public class ResetActivity extends MINVpnBaseActivity<ResetActivityPresenter>
private VerificationCodeEditText Reset_etSMSNumber;
private CountDownButton Reset_getSMScode;
private CircularProgressButton btnReset;
private Handler handler;
@Override
@@ -85,6 +88,12 @@ public class ResetActivity extends MINVpnBaseActivity<ResetActivityPresenter>
Reset_etSMSNumber=findViewById(R.id.Reset_etSMSNumber);
Reset_getSMScode=findViewById(R.id.Reset_getSMScode);
btnReset=findViewById(R.id.btnReset);
handler=new Handler(){
@Override
public void handleMessage(Message msg) {
Reset_getSMScode.removeCountDown();
}
};
initView();
}
@@ -120,16 +129,49 @@ public class ResetActivity extends MINVpnBaseActivity<ResetActivityPresenter>
if (rawUsername.isEmpty() || phoenNumber.isEmpty() ) {
showWarning("请将确认已经填写手机及名字");
btnReset.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
if (!AccountValidatorRegexUtil.INSTANCE.isUsername(rawUsername)) {
showWarning("请输入有效的用户名,用户名为3-20位,包含字母、数字、下划线,且以字母开头");
btnReset.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
if (!AccountValidatorRegexUtil.INSTANCE.isMobile(phoenNumber)) {
showWarning("请输入有效的手机号");
btnReset.revertAnimation();
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(1000);
handler.sendEmptyMessage(0);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
return;
}
MISAuthenticationRequest smsRequest=new MISAuthenticationRequest("/"+rawUsername,
@@ -99,32 +99,32 @@ public class SettingActivity extends MINVpnBaseActivity<SettingActivityPresenter
btnSaveSetting.setBackgroundResource(R.drawable.button_shape_default);
// 获取本地设置数据,填充到文本框
etIpAddress.setText(MINVpnSettingAPI.INSTANCE.getMirIpAddress());
etPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getMirPort()));
etFirstRouterPrefix.setText(MINVpnSettingAPI.INSTANCE.getFirstRouterPrefix());
etServicePrefix.setText(MINVpnSettingAPI.INSTANCE.getServicePrefix());
etIpAddress.setText(MINVpnSettingAPI.INSTANCE.getExtranetMirIpAddress()); //接入IP地址
etPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getMirPort())); //接入端口
etFirstRouterPrefix.setText(MINVpnSettingAPI.INSTANCE.getFirstRouterPrefix()); //接入服务前缀
etServicePrefix.setText(MINVpnSettingAPI.INSTANCE.getServicePrefix()); //VPN服务前缀
// 外访
etIpAddress_Extra.setText(MINVpnSettingAPI.INSTANCE.getExtranetMirIpAddress());
etPort_Extra.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getExtranetMirPort()));
etFirstRouterPrefix_Extra.setText(MINVpnSettingAPI.INSTANCE.getExtranetFirstRouterPrefix());
etServicePrefix_Extra.setText(MINVpnSettingAPI.INSTANCE.getExtranetServicePrefix());
etBlockChainIp.setText(MINVpnSettingAPI.INSTANCE.getBlockChainIpAddress());
etVMSTCPPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getBcTcpPort()));
etVMSSSLPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getBcSslPort()));
etMISIp.setText(MINVpnSettingAPI.INSTANCE.getMisIpAddress());
etMISTCPPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getMisTcpPort()));
etMISSSLPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getMisSslPort()));
etIpAddress_Extra.setText(MINVpnSettingAPI.INSTANCE.getExtranetMirIpAddress()); //外网接入IP地址
etPort_Extra.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getExtranetMirPort())); //外网接入端口号
etFirstRouterPrefix_Extra.setText(MINVpnSettingAPI.INSTANCE.getExtranetFirstRouterPrefix()); //外网接入服务前缀
etServicePrefix_Extra.setText(MINVpnSettingAPI.INSTANCE.getExtranetServicePrefix()); //外网VPN服务前缀
etBlockChainIp.setText(MINVpnSettingAPI.INSTANCE.getExtranetMirIpAddress()); //VMS-IP地址
etVMSTCPPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getBcTcpPort())); //VMS-TCP端口号
etVMSSSLPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getBcSslPort())); //VMS-SSL端口号
etMISIp.setText(MINVpnSettingAPI.INSTANCE.getExtranetMirIpAddress()); //NIS-IP地址
etMISTCPPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getMisTcpPort())); //MIS-TCP端口号
etMISSSLPort.setText(String.valueOf(MINVpnSettingAPI.INSTANCE.getMisSslPort())); //MIS-SSL端口号
// 设置按钮的监听(点击动作)
btnSaveSetting.setOnClickListener(v->{
btnSaveSetting.startAnimation();
// 获取输入的属性字段
String mirIpAddress= Objects.requireNonNull(etIpAddress.getText()).toString();
if(!AccountValidatorRegexUtil.INSTANCE.isIPAddr(mirIpAddress)){
showWarning("请输入有效的接入IP地址");
btnSaveSetting.revertAnimation();
return;
}
// if(!AccountValidatorRegexUtil.INSTANCE.isIPAddr(mirIpAddress)){
// showWarning("请输入有效的接入IP地址");
// btnSaveSetting.revertAnimation();
// return;
// }
String mirPort= Objects.requireNonNull(etPort.getText()).toString();
if(!AccountValidatorRegexUtil.INSTANCE.isPort(mirPort)){
showWarning("请输入有效的接入端口号");
@@ -169,11 +169,11 @@ public class SettingActivity extends MINVpnBaseActivity<SettingActivityPresenter
return;
}
String blockChainIpAddress = Objects.requireNonNull(etBlockChainIp.getText()).toString();
if(!AccountValidatorRegexUtil.INSTANCE.isIPAddr(blockChainIpAddress)){
showWarning("请输入有效的VMS-IP地址");
btnSaveSetting.revertAnimation();
return;
}
// if(!AccountValidatorRegexUtil.INSTANCE.isIPAddr(blockChainIpAddress)){
// showWarning("请输入有效的VMS-IP地址");
// btnSaveSetting.revertAnimation();
// return;
// }
String tcpPort= Objects.requireNonNull(etVMSTCPPort.getText()).toString();
if(!AccountValidatorRegexUtil.INSTANCE.isPort(tcpPort)){
showWarning("请输入有效的VMS-TCP端口号");
@@ -187,11 +187,11 @@ public class SettingActivity extends MINVpnBaseActivity<SettingActivityPresenter
return;
}
String misIpAddress = Objects.requireNonNull(etMISIp.getText()).toString();
if(!AccountValidatorRegexUtil.INSTANCE.isIPAddr(misIpAddress)){
showWarning("请输入有效的MIS-IP地址");
btnSaveSetting.revertAnimation();
return;
}
// if(!AccountValidatorRegexUtil.INSTANCE.isIPAddr(misIpAddress)){
// showWarning("请输入有效的MIS-IP地址");
// btnSaveSetting.revertAnimation();
// return;
// }
String mistcpPort= Objects.requireNonNull(etMISTCPPort.getText()).toString();
if(!AccountValidatorRegexUtil.INSTANCE.isPort(mistcpPort)){
showWarning("请输入有效的MIS-TCP端口号");
@@ -207,7 +207,7 @@ public class SettingActivity extends MINVpnBaseActivity<SettingActivityPresenter
boolean isEncrypted=true;
// 将属性字段更新到MINVpnAPI
MINVpnSettingAPI.INSTANCE.updateMirIpAddress(mirIpAddress);
MINVpnSettingAPI.INSTANCE.updateMirIpAddress(mirIpAddressExtra);
MINVpnSettingAPI.INSTANCE.updateMirPort(Integer.parseInt(mirPort));
MINVpnSettingAPI.INSTANCE.updateFirstRouterPrefix(firstPrefix);
MINVpnSettingAPI.INSTANCE.updateServicePrefix(servicePrefix);
@@ -216,10 +216,10 @@ public class SettingActivity extends MINVpnBaseActivity<SettingActivityPresenter
MINVpnSettingAPI.INSTANCE.updateExtranetMirPort(Integer.parseInt(mirPortExtra));
MINVpnSettingAPI.INSTANCE.updateExtranetFirstRouterPrefix(firstPrefixExtra);
MINVpnSettingAPI.INSTANCE.updateExtranetServicePrefix(servicePrefixExtra);
MINVpnSettingAPI.INSTANCE.updateBlockChainIpAddress(blockChainIpAddress);
MINVpnSettingAPI.INSTANCE.updateBlockChainIpAddress(mirIpAddressExtra);
MINVpnSettingAPI.INSTANCE.updateBcTcpPort(Integer.parseInt(tcpPort));
MINVpnSettingAPI.INSTANCE.updateBcSslPort(Integer.parseInt(sslPort));
MINVpnSettingAPI.INSTANCE.updateMisIpAddress(misIpAddress);
MINVpnSettingAPI.INSTANCE.updateMisIpAddress(mirIpAddressExtra);
MINVpnSettingAPI.INSTANCE.updateMisTcpPort(Integer.parseInt(mistcpPort));
MINVpnSettingAPI.INSTANCE.updateMisSslPort(Integer.parseInt(missslPort));
MINVpnSettingAPI.INSTANCE.updateEncryptedConfig(isEncrypted);
@@ -197,8 +197,9 @@ public enum MINVpnSettingAPI {
//1 global 全局流量,用于访问外网
//2 server setting 根据VPN服务器的握手应答信息进行设置,用于访问内网
public int getProxyMode(){
return EncryptedSharedPreferenceUtil.get(context,
SP_PROXY_MODE,2);
// return EncryptedSharedPreferenceUtil.get(context,
// SP_PROXY_MODE,2);
return 1; //目前版本要求外网
}
public void updateProxyMode(int mode){
@@ -246,7 +247,7 @@ public enum MINVpnSettingAPI {
public String getMirIpAddress(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_SETTING_MIR_IP_ADDRESS,"1.1.1.1");
SP_LOCAL_SETTING_MIR_IP_ADDRESS,"");
}
public void updateMirIpAddress(String mirIP){
@@ -257,7 +258,7 @@ public enum MINVpnSettingAPI {
public String getExtranetMirIpAddress(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_Extranet_SETTING_MIR_IP_ADDRESS,"14.215.134.202");
SP_LOCAL_Extranet_SETTING_MIR_IP_ADDRESS,"");
}
public void updateExtranetMirIpAddress(String mirIP){
@@ -267,7 +268,7 @@ public enum MINVpnSettingAPI {
public Integer getMirPort(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_SETTING_MIR_PORT,1);
SP_LOCAL_SETTING_MIR_PORT,13899);
}
public void updateMirPort(Integer mirPort){
@@ -278,7 +279,7 @@ public enum MINVpnSettingAPI {
public Integer getExtranetMirPort(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_Extranet_SETTING_MIR_PORT,14922);
SP_LOCAL_Extranet_SETTING_MIR_PORT,13899);
}
public void updateExtranetMirPort(Integer mirPort){
@@ -288,7 +289,7 @@ public enum MINVpnSettingAPI {
public String getServicePrefix(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_SETTING_SERVICE_PREFIX,"/vpn/server");
SP_LOCAL_SETTING_SERVICE_PREFIX,"/min/cutv/vpnserver");
}
public void updateServicePrefix(String servicePrefix){
@@ -299,7 +300,7 @@ public enum MINVpnSettingAPI {
public String getExtranetServicePrefix(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_Extranet_SETTING_SERVICE_PREFIX,"/hk/vpnserver");
SP_LOCAL_Extranet_SETTING_SERVICE_PREFIX,"/min/cutv/vpnserver");
}
public void updateExtranetServicePrefix(String servicePrefix){
@@ -311,7 +312,7 @@ public enum MINVpnSettingAPI {
// VMS通信地址
public String getBlockChainIpAddress(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_SETTING_BLOCK_CHAIN_IP_ADDRESS_TCP,"1.1.1.1");
SP_LOCAL_SETTING_BLOCK_CHAIN_IP_ADDRESS_TCP,"");
}
public void updateBlockChainIpAddress(String bcIP){
@@ -345,7 +346,7 @@ public enum MINVpnSettingAPI {
// MIS通信地址
public String getMisIpAddress(){
return EncryptedSharedPreferenceUtil.get(context, // gdcni17
SP_LOCAL_SETTING_MIS_IP_ADDRESS_TCP,"121.15.171.89");
SP_LOCAL_SETTING_MIS_IP_ADDRESS_TCP,"");
}
public void updateMisIpAddress(String misIP){
@@ -394,7 +395,7 @@ public enum MINVpnSettingAPI {
public String getFirstRouterPrefix(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_FIRSTROUTERPREFIX,"/min/gdcni19");
SP_LOCAL_FIRSTROUTERPREFIX,"/min/user");
}
public void updateFirstRouterPrefix(String firstRouterPrefix){
@@ -405,7 +406,7 @@ public enum MINVpnSettingAPI {
public String getExtranetFirstRouterPrefix(){
return EncryptedSharedPreferenceUtil.get(context,
SP_LOCAL_Extranet_FIRSTROUTERPREFIX,"/min/gdcni9");
SP_LOCAL_Extranet_FIRSTROUTERPREFIX,"/min/aliyun");
}
public void updateExtranetFirstRouterPrefix(String firstRouterPrefix){
@@ -281,7 +281,7 @@ public class UpdateAppUtils {
showToast("已是最新版本");
}
} else {
showToast("检查更新失败,请稍后再试");
// showToast("检查更新失败,请稍后再试"); 暂时不做失败的提示
}
dismissProgressbar();
}
+1 -1
View File
@@ -18,7 +18,7 @@
android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_0"
android:padding="5dp"
android:text="v2.1.4"
android:text="v2.1.5"
android:textColor="@color/color_bg_name"
android:textSize="17.5dp"
app:layout_constraintRight_toRightOf="parent"
+32 -32
View File
@@ -56,46 +56,46 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include2" />
<RadioGroup
android:id="@+id/etProxyMode"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_100"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnConnect"
>
<!-- <RadioGroup-->
<!-- android:id="@+id/etProxyMode"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/dp_50"-->
<!-- android:orientation="horizontal"-->
<!-- android:gravity="center_horizontal"-->
<!-- android:layout_marginTop="@dimen/dp_100"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/btnConnect"-->
<!-- >-->
<!-- <RadioButton-->
<!-- android:id="@+id/ruleProxy"-->
<!-- android:layout_width="@dimen/dp_120"-->
<!-- android:layout_height="@dimen/dp_50"-->
<!-- android:textColorHint="@color/colorPrimary"-->
<!-- android:hint="规则模式"-->
<!-- android:checked="true"-->
<!-- android:layout_marginLeft="@dimen/dp_20"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <RadioButton-->
<!-- android:id="@+id/ruleProxy"-->
<!-- android:id="@+id/globalProxy"-->
<!-- android:layout_width="@dimen/dp_120"-->
<!-- android:layout_height="@dimen/dp_50"-->
<!-- android:hint="外访模式"-->
<!-- android:textColorHint="@color/colorPrimary"-->
<!-- android:hint="规则模式"-->
<!-- android:checked="true"-->
<!-- android:layout_marginLeft="@dimen/dp_20"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<RadioButton
android:id="@+id/globalProxy"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_50"
android:hint="外访模式"
android:textColorHint="@color/colorPrimary"
app:layout_constraintTop_toTopOf="parent" />
<!-- <RadioButton-->
<!-- android:id="@+id/serverSettingProxy"-->
<!-- android:layout_width="@dimen/dp_120"-->
<!-- android:layout_height="@dimen/dp_50"-->
<!-- android:hint="内访模式"-->
<!-- android:textColorHint="@color/colorPrimary"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<RadioButton
android:id="@+id/serverSettingProxy"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_50"
android:hint="内访模式"
android:textColorHint="@color/colorPrimary"
app:layout_constraintTop_toTopOf="parent" />
</RadioGroup>
<!-- </RadioGroup>-->
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -17,6 +17,7 @@
<!-- VPNServer 第一跳路由 IP地址 -->
<TextView
android:id="@+id/tvDecoration1"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/include" />
@@ -25,6 +26,7 @@
android:id="@+id/settingTvTitle1"
style="@style/setting_title"
android:text="@string/setting_title_access_ip_address"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration1"
app:layout_constraintStart_toEndOf="@+id/tvDecoration1"
app:layout_constraintTop_toBottomOf="@+id/tvDecoration1" />
@@ -34,6 +36,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/setting_ip_address_example"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle1"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration1" />
@@ -41,6 +44,7 @@
<!-- VPNServer 第一跳路由 端口号 -->
<TextView
android:id="@+id/tvDecoration2"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etIpAddress" />
@@ -48,6 +52,7 @@
android:id="@+id/settingTvTitle2"
style="@style/setting_title"
android:text="@string/setting_title_access_port"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration2"
app:layout_constraintStart_toEndOf="@+id/tvDecoration2"
app:layout_constraintTop_toBottomOf="@+id/tvDecoration2" />
@@ -58,6 +63,7 @@
android:layout_height="wrap_content"
android:hint="@string/setting_port_example"
android:inputType="number"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle2"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration2" />
@@ -65,12 +71,14 @@
<!-- VPNServer 第一跳路由 服务前缀 -->
<TextView
android:id="@+id/tvDecoration3"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etPort" />
<TextView
android:id="@+id/settingTvTitle3"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_firstrouter_service_prefix"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration3"
@@ -82,6 +90,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/setting_service_firstrouter_prefix_example"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle3"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration3" />
@@ -89,6 +98,7 @@
<!-- VPNServer 服务前缀 -->
<TextView
android:id="@+id/tvDecoration4"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etFirstRouterPrefix" />
@@ -97,6 +107,7 @@
android:id="@+id/settingTvTitle4"
style="@style/setting_title"
android:text="@string/setting_title_service_prefix"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration4"
app:layout_constraintStart_toEndOf="@+id/tvDecoration4"
app:layout_constraintTop_toBottomOf="@+id/tvDecoration4" />
@@ -106,6 +117,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/setting_service_prefix_example"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle4"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration4" />
@@ -138,11 +150,13 @@
<!-- 外网 VPNServer 第一跳路由 端口号 -->
<TextView
android:id="@+id/tvDecoration22"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etIpAddressExtranet" />
<TextView
android:id="@+id/settingTvTitle22"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_access_port_extra"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration22"
@@ -155,6 +169,7 @@
android:layout_height="wrap_content"
android:hint="@string/setting_port_example"
android:inputType="number"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle22"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration22" />
@@ -162,12 +177,14 @@
<!-- 外网 VPNServer 第一跳路由 服务前缀 -->
<TextView
android:id="@+id/tvDecoration23"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etPortExtranet" />
<TextView
android:id="@+id/settingTvTitle23"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_firstrouter_service_prefix_extra"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration23"
@@ -179,6 +196,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/setting_service_firstrouter_prefix_example"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle23"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration23" />
@@ -186,12 +204,14 @@
<!-- 外网 VPNServer 服务前缀 -->
<TextView
android:id="@+id/tvDecoration24"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etFirstRouterPrefixExtranet" />
<TextView
android:id="@+id/settingTvTitle24"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_service_prefix_extra"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration24"
@@ -203,6 +223,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/setting_service_prefix_example"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle24"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration24" />
@@ -210,12 +231,14 @@
<!-- VMS IP地址 -->
<TextView
android:id="@+id/tvDecoration5"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etServicePrefixExtranet" />
<TextView
android:id="@+id/settingTvTitle5"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_block_chain_ip_address"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration5"
@@ -227,6 +250,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/setting_block_chain_ip_address_example"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle5"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration5" />
@@ -234,11 +258,13 @@
<!-- VMS TCP 端口号 -->
<TextView
android:id="@+id/tvDecoration6"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etBlockChainIp" />
<TextView
android:id="@+id/settingTvTitle6"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_vms_tcp_port"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration6"
@@ -251,6 +277,7 @@
android:layout_height="wrap_content"
android:hint="@string/setting_block_chain_tcp_port_example"
android:inputType="number"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle6"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration6" />
@@ -258,11 +285,13 @@
<!-- VMS SSL 端口号 -->
<TextView
android:id="@+id/tvDecoration7"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etVMSTCPPort" />
<TextView
android:id="@+id/settingTvTitle7"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_vms_ssl_port"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration7"
@@ -275,6 +304,7 @@
android:layout_height="wrap_content"
android:hint="@string/setting_block_chain_ssl_port_example"
android:inputType="number"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle7"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration7" />
@@ -282,12 +312,14 @@
<!-- MIS IP地址 -->
<TextView
android:id="@+id/tvDecoration8"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etVMSSSLPort" />
<TextView
android:id="@+id/settingTvTitle8"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_mis_ip_address"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration8"
@@ -299,6 +331,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/setting_block_chain_ip_address_example"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle8"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration8" />
@@ -306,11 +339,13 @@
<!-- MIS TCP 端口号 -->
<TextView
android:id="@+id/tvDecoration9"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etMISIp" />
<TextView
android:id="@+id/settingTvTitle9"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_mis_tcp_port"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration9"
@@ -323,6 +358,7 @@
android:layout_height="wrap_content"
android:hint="@string/setting_mis_tcp_port_example"
android:inputType="number"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle9"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration9" />
@@ -330,11 +366,13 @@
<!-- MIS SSL 端口号 -->
<TextView
android:id="@+id/tvDecoration10"
android:visibility="gone"
style="@style/setting_title_decoration"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etMISTCPPort" />
<TextView
android:id="@+id/settingTvTitle10"
android:visibility="gone"
style="@style/setting_title"
android:text="@string/setting_title_mis_ssl_port"
app:layout_constraintBottom_toTopOf="@+id/tvDecoration10"
@@ -347,6 +385,7 @@
android:layout_height="wrap_content"
android:hint="@string/setting_mis_ssl_port_example"
android:inputType="number"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/settingTvTitle10"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDecoration10" />
+3 -1
View File
@@ -17,4 +17,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
android.enableJetifier=true
android.injected.testOnly=false