Skip to content

Commit

Permalink
1.2.1版本
Browse files Browse the repository at this point in the history
  • Loading branch information
vnt-dev committed Aug 30, 2023
1 parent 371fafe commit fa124c8
Show file tree
Hide file tree
Showing 21 changed files with 51 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# VNTApp
# VntApp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public class ExampleInstrumentedTest {
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("top.wherewego.switchapp", appContext.getPackageName());
assertEquals("top.wherewego.vnt", appContext.getPackageName());
}
}
10 changes: 5 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="top.wherewego.switchapp">
package="top.wherewego.vnt">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
Expand All @@ -13,7 +13,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.SwitchApp"
android:theme="@style/Theme.VntApp"
tools:targetApi="31">
<service
android:name=".MyVpnService"
Expand All @@ -30,15 +30,15 @@
<activity
android:name=".ConnectActivity"
android:exported="false"
android:theme="@style/Theme.SwitchApp.NoActionBar">
android:theme="@style/Theme.VntApp.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
<activity
android:name=".AddActivity"
android:exported="false"
android:theme="@style/Theme.SwitchApp.NoActionBar">
android:theme="@style/Theme.VntApp.NoActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
Expand All @@ -47,7 +47,7 @@
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.SwitchApp.NoActionBar">
android:theme="@style/Theme.VntApp.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp;
package top.wherewego.vnt;

import android.widget.EditText;
import android.widget.Spinner;
Expand All @@ -10,9 +10,9 @@

import java.util.UUID;

import top.wherewego.switchapp.app.AppActivity;
import top.wherewego.switchapp.app.AppApplication;
import top.wherewego.switchapp.util.SPUtils;
import top.wherewego.vnt.app.AppActivity;
import top.wherewego.vnt.app.AppApplication;
import top.wherewego.vnt.util.SPUtils;
import top.wherewego.vnt.jni.ConfigurationInfoBean;

public class AddActivity extends AppActivity {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp;
package top.wherewego.vnt;

import android.annotation.SuppressLint;
import android.content.Intent;
Expand All @@ -19,8 +19,8 @@
import java.util.List;

import top.wherewego.base.BaseAdapter;
import top.wherewego.switchapp.adapter.ConnectAdapter;
import top.wherewego.switchapp.app.AppActivity;
import top.wherewego.vnt.adapter.ConnectAdapter;
import top.wherewego.vnt.app.AppActivity;
import top.wherewego.vnt.jni.ConfigurationInfoBean;
import top.wherewego.vnt.jni.DeviceBean;
import top.wherewego.widget.layout.WrapRecyclerView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
package top.wherewego.switchapp;
package top.wherewego.vnt;

import android.content.DialogInterface;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView;

import com.google.gson.Gson;
import com.hjq.bar.OnTitleBarListener;
import com.hjq.bar.TitleBar;
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener;

import top.wherewego.base.BaseAdapter;
import top.wherewego.switchapp.adapter.StatusAdapter;
import top.wherewego.switchapp.app.AppActivity;
import top.wherewego.switchapp.app.AppApplication;
import top.wherewego.vnt.adapter.StatusAdapter;
import top.wherewego.vnt.app.AppActivity;
import top.wherewego.vnt.app.AppApplication;
import top.wherewego.vnt.util.SPUtils;
import top.wherewego.vnt.jni.ConfigurationInfoBean;
import top.wherewego.widget.layout.WrapRecyclerView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp;
package top.wherewego.vnt;

import android.content.Intent;
import android.content.IntentFilter;
Expand Down Expand Up @@ -77,7 +77,7 @@ public synchronized int onStartCommand(Intent intent, int flags, int startId) {
boolean isTcp = intent.getBooleanExtra("isTcp", false);
config = new Config(token, name, deviceId, server, stunServer, password.isEmpty() ? null : password, cipherModel, isTcp);
if (mThread == null) {
mThread = new Thread(this, "SwitchVPN");
mThread = new Thread(this, "VntVPN");
mThread.start();
}
break;
Expand Down Expand Up @@ -106,7 +106,7 @@ public void run() {
}
Handler handler = new Handler(Looper.getMainLooper());
handler.post(() -> {
Toast.makeText(getApplicationContext(), "Switch已停止", Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), "Vnt已停止", Toast.LENGTH_LONG).show();
});
stop0();
eVnt = null;
Expand Down Expand Up @@ -182,7 +182,7 @@ private void run0() {
Builder builder = new Builder();
int prefixLength = IpUtils.subnetMaskToPrefixLength(connect.getVirtualNetmask());
String ipRoute = IpUtils.intToIpAddress(connect.getVirtualGateway() & connect.getVirtualNetmask());
builder.setSession("SwitchVPN")
builder.setSession("VntVPN")
.setBlocking(true)
.setMtu(1420)
.addAddress(ip, prefixLength)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package top.wherewego.switchapp.action;

import androidx.annotation.StringRes;
package top.wherewego.vnt.action;


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package top.wherewego.switchapp.adapter;
package top.wherewego.vnt.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import top.wherewego.switchapp.R;
import top.wherewego.switchapp.app.AppAdapter;
import top.wherewego.vnt.R;
import top.wherewego.vnt.app.AppAdapter;
import top.wherewego.vnt.jni.DeviceBean;

public final class ConnectAdapter extends AppAdapter<DeviceBean> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package top.wherewego.switchapp.adapter;
package top.wherewego.vnt.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import top.wherewego.switchapp.R;
import top.wherewego.switchapp.app.AppAdapter;
import top.wherewego.vnt.R;
import top.wherewego.vnt.app.AppAdapter;
import top.wherewego.vnt.jni.ConfigurationInfoBean;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
package top.wherewego.switchapp.app;
package top.wherewego.vnt.app;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;

import com.gyf.immersionbar.ImmersionBar;
import com.hjq.bar.TitleBar;
import top.wherewego.base.BaseActivity;
import top.wherewego.base.BaseDialog;
import top.wherewego.switchapp.R;
import top.wherewego.vnt.R;


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp.app;
package top.wherewego.vnt.app;

import android.content.Context;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp.app;
package top.wherewego.vnt.app;

import android.app.Application;
import android.content.Context;
Expand All @@ -13,8 +13,8 @@

import java.util.ArrayList;

import top.wherewego.switchapp.R;
import top.wherewego.switchapp.util.SPUtils;
import top.wherewego.vnt.R;
import top.wherewego.vnt.util.SPUtils;
import top.wherewego.vnt.jni.ConfigurationInfoBean;

/**
Expand Down Expand Up @@ -45,7 +45,7 @@ protected void attachBaseContext(Context base) {
Log.d("swichapp", "attachBaseContext: s : " + s);
String json = SPUtils.getString(this, s, "0");
if (json.equals("0")) {
return;
continue;
}
ConfigurationInfoBean configurationInfoBean = new Gson().fromJson(json, ConfigurationInfoBean.class);
configList.add(configurationInfoBean);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp.app;
package top.wherewego.vnt.app;


import top.wherewego.base.BaseFragment;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp.util;
package top.wherewego.vnt.util;

import android.content.Context;
import android.content.SharedPreferences;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package top.wherewego.switchapp.widget;
package top.wherewego.vnt.widget;

import android.content.Context;
import android.util.AttributeSet;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/app_bar_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
tools:context="top.wherewego.vnt.MainActivity">

<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/Theme.SwitchApp.AppBarOverlay">
android:theme="@style/Theme.VntApp.AppBarOverlay">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/Theme.SwitchApp.PopupOverlay" />
app:popupTheme="@style/Theme.VntApp.PopupOverlay" />

</com.google.android.material.appbar.AppBarLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.SwitchApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.VntApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<resources>
<string name="app_name">SwitchApp</string>
<string name="app_name">VntApp</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
<string name="nav_header_title">Switch App</string>
<string name="nav_header_title">Vnt App</string>
<string name="nav_header_subtitle"></string>
<string name="nav_header_desc">Navigation header</string>
<string name="action_settings">Settings</string>
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.SwitchApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<style name="Theme.VntApp" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
Expand All @@ -14,12 +14,12 @@
<!-- Customize your theme here. -->
</style>

<style name="Theme.SwitchApp.NoActionBar">
<style name="Theme.VntApp.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>

<style name="Theme.SwitchApp.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.VntApp.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="Theme.SwitchApp.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="Theme.VntApp.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "VNTApp"
rootProject.name = "VntApp"
include ':app'
include ':library:base'
include ':library:widget'

0 comments on commit fa124c8

Please sign in to comment.