Add enable force proxy and proxy list to prohibit access to the official server
This commit is contained in:
parent
c30eed1206
commit
650e7542ed
@ -141,6 +141,9 @@ class MainHook : IXposedHookLoadPackage, IXposedHookZygoteInit {
|
||||
TrustMeAlready().initZygote(startupParam)
|
||||
}
|
||||
|
||||
private var startForceUrl = false
|
||||
private var startProxyList = false
|
||||
|
||||
@SuppressLint("WrongConstant", "ClickableViewAccessibility")
|
||||
override fun handleLoadPackage(lpparam: XC_LoadPackage.LoadPackageParam) {
|
||||
if (lpparam.packageName != "com.miHoYo.GenshinImpact") return
|
||||
@ -149,8 +152,10 @@ class MainHook : IXposedHookLoadPackage, IXposedHookZygoteInit {
|
||||
val context = it.args[0] as Context
|
||||
sp = context.getSharedPreferences("serverConfig", 0)
|
||||
forceUrl = sp.getBoolean("forceUrl", false)
|
||||
startForceUrl = forceUrl
|
||||
server = sp.getString("serverip", "") ?: ""
|
||||
proxyList = sp.getBoolean("ProxyList", false)
|
||||
startProxyList = proxyList
|
||||
if (sp.getBoolean("KeepSSL", false)) sslHook()
|
||||
}
|
||||
hook()
|
||||
@ -271,6 +276,10 @@ class MainHook : IXposedHookLoadPackage, IXposedHookZygoteInit {
|
||||
setNeutralButton(moduleRes.getString(R.string.OfficialServer)) { _, _ ->
|
||||
forceUrl = false
|
||||
server = ""
|
||||
if (startForceUrl || startProxyList) {
|
||||
Toast.makeText(activity, moduleRes.getString(R.string.JoinServerError), Toast.LENGTH_LONG).show()
|
||||
showDialog()
|
||||
}
|
||||
}
|
||||
}.show()
|
||||
}
|
||||
|
@ -27,4 +27,5 @@
|
||||
<string name="LoginFailed">登录失败.</string>
|
||||
<string name="LoginError">登录错误.</string>
|
||||
<string name="Tools">工具</string>
|
||||
<string name="JoinServerError">强制代理或代理列表已启用, 无法进入正式服务器.</string>
|
||||
</resources>
|
@ -26,4 +26,7 @@
|
||||
<string name="LoginFailed">Login failed.</string>
|
||||
<string name="LoginError">Login error.</string>
|
||||
<string name="Tools">Tools</string>
|
||||
<string name="JoinServerError">The force proxy or proxy list has been enabled and cannot enter the official
|
||||
server.
|
||||
</string>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user