@@ -58,7 +58,7 @@
-DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=28 \
-DCMAKE_ANDROID_ARCH_ABI=${{ matrix.abi }} \
-DOPENSSL_ROOT_DIR=${VCPKG_INSTALLED_DIR}/${{ matrix.vcpkg_triplet }} \
- -DENABLE_PKCS11=false -DBUILD_TESTING=true -DENABLE_LZO=false -DUSE_WERROR=no
+ -DENABLE_PKCS11=false -DBUILD_TESTING=true -DENABLE_LZO=false
- name: Build OpenVPN Android binary with cmake
run: cmake --build openvpn-build
@@ -102,6 +102,7 @@
#define RTA_SUCCESS 1 /* route addition succeeded */
#define RTA_EEXIST 2 /* route not added as it already exists */
+#ifndef TARGET_ANDROID
static bool
add_bypass_address(struct route_bypass *rb, const in_addr_t a)
{
@@ -123,6 +124,7 @@
return false;
}
}
+#endif
struct route_option_list *
new_route_option_list(struct gc_arena *a)
@@ -2035,9 +2037,7 @@
#if !defined(TARGET_AIX)
const char *netmask;
#endif
-#if !defined(TARGET_ANDROID)
const char *gateway;
-#endif
#else /* if !defined(TARGET_LINUX) */
int metric;
#endif
@@ -2056,10 +2056,8 @@
#if !defined(TARGET_AIX)
netmask = print_in_addr_t(r->netmask, 0, &gc);
#endif
-#if !defined(TARGET_ANDROID)
gateway = print_in_addr_t(r->gateway, 0, &gc);
#endif
-#endif
is_local_route = local_route(r->network, r->netmask, r->gateway, rgi);
if (is_local_route == LR_ERROR)
@@ -2165,9 +2163,13 @@
openvpn_execve_check(&argv, es, 0, "ERROR: OpenBSD/NetBSD route delete command failed");
#elif defined(TARGET_ANDROID)
+ /* Avoids the unused variables warnings that all other platforms use
+ * by adding them to the error message. */
msg(D_ROUTE_DEBUG, "Deleting routes on Android is not possible/not "
"needed. The VpnService API allows routes to be set "
- "on connect only and will clean up automatically.");
+ "on connect only and will clean up automatically. "
+ "Tried to delete route %s netmask %s gateway %s",
+ network, netmask, gateway);
#elif defined(TARGET_AIX)
{
@@ -2349,7 +2351,10 @@
#elif defined(TARGET_ANDROID)
msg(D_ROUTE_DEBUG, "Deleting routes on Android is not possible/not "
"needed. The VpnService API allows routes to be set "
- "on connect only and will clean up automatically.");
+ "on connect only and will clean up automatically. "
+ "Tried to delete %s gateway %s",
+ network,
+ gateway_needed ? gateway : "(not needed)");
#elif defined(TARGET_HAIKU)
/* ex: route delete /dev/net/ipro1000/0 inet6 :: gw beef::cafe prefixlen 64 */
@@ -1806,7 +1806,7 @@
#endif
-#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS))
+#if !(defined(_WIN32) || defined(TARGET_LINUX) || defined(TARGET_SOLARIS) || defined(TARGET_ANDROID))
static void
open_tun_generic(const char *dev, const char *dev_type, const char *dev_node, struct tuntap *tt)
{
@@ -1973,7 +1973,6 @@
openvpn_net_ctx_t *ctx)
{
#define ANDROID_TUNNAME "vpnservice-tun"
- struct user_pass up;
struct gc_arena gc = gc_new();
bool opentun;