Skip to content

Commit

Permalink
Allow to build a UI variant with OpenVPN 2.x only
Browse files Browse the repository at this point in the history
  • Loading branch information
schwabe committed May 17, 2023
1 parent d551053 commit a688889
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [Ui, Skeleton]
target: [UiOvpn23, SkeletonOvpn2, UiOvpn2]
name: "Release ${{ matrix.target }}"
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Expand Up @@ -15,7 +15,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.0.0")
classpath("com.android.tools.build:gradle:8.0.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}
Expand Down
16 changes: 14 additions & 2 deletions main/build.gradle.kts
Expand Up @@ -98,15 +98,27 @@ android {
}
}
}
flavorDimensions += listOf("implementation")
flavorDimensions += listOf("implementation", "ovpnimpl")

productFlavors {
create("ui") {
dimension = "implementation"
buildConfigField("boolean", "openvpn3", "true")
}

create("skeleton") {
dimension = "implementation"
}

create("ovpn23")
{
dimension = "ovpnimpl"
buildConfigField("boolean", "openvpn3", "true")
}

create("ovpn2")
{
dimension = "ovpnimpl"
versionNameSuffix = "-o2"
buildConfigField("boolean", "openvpn3", "false")
}
}
Expand Down
Expand Up @@ -31,6 +31,7 @@

import com.android.vending.billing.IInAppBillingService;

import de.blinkt.openvpn.BuildConfig;
import de.blinkt.openvpn.core.NativeUtils;
import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -86,7 +87,12 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
TextView osslVer = v.findViewById(R.id.openssl_version);

verO2.setText(String.format(Locale.US, "OpenVPN version: %s", NativeUtils.getOpenVPN2GitVersion()));
verO3.setText(String.format(Locale.US, "OpenVPN3 core version: %s", NativeUtils.getOpenVPN3GitVersion()));
if (BuildConfig.openvpn3)
verO3.setText(String.format(Locale.US, "OpenVPN3 core version: %s", NativeUtils.getOpenVPN3GitVersion()));
else
verO3.setText("(OpenVPN 2.x only build. No OpenVPN 3.x core in this app)");


osslVer.setText(String.format(Locale.US, "OpenSSL version: %s", NativeUtils.getOpenSSLVersion()));


Expand Down

0 comments on commit a688889

Please sign in to comment.