mirror of
https://gitee.com/willfree/min-vpn-client_v2.git
synced 2026-10-04 19:42:00 +08:00
test-看看这次修改了什么
This commit is contained in:
1 parent
e19a8efd11
commit
c4b04300e8
6 files changed
+25
-4
No files matched your search
@@ -73,6 +73,7 @@ public class LoginActivity extends MINVpnBaseActivity<LoginActivityPresenter>
|
|||||||
private ClearAbleEditText etPassword;
|
private ClearAbleEditText etPassword;
|
||||||
private CircularProgressButton export_identity;
|
private CircularProgressButton export_identity;
|
||||||
private CircularProgressButton import_identity;
|
private CircularProgressButton import_identity;
|
||||||
|
private CircularProgressButton test;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
@@ -90,6 +91,7 @@ public class LoginActivity extends MINVpnBaseActivity<LoginActivityPresenter>
|
|||||||
etPassword=findViewById(R.id.etPassword);
|
etPassword=findViewById(R.id.etPassword);
|
||||||
export_identity=findViewById(R.id.export_identity);
|
export_identity=findViewById(R.id.export_identity);
|
||||||
import_identity=findViewById(R.id.import_identity);
|
import_identity=findViewById(R.id.import_identity);
|
||||||
|
test=findViewById(R.id.test);
|
||||||
|
|
||||||
initView();
|
initView();
|
||||||
}
|
}
|
||||||
@@ -230,6 +232,11 @@ public class LoginActivity extends MINVpnBaseActivity<LoginActivityPresenter>
|
|||||||
mPresenter.login(loginRequest);
|
mPresenter.login(loginRequest);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//测试地址转换方案
|
||||||
|
test.setOnClickListener(v->{
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
// 监听键盘是否弹起
|
// 监听键盘是否弹起
|
||||||
ActivityExtensionsKt.listenKeyboardVisible(this,(isOpen)->{
|
ActivityExtensionsKt.listenKeyboardVisible(this,(isOpen)->{
|
||||||
if(isOpen){
|
if(isOpen){
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ public class MainActivity extends MINVpnBaseActivity<MainActivityPresenter>
|
|||||||
if (!checkPackages(packageNames)) {
|
if (!checkPackages(packageNames)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//判断是否授权vpn连接
|
||||||
Intent intent = VpnService.prepare(this);
|
Intent intent = VpnService.prepare(this);
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
System.out.println("用户尚未授权过开启VPN连接,请求用户授权...");
|
System.out.println("用户尚未授权过开启VPN连接,请求用户授权...");
|
||||||
@@ -207,6 +208,7 @@ public class MainActivity extends MINVpnBaseActivity<MainActivityPresenter>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
//用户授权vpn连接后
|
||||||
protected void onActivityResult(int requestCode, int resultCode, @androidx.annotation.Nullable @Nullable Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, @androidx.annotation.Nullable @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if(resultCode==Activity.RESULT_OK){
|
if(resultCode==Activity.RESULT_OK){
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ public class MINVpnInnerConnection implements MINVpnConnection{
|
|||||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// 1. 建立一条连接服务器的TCP-LogicFace
|
// 1. 建立一条连接服务器的TCP-LogicFace,
|
||||||
LogicFace face=initTCPLogicFace(this.mServerName,this.mServerPort);
|
LogicFace face=initTCPLogicFace(this.mServerName,this.mServerPort);
|
||||||
if(face==null){
|
if(face==null){
|
||||||
LoggerHelper.severe("vpn connection run error: tcp logic face init error");
|
LoggerHelper.severe("vpn connection run error: tcp logic face init error");
|
||||||
@@ -363,6 +363,7 @@ public class MINVpnInnerConnection implements MINVpnConnection{
|
|||||||
* @param face
|
* @param face
|
||||||
* @param buf
|
* @param buf
|
||||||
*/
|
*/
|
||||||
|
//构造MIN包
|
||||||
private void sendInterestPkt(LogicFace face, ByteBuffer buf,int bufLen) {
|
private void sendInterestPkt(LogicFace face, ByteBuffer buf,int bufLen) {
|
||||||
// 1. 构造CPacket
|
// 1. 构造CPacket
|
||||||
// 构造目的标识:/{service prefix}/{cPacket seq}/{defraudString}
|
// 构造目的标识:/{service prefix}/{cPacket seq}/{defraudString}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class MINVpnService extends VpnService implements Handler.Callback{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
@Override
|
@Override //启动服务时依次执行onCreate,onStartCommand,onStart
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
// 根据intent传递的消息进行vpn的连接或断开操作
|
// 根据intent传递的消息进行vpn的连接或断开操作
|
||||||
if (intent != null && ACTION_DISCONNECT.equals(intent.getAction())) {
|
if (intent != null && ACTION_DISCONNECT.equals(intent.getAction())) {
|
||||||
@@ -113,7 +113,7 @@ public class MINVpnService extends VpnService implements Handler.Callback{
|
|||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||||
private void updateForegroundNotification(final int message) {
|
private void updateForegroundNotification(final int message) {
|
||||||
// copy的,不知道啥意思
|
// copy的,不知道啥意思 将该服务改写成前台服务,不被杀死
|
||||||
final String NOTIFICATION_CHANNEL_ID = "MIN-VPN";
|
final String NOTIFICATION_CHANNEL_ID = "MIN-VPN";
|
||||||
NotificationManager mNotificationManager = (NotificationManager) getSystemService(
|
NotificationManager mNotificationManager = (NotificationManager) getSystemService(
|
||||||
NOTIFICATION_SERVICE);
|
NOTIFICATION_SERVICE);
|
||||||
|
|||||||
@@ -176,4 +176,15 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/btnLogin"
|
app:layout_constraintTop_toBottomOf="@id/btnLogin"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<br.com.simplepass.loadingbutton.customViews.CircularProgressButton
|
||||||
|
android:id="@+id/test"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="test"
|
||||||
|
android:background="@drawable/button_shape_default"
|
||||||
|
tools:ignore="MissingConstraints"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
tools:layout_editor_absoluteX="43dp"
|
||||||
|
tools:layout_editor_absoluteY="568dp" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
+1
-1
@@ -119,7 +119,7 @@ public class FileSelectorActivity extends AppCompatActivity implements OnItemCli
|
|||||||
if (mSelectedList.isEmpty()) {
|
if (mSelectedList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//不为空,向main activity返回数据
|
//不为空,向login activity返回数据
|
||||||
Intent result = new Intent();
|
Intent result = new Intent();
|
||||||
result.putStringArrayListExtra(Const.EXTRA_RESULT_SELECTION, mSelectedList);
|
result.putStringArrayListExtra(Const.EXTRA_RESULT_SELECTION, mSelectedList);
|
||||||
setResult(RESULT_OK, result);
|
setResult(RESULT_OK, result);
|
||||||
|
|||||||
Reference in new issue
Block a user