Commit e7c222d9 authored by sheteng's avatar sheteng

加速器

parent c9921bec
......@@ -6,6 +6,13 @@ plugins {
}
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
signingConfigs {
register("config") {
keyAlias = "ccim"
......
......@@ -5,8 +5,7 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<!-- 通过GPS得到精确位置 -->
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" /> <!-- 通过GPS得到精确位置 -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 通过网络得到粗略位置 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 访问网络. 某些位置信息需要从网络服务器获取 -->
<uses-permission android:name="android.permission.INTERNET" /> <!-- 访问WiFi状态. 需要WiFi信息用于网络定位 -->
......@@ -34,10 +33,17 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<activity
android:name=".ui.login.PhoneLoginActivity"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
<activity
android:name=".ui.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible|adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......
......@@ -12,6 +12,7 @@ data class GameInfo(
val greatNum: Int,
val icon: String,
val id: Int,
val boosterServerIp:String,
val imgs: String,
val introduction: String,
val packageName: String
......
......@@ -54,6 +54,7 @@ class BottomNavigationFragment : XPageFragment(), ViewPager.OnPageChangeListener
adapter.addFragment(fragments[2], titles[2])
binding.viewPager.setOffscreenPageLimit(titles.size - 1);
binding.viewPager.adapter = adapter
// binding.viewPager
AcceleratorUtils.getGameList(this,{})
}
......
package com.ccwangluo.accelerator.ui.home
import android.graphics.drawable.AnimationDrawable
import android.os.Bundle
import android.support.v4.media.session.PlaybackStateCompat
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
......@@ -22,6 +24,7 @@ import com.github.shadowsocks.bg.BaseService
import com.hjq.toast.ToastUtils
import com.xuexiang.xpage.base.XPageFragment
import com.xuexiang.xpage.utils.TitleBar
import com.xuexiang.xui.utils.ViewUtils
import com.xuexiang.xutil.app.AppUtils
class AccelertorFragment : XPageFragment() {
......@@ -34,6 +37,8 @@ class AccelertorFragment : XPageFragment() {
return null
}
var state: BaseService.State? = null
override fun inflateView(inflater: LayoutInflater?, container: ViewGroup?): View {
binding = FragmentQuickBinding.inflate(inflater!!, container, false)
accelertorViewModel =
......@@ -85,21 +90,25 @@ class AccelertorFragment : XPageFragment() {
binding.netQuality.setText(SysUtils.getnetQuality(it.delay))
}
binding.activeNetwork.setText(SysUtils.getActiveNet())
})
accelertorViewModel.accState.observe(this, {
binding.accStateTx.setText(SysUtils.getAccTimeString(acc_timer))
if (it != state) {
state = it
freshData(it)
}
if (SettingSPUtils.isSmartAccOpen) {
binding.smartAccOpen.setText("已开启 >")
binding.smartAccOpen.setTextColor(resources.getColor(R.color.open_acc_enable))
binding.smartAccOpenArea.visibility = View.GONE
} else {
binding.smartAccOpen.setText("未开启 >")
binding.smartAccOpen.setText("未开启 ")
binding.smartAccOpen.setTextColor(resources.getColor(R.color.white))
binding.smartAccOpenArea.visibility = View.VISIBLE
}
})
accelertorViewModel.accState.observe(this, {
freshData(it, acc_timer)
})
accelertorViewModel.userProfile.observe(this, {
if (it.hasUnreadNotice) {
binding.iconNoticeBadge.visibility = View.VISIBLE
......@@ -108,6 +117,7 @@ class AccelertorFragment : XPageFragment() {
}
})
binding.progressViewCircleSmall.setProgressTextVisibility(false)
}
override fun initListeners() {
......@@ -171,7 +181,7 @@ class AccelertorFragment : XPageFragment() {
binding.quickTopToast.visibility = View.VISIBLE
binding.quickTopToastTx.setText("网络异常,请检查网络后重试")
binding.quickTopToastTx.postDelayed({
binding.quickTopToastTx.visibility = View.GONE
binding.quickTopToast.visibility = View.GONE
}, 2000)
return@setOnClickListener
}
......@@ -179,10 +189,11 @@ class AccelertorFragment : XPageFragment() {
if (it) {
//
AcceleratorUtils.game?.let {
if (AppUtils.isInstallApp(it.packageName)) {
if (!AppUtils.isInstallApp(it.packageName)) {
binding.quickTopToast.visibility = View.VISIBLE
binding.quickTopToastTx.setText("请先安装游戏后加速")
binding.quickTopToastTx.postDelayed({
binding.quickTopToastTx.visibility = View.GONE
binding.quickTopToast.visibility = View.GONE
}, 2000)
return@getGameList
}
......@@ -233,13 +244,17 @@ class AccelertorFragment : XPageFragment() {
}
}
fun freshData(state: BaseService.State, time: Long) {
fun freshData(state: BaseService.State) {
if (state == BaseService.State.Connected) {
stopAnim()
binding.gamePicIn1.startAnimation(getDefaultAnim())
binding.progressViewCircleSmall.progress = 100F
binding.accStateTx.setText(SysUtils.getAccTimeString(time))
binding.accStateTx.visibility = View.VISIBLE
binding.btnQuick.setBackgroundResource(R.mipmap.quick_stop)
if (binding.gamePicOut.background is AnimationDrawable) {
(binding.gamePicOut.background as AnimationDrawable).stop()
binding.gamePicOut.clearAnimation()
}
if (SettingSPUtils.isFirstAccSuccess) {
CommonDialog(this).setTitle("防止加速掉线")
.setContent("为了防止加速进程被手机系统中断,影响游戏加速,请确保完成相关设置")
......@@ -249,13 +264,17 @@ class AccelertorFragment : XPageFragment() {
SettingSPUtils.isFirstAccSuccess = false
}
} else if (state == BaseService.State.Stopped) {
if (binding.gamePicOut.background is AnimationDrawable) {
(binding.gamePicOut.background as AnimationDrawable).start()
binding.gamePicOut.startAnimation(getDefaultAnim())
}
binding.gamePicIn1.clearAnimation()
stopAnim()
binding.accStateTx.visibility = View.GONE
binding.progressViewCircleSmall.progress = 0F
binding.btnQuick.setBackgroundResource(R.mipmap.quick_start)
}
}
fun getUserProfile() {
......@@ -277,21 +296,19 @@ class AccelertorFragment : XPageFragment() {
binding.btnQuick.isEnabled = true
binding.progressViewCircleSmall.stopProgressAnimation()
binding.progressViewCircleSmall.setProgressTextVisibility(false)
binding.gamePicOut.clearAnimation()
binding.gamePicIn1.clearAnimation()
}
fun startAnim() {
binding.progressViewCircleSmall.setProgressTextVisibility(true)
binding.progressViewCircleSmall.startProgressAnimation()
binding.gamePicOut.startAnimation(getDefaultAnim())
binding.gamePicIn1.startAnimation(getDefaultAnim())
}
fun getDefaultAnim(): RotateAnimation {
val multiple = 1000
val rotate = RotateAnimation(
0f,
360f,
360f * multiple,
Animation.RELATIVE_TO_SELF,
0.5f,
Animation.RELATIVE_TO_SELF,
......@@ -299,13 +316,10 @@ class AccelertorFragment : XPageFragment() {
)
val lin = LinearInterpolator()
rotate.interpolator = lin
rotate.duration = 2000 //设置动画持续周期
rotate.duration = 2000L * multiple //设置动画持续周期
rotate.repeatCount = -1 //设置重复次数
rotate.fillAfter = true //动画执行完后是否停留在执行完的状态
rotate.startOffset = 10 //执行前的等待时间
return rotate
}
......
package com.ccwangluo.accelerator.ui.login
import android.os.Bundle
import android.view.View
import androidx.core.widget.addTextChangedListener
import androidx.lifecycle.ViewModelProvider
import com.ccwangluo.accelerator.databinding.FragmentLoginPhoneBinding
import com.ccwangluo.accelerator.utils.LoginUtils
import com.hjq.toast.ToastUtils
import com.xuexiang.xpage.annotation.Page
import com.xuexiang.xpage.base.XPageActivity
import com.xuexiang.xutil.common.StringUtils
import java.util.regex.Pattern
@Page(name = "phone_login")
class PhoneLoginActivity:XPageActivity() {
private lateinit var loginViewModel: LoginViewModel
private lateinit var binding: FragmentLoginPhoneBinding
private var mCountTime = 60
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = FragmentLoginPhoneBinding.inflate(layoutInflater)
loginViewModel = ViewModelProvider(this).get(LoginViewModel::class.java)
setContentView(binding.root)
initViews()
initListeners()
}
fun initViews() {
binding.phoneEt.addTextChangedListener {
val phone = it.toString().trim()
val authCdoe = binding.authCodeEt.text.toString()
if (phone.length > 0) {
binding.authCodeBtn.isEnabled = true
} else {
binding.authCodeBtn.isEnabled = false
}
if (isPhone(phone) && authCdoe.length > 0) {
binding.login.isEnabled = true
} else {
binding.login.isEnabled = false
}
}
binding.authCodeEt.addTextChangedListener {
val authCdoe = it.toString().trim()
val phone = binding.phoneEt.text.toString()
if (isPhone(phone) && authCdoe.length > 0) {
binding.login.isEnabled = true
} else {
binding.login.isEnabled = false
}
if (isPhone(phone) && authCdoe.length == 6 && binding.cbProtocol.isChecked) {
loginViewModel.login(phone, authCdoe)
}
}
loginViewModel.sendCodeState.observe(this, {
if (it) {
LoginUtils.startTimer()
} else {
binding.authCodeBtn.visibility = View.VISIBLE
binding.authCodeWait.visibility = View.GONE
binding.authCodeBtn.isEnabled = true
}
})
loginViewModel.loginState.observe(this, {
if (it) {
finish()
}
})
loginViewModel.timerNumber.observe(this, {
if (it > 0) {
binding.authCodeBtn.visibility = View.GONE
binding.authCodeWait.visibility = View.VISIBLE
binding.authCodeBtn.isEnabled = false
binding.authCodeWait.setText("${it}秒后重新获得验证码")
} else {
resetCounter()
}
})
}
fun initListeners() {
binding.privacyAggreement.setOnClickListener({
})
binding.userAggreement.setOnClickListener {
}
binding.phoneClear.setOnClickListener {
binding.phoneEt.setText("")
}
binding.authCodeBtn.setOnClickListener {
val phone = binding.phoneEt.text.toString()
if (StringUtils.isEmpty(phone) || !isPhone(phone)) {
ToastUtils.show("输入正确的手机号")
return@setOnClickListener
}
binding.authCodeBtn.isEnabled = false
loginViewModel.getAuthCode(phone)
}
binding.btnBack.setOnClickListener {
finish()
}
binding.login.setOnClickListener {
//检查验证码,手机号格式
val phone = binding.phoneEt.text.toString()
val authCdoe = binding.authCodeEt.text.toString()
if (StringUtils.isEmpty(phone) || !isPhone(phone)) {
ToastUtils.show("输入正确的手机号")
return@setOnClickListener
}
if (StringUtils.isEmpty(authCdoe) || authCdoe.length < 6) {
ToastUtils.show("请输入验证码")
return@setOnClickListener
}
//检查ck
if (!binding.cbProtocol.isChecked) {
ToastUtils.show("先勾选协议哦")
return@setOnClickListener
}
loginViewModel.login(phone, authCdoe)
}
}
fun isPhone(phone: String): Boolean {
// 开头的"1"代表第一位为数字1,"[3-9]"代表第二位可以为3、4、5、6、7、8、9其中之一,"\\d{9}"代表后面是9位数字
val regex = "1[3-9]\\d{9}"
return Pattern.matches(regex, phone)
}
override fun onResume() {
super.onResume()
LoginUtils.registerTimerCallBack {
loginViewModel.timerNumber.postValue(it)
}
}
override fun onPause() {
super.onPause()
LoginUtils.unRegisterTimerCallBack()
}
//重置按钮状态
fun resetCounter() {
mCountTime = 60
binding.authCodeBtn.visibility = View.VISIBLE
binding.authCodeWait.visibility = View.GONE
binding.authCodeBtn.setText("重新获取验证码")
binding.authCodeBtn.isEnabled = true
}
}
\ No newline at end of file
......@@ -169,4 +169,13 @@ class AndroidInterface(val xPageFragment: XPageFragment, val agentWeb: AgentWeb)
AppUtils.uninstallApp(pageName)
}
/**
* 版本号
*/
@JavascriptInterface
fun getVersion(callback: String) {
agentWeb.getJsAccessEntrace()
.quickCallJs(callback, AppUtils.getAppVersionName(), AppUtils.getAppVersionCode().toString())
}
}
\ No newline at end of file
......@@ -85,7 +85,8 @@ object AcceleratorUtils {
ProfileManager.ensureNotEmpty()
context.lifecycleScope.launch(Dispatchers.IO) {
while (true) {
val net = SysUtils.getNetPing("10.3.0.229")
game?.let {
val net = SysUtils.getNetPing(it.boosterServerIp)
if (state != BaseService.State.Connected) {
pre_net = net.delay
acc_net = -1
......@@ -100,8 +101,7 @@ object AcceleratorUtils {
net.preNetDelay = pre_net
net.accNetDelay = acc_net
stateListener(state, getAccTime(), net)
}
delay(1000)
}
}
......@@ -122,7 +122,7 @@ object AcceleratorUtils {
fun initAuthProfile(xPageFragment: XPageFragment) {
xPageFragment.lifecycleScope.launch(Dispatchers.IO) {
AuthManager.getLineConfig()?.let {
if (it.code != 200){
if (it.code != 200) {
return@let
}
val profileId = 1L
......@@ -145,7 +145,8 @@ object AcceleratorUtils {
"com.pubg.krmobile",
"com.tgc.sky.android",
"com.YoStarJP.Arknights",
"com.riotgames.league.wildrifttw"
"com.riotgames.league.wildrifttw",
game?.packageName
)
proxyGames.addAll(profile.individual.split("\n"))
Timber.d("start vpn with games: $proxyGames")
......@@ -154,7 +155,7 @@ object AcceleratorUtils {
profile.password = "barfoo!"
profile.method = "none"
profile.beatsInterval = 60
withContext(Dispatchers.Main){
withContext(Dispatchers.Main) {
ProfileManager.updateProfile(profile)
connect.launch(null)
}
......
package com.ccwangluo.accelerator.utils
import android.content.Context
import android.content.Intent
import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.viewModelScope
import com.ccwangluo.accelerator.model.LoginRes
import com.ccwangluo.accelerator.model.UserProfile
import com.ccwangluo.accelerator.ui.login.PhoneLoginFragment
import com.ccwangluo.accelerator.ui.login.PhoneLoginActivity
import com.ccwangluo.accelerator.utils.http.HttpGo
import com.chuanglan.shanyan_sdk.OneKeyLoginManager
import com.github.shadowsocks.Core
import com.github.shadowsocks.bg.AuthManager
import com.hjq.toast.ToastUtils
import com.tencent.mmkv.MMKV
import com.xuexiang.xpage.base.XPageFragment
import com.xuexiang.xpage.core.PageOption
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
......@@ -125,7 +125,12 @@ object LoginUtils {
}
}
} else {
PageOption.to(PhoneLoginFragment::class.java).open(xPageFragment)
xPageFragment.startActivity(
Intent(
xPageFragment.context,
PhoneLoginActivity::class.java
)
)
}
}
}
......@@ -133,6 +138,7 @@ object LoginUtils {
private const val KEY_TOKEN = "com.ccwangluo.KEY_TOKEN"
fun clearToken() {
Core.stopService()
MMKV.defaultMMKV().remove(KEY_TOKEN)
}
......
......@@ -2,6 +2,7 @@ package com.ccwangluo.accelerator.utils
import android.app.Application
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.util.Log
......@@ -9,7 +10,7 @@ import android.util.TypedValue
import android.widget.RelativeLayout
import android.widget.TextView
import com.ccwangluo.accelerator.R
import com.ccwangluo.accelerator.ui.login.PhoneLoginFragment
import com.ccwangluo.accelerator.ui.login.PhoneLoginActivity
import com.chuanglan.shanyan_sdk.OneKeyLoginManager
import com.chuanglan.shanyan_sdk.tool.ShanYanUIConfig
......@@ -138,7 +139,10 @@ object PhoneUtils {
.setLogBtnImgPath(context.resources.getDrawable(R.mipmap.login_btn_onekey))
.addCustomView(
mOtherTv, true, false
) { context, view -> PageOption.to(PhoneLoginFragment::class.java).open(xPageFragment) }
) { context, view -> xPageFragment.startActivity(
Intent(xPageFragment.context,
PhoneLoginActivity::class.java)
) }
.setPrivacyState(false)
.setCheckedImgPath(mCheckedImg)
.setUncheckedImgPath(mCunheckedImg)
......
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
android:fromDegrees="0"
android:toDegrees="359"
android:pivotX="50%"
android:pivotY="50%"
android:duration="2000"
android:repeatCount="-1">
</rotate>
</rotate>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/circle_out_1" android:duration="1000"/>
<item android:drawable="@drawable/circle_out_2" android:duration="1000"/>
<item android:drawable="@drawable/circle_out_3" android:duration="1000"/>
</animation-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F9F9F9" />
<corners android:radius="10dp" />
</shape>
\ No newline at end of file
......@@ -44,7 +44,7 @@
android:textSize="13sp"
/>
<com.xuexiang.xui.widget.layout.XUILinearLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="49dp"
android:layout_marginLeft="30dp"
......@@ -52,17 +52,17 @@
android:layout_marginTop="20dp"
android:gravity="center_vertical"
android:layout_marginBottom="10dp"
android:background="#F9F9F9"
android:orientation="horizontal"
app:xui_radius="10dp">
android:background="@drawable/edittext_shape"
android:orientation="horizontal">
<EditText
android:focusable="true"
android:id="@+id/phone_et"
android:layout_width="match_parent"
android:layout_height="30dp"
android:inputType="number"
android:background="@null"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_marginLeft="10dp"
android:textColor="#FF000000"
android:layout_weight="1"
......@@ -78,22 +78,21 @@
android:background="@mipmap/edit_del"
/>
</com.xuexiang.xui.widget.layout.XUILinearLayout>
</LinearLayout>
<com.xuexiang.xui.widget.layout.XUILinearLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="49dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:gravity="center_vertical"
android:layout_marginBottom="10dp"
android:background="#F9F9F9"
android:background="@drawable/edittext_shape"
android:orientation="horizontal"
app:xui_radius="10dp">
>
<EditText
android:focusable="true"
android:id="@+id/auth_code_et"
android:layout_width="match_parent"
android:layout_height="30dp"
......@@ -102,6 +101,8 @@
android:layout_marginLeft="10dp"
android:textColor="#FF000000"
android:layout_weight="1"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="请输入验证码"
android:maxLength="6"
android:textSize="15sp"/>
......@@ -128,7 +129,7 @@
android:textSize="13sp"
/>
</com.xuexiang.xui.widget.layout.XUILinearLayout>
</LinearLayout>
<com.xuexiang.xui.widget.button.roundbutton.RoundButton
android:id="@+id/login"
......
......@@ -136,7 +136,9 @@
style="@style/MyTablayoutstyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp" />
android:layout_marginTop="5dp"
app:tabBackground="@null"
app:tabRippleColor="@null"/>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/view_pager"
......
......@@ -69,33 +69,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.xuexiang.xui.widget.layout.XUILinearLayout
android:id="@+id/quick_top_toast"
android:layout_width="320dp"
android:layout_height="34dp"
android:layout_centerHorizontal="true"
android:background="#FF151721"
android:gravity="center"
android:orientation="horizontal"
android:visibility="gone"
app:xui_radius="10dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:background="@mipmap/icon_error" />
<TextView
android:id="@+id/quick_top_toast_tx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="请先安装游戏后加速"
android:textColor="#FFD5D7DF"
android:textSize="14sp" />
</com.xuexiang.xui.widget.layout.XUILinearLayout>
<ImageView
android:id="@+id/game_pic_out"
......@@ -106,7 +80,7 @@
android:layout_marginTop="5dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:background="@mipmap/circle_out" />
android:background="@drawable/animati_cricle" />
<ImageView
android:id="@+id/game_pic_in1"
......@@ -144,6 +118,33 @@
app:cpv_start_progress="0"
app:cpv_track_color="#57595B"
app:cpv_track_width="4dp" />
<com.xuexiang.xui.widget.layout.XUILinearLayout
android:id="@+id/quick_top_toast"
android:layout_width="320dp"
android:layout_height="34dp"
android:layout_centerHorizontal="true"
android:background="#FF151721"
android:gravity="center"
android:visibility="gone"
android:orientation="horizontal"
app:xui_radius="10dp">
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:background="@mipmap/icon_error" />
<TextView
android:id="@+id/quick_top_toast_tx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:text="请先安装游戏后加速"
android:textColor="#FFD5D7DF"
android:textSize="14sp" />
</com.xuexiang.xui.widget.layout.XUILinearLayout>
</RelativeLayout>
......@@ -406,7 +407,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="2"
android:text="__"
android:textColor="#FFFFFFFF"
android:textSize="16sp" />
......
......@@ -6,4 +6,5 @@
<dimen name="textsize_middle">18sp</dimen>
<dimen name="textsize_little">12sp</dimen>
<dimen name="textsize_lit_mid">15sp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
\ No newline at end of file
......@@ -7,4 +7,13 @@
<string name="title_activity_main2">Main2Activity</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="title_activity_phone_login">PhoneLoginActivity</string>
<!-- Strings used for fragments for navigation -->
<string name="first_fragment_label">First Fragment</string>
<string name="second_fragment_label">Second Fragment</string>
<string name="next">Next</string>
<string name="previous">Previous</string>
<string name="hello_first_fragment">Hello first fragment</string>
<string name="hello_second_fragment">Hello second fragment. Arg: %1$s</string>
</resources>
\ No newline at end of file
......@@ -24,10 +24,10 @@
<item name="colorAccent">@color/black</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<!-- <item name="android:background">@mipmap/splash</item>-->
<!-- <item name="android:background">@mipmap/splash</item>-->
<item name="android:windowBackground">@mipmap/win_bg</item>
<item name="android:windowDisablePreview">true</item>
<!-- <item name="xui_config_splash_app_logo">@mipmap/tt_logo</item>-->
<!-- <item name="xui_config_splash_app_logo">@mipmap/tt_logo</item>-->
<item name="xpage_actionbar_background">@null</item>
<!--标题栏的背景颜色-->
<item name="xpage_actionbar_color">@color/white</item>
......@@ -52,7 +52,6 @@
</style>
<style name="XPageTitleBar.Custom">
<item name="tb_immersive">false</item>
<item name="tb_centerGravity">center</item>
......@@ -62,4 +61,13 @@
<item name="android:button">@drawable/btn_check</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
\ No newline at end of file
......@@ -90,25 +90,25 @@ object AuthManager {
profile.token = it.data.token
profile.remotePort = it.data.port
profile.proxyApps = true
val proxyGames = mutableSetOf(
"com.sec.android.app.sbrowser",
"com.nexon.maplem.global",
"jp.co.cygames.umamusume",
"com.ea.gp.apexlegendsmobilefps",
"jp.konami.duellinks",
"com.riotgames.league.wildrift",
"com.garena.game.codm",
"com.google.android.configupdater",
"com.miHoYo.GenshinImpact",
"com.rekoo.pubgm",
"com.pubg.krmobile",
"com.tgc.sky.android",
"com.YoStarJP.Arknights",
"com.riotgames.league.wildrifttw"
)
proxyGames.addAll(profile.individual.split("\n"))
Timber.d("start vpn with games: $proxyGames")
profile.individual = proxyGames.joinToString("\n")
// val proxyGames = mutableSetOf(
// "com.sec.android.app.sbrowser",
// "com.nexon.maplem.global",
// "jp.co.cygames.umamusume",
// "com.ea.gp.apexlegendsmobilefps",
// "jp.konami.duellinks",
// "com.riotgames.league.wildrift",
// "com.garena.game.codm",
// "com.google.android.configupdater",
// "com.miHoYo.GenshinImpact",
// "com.rekoo.pubgm",
// "com.pubg.krmobile",
// "com.tgc.sky.android",
// "com.YoStarJP.Arknights",
// "com.riotgames.league.wildrifttw"
// )
// proxyGames.addAll(profile.individual.split("\n"))
Timber.d("start vpn with games: ${profile.individual}")
// profile.individual = proxyGames.joinToString("\n")
profile.route = Acl.BYPASS_LAN
profile.password = "barfoo!"
profile.method = "none"
......@@ -134,10 +134,13 @@ object AuthManager {
if (data.state == BaseService.State.Connected) {
getToken()?.let {
if (it.code == 200) {
configJson.addProperty("token", it.data.token)
configFile.writeText(configJson.toString())
} else {
Core.stopService()
}
}
}
}, 3, 3, TimeUnit.MINUTES)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment