add vpn component detect
This commit is contained in:
3 files changed
+11
-2
No files matched your search
@@ -35,8 +35,15 @@ class MainActivity : BaseActivity() {
|
||||
stopClashService()
|
||||
} else {
|
||||
val vpnRequest = startClashService()
|
||||
if (vpnRequest != null)
|
||||
startActivityForResult(vpnRequest, REQUEST_CODE)
|
||||
if (vpnRequest != null) {
|
||||
val resolved = packageManager.resolveActivity(vpnRequest, 0)
|
||||
if ( resolved != null ) {
|
||||
startActivityForResult(vpnRequest, REQUEST_CODE)
|
||||
}
|
||||
else {
|
||||
makeSnackbarException(getString(R.string.missing_vpn_component), null)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,4 +130,5 @@
|
||||
<string name="learn_more_about_split_apks">了解更多关于分包机制</string>
|
||||
<string name="reinstall_from_google_play">重新从 Google Play 安装</string>
|
||||
<string name="download_from_github_releases">从 Github Release 下载</string>
|
||||
<string name="missing_vpn_component">系统 VPN 组件缺失</string>
|
||||
</resources>
|
||||
@@ -172,4 +172,5 @@
|
||||
<string name="github_releases_url" translatable="false">https://github.com/Kr328/ClashForAndroid/releases</string>
|
||||
|
||||
<string name="format_proxy_group_title" translatable="false">%s - %s</string>
|
||||
<string name="missing_vpn_component">Missing VPN Components</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user