Merge branch 'dev' into qt_migration
This commit is contained in:
commit
050d987d3b
133 changed files with 564 additions and 881 deletions
|
|
@ -48,7 +48,7 @@ dependencies {
|
|||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.2.2"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0"
|
||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10"
|
||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"
|
||||
implementation project(path: ':shadowsocks')
|
||||
}
|
||||
|
||||
|
|
@ -97,6 +97,9 @@ android {
|
|||
}
|
||||
|
||||
compileOptions {
|
||||
// Flag to enable support for the new language APIs
|
||||
coreLibraryDesugaringEnabled true
|
||||
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
|
|
|||
|
|
@ -520,7 +520,9 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface {
|
|||
peerBuilder.addAllowedIp(network)
|
||||
}
|
||||
}
|
||||
peerBuilder.setEndpoint(InetEndpoint.parse(peerConfig["Endpoint"]))
|
||||
val endpointConfig = peerConfig["Endpoint"]
|
||||
val endpoint = InetEndpoint.parse(endpointConfig)
|
||||
peerBuilder.setEndpoint(endpoint)
|
||||
peerConfig["PersistentKeepalive"]?.let {
|
||||
peerBuilder.setPersistentKeepalive(it.toInt())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ enum ErrorCode
|
|||
FailedToSaveConfigData,
|
||||
OpenVpnConfigMissing,
|
||||
OpenVpnManagementServerError,
|
||||
EasyRsaError,
|
||||
ConfigMissing,
|
||||
|
||||
// Distro errors
|
||||
|
|
|
|||
|
|
@ -35,10 +35,11 @@ QString errorString(ErrorCode code){
|
|||
case (FailedToSaveConfigData): return QObject::tr("Failed to save config to disk");
|
||||
case (OpenVpnConfigMissing): return QObject::tr("OpenVPN config missing");
|
||||
case (OpenVpnManagementServerError): return QObject::tr("OpenVPN management server error");
|
||||
case (EasyRsaError): return QObject::tr("EasyRSA runtime error");
|
||||
|
||||
// Distro errors
|
||||
case (OpenVpnExecutableMissing): return QObject::tr("OpenVPN executable missing");
|
||||
case (ShadowSocksExecutableMissing): return QObject::tr("ShadowSocks (ss-local) executable missing");
|
||||
case (CloakExecutableMissing): return QObject::tr("Cloak (ck-client) executable missing");
|
||||
case (AmneziaServiceConnectionFailed): return QObject::tr("Amnezia helper service error");
|
||||
case (OpenSslFailed): return QObject::tr("OpenSSL failed");
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ OpenVpnOverCloakProtocol::~OpenVpnOverCloakProtocol()
|
|||
|
||||
ErrorCode OpenVpnOverCloakProtocol::start()
|
||||
{
|
||||
if (!QFileInfo::exists(cloakExecPath())) {
|
||||
setLastError(ErrorCode::CloakExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
#ifndef Q_OS_IOS
|
||||
if (Utils::processIsRunning(Utils::executable("ck-client", false))) {
|
||||
Utils::killProcessByName(Utils::executable("ck-client", false));
|
||||
|
|
@ -106,6 +110,8 @@ QString OpenVpnOverCloakProtocol::cloakExecPath()
|
|||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return Utils::executable(QString("cloak/ck-client"), true);
|
||||
#elif defined Q_OS_LINUX
|
||||
return Utils::usrExecutable("ck-client");
|
||||
#else
|
||||
return Utils::executable(QString("/ck-client"), true);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -27,6 +27,13 @@ ShadowSocksVpnProtocol::~ShadowSocksVpnProtocol()
|
|||
|
||||
ErrorCode ShadowSocksVpnProtocol::start()
|
||||
{
|
||||
|
||||
if (!QFileInfo::exists(shadowSocksExecPath())) {
|
||||
setLastError(ErrorCode::ShadowSocksExecutableMissing);
|
||||
return lastError();
|
||||
}
|
||||
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
if (Utils::processIsRunning(Utils::executable("ss-local", false))) {
|
||||
Utils::killProcessByName(Utils::executable("ss-local", false));
|
||||
|
|
|
|||
|
|
@ -270,6 +270,6 @@ print G "done."
|
|||
sed -i '' '/<string>Original<\/string>/d' AmneziaVPN.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings
|
||||
fi
|
||||
|
||||
print Y "Opening in XCode..."
|
||||
open AmneziaVPN.xcodeproj
|
||||
# print Y "Opening in XCode..."
|
||||
# open AmneziaVPN.xcodeproj
|
||||
print G "All done!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue