From 68ed4d08a00b81d5222475b56e0ad4d821603cfd Mon Sep 17 00:00:00 2001 From: Konstantin Svist Date: Tue, 28 Nov 2023 14:26:18 -0800 Subject: [PATCH 1/3] Add configs for arm64 binary builds. --- app/src/main/java/dev/ukanth/ufirewall/Api.java | 11 +++++++++++ external/.gitignore | 1 + external/Makefile | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/dev/ukanth/ufirewall/Api.java b/app/src/main/java/dev/ukanth/ufirewall/Api.java index cdba365a7..57518fb73 100644 --- a/app/src/main/java/dev/ukanth/ufirewall/Api.java +++ b/app/src/main/java/dev/ukanth/ufirewall/Api.java @@ -1859,6 +1859,15 @@ private static boolean installBinariesMips() { return true; } + private static boolean installBinariesArm64() { + if (!installBinary(ctx, R.raw.busybox_arm64, "busybox")) return false; + if (!installBinary(ctx, R.raw.iptables_arm64, "iptables")) return false; + if (!installBinary(ctx, R.raw.ip6tables_arm64, "ip6tables")) return false; + if (!installBinary(ctx, R.raw.nflog_arm64, "nflog")) return false; + //if (!installBinary(ctx, R.raw.run_pie_arm64, "run_pie")) return false; + return true; + } + private static boolean installBinariesArm() { if (!installBinary(ctx, R.raw.busybox_arm, "busybox")) return false; if (!installBinary(ctx, R.raw.iptables_arm, "iptables")) return false; @@ -1873,6 +1882,8 @@ private static boolean installBinariesForAbi(String abi) { return installBinariesX86(); } else if (abi.startsWith("mips")) { return installBinariesMips(); + } else if (abi.startsWith("arm64")) { + return installBinariesArm64(); } else { return installBinariesArm(); } diff --git a/external/.gitignore b/external/.gitignore index 2f946e1cc..37629350c 100644 --- a/external/.gitignore +++ b/external/.gitignore @@ -1,3 +1,4 @@ +aarch64-linux-android/ arm-linux-androideabi/ i686-linux-android/ mipsel-linux-android/ diff --git a/external/Makefile b/external/Makefile index 94aa123a2..58e98f80a 100644 --- a/external/Makefile +++ b/external/Makefile @@ -7,7 +7,7 @@ ARCH := arm GCCVER := 4.9 # You should be able to just 'make ARCH=x86' and it should DTRT. -ARCH_LIST := arm x86 mips +ARCH_LIST := arm arm64 x86 mips #ARCH_LIST := arm ifeq ($(ARCH),arm) TRIPLET := arm-linux-androideabi @@ -15,6 +15,12 @@ TOOLCHAIN := $(TRIPLET)-$(GCCVER) APIVER := 8 NDK_ABINAME := armeabi endif +ifeq ($(ARCH),arm64) +TRIPLET := aarch64-linux-android +TOOLCHAIN := $(TRIPLET)-$(GCCVER) +APIVER := 21 +NDK_ABINAME := arm64 +endif ifeq ($(ARCH),x86) TRIPLET := i686-linux-android TOOLCHAIN := x86-$(GCCVER) From b4dc1c1c56f09644b42c77d795bf5938aa70817e Mon Sep 17 00:00:00 2001 From: Konstantin Svist Date: Mon, 18 Dec 2023 17:05:14 -0800 Subject: [PATCH 2/3] Fix NDK_ABINAME ("arm64" is not valid, but "arm64-v8a" works) --- external/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/Makefile b/external/Makefile index 58e98f80a..dd1fb3d2d 100644 --- a/external/Makefile +++ b/external/Makefile @@ -19,7 +19,7 @@ ifeq ($(ARCH),arm64) TRIPLET := aarch64-linux-android TOOLCHAIN := $(TRIPLET)-$(GCCVER) APIVER := 21 -NDK_ABINAME := arm64 +NDK_ABINAME := arm64-v8a endif ifeq ($(ARCH),x86) TRIPLET := i686-linux-android From d88b2fb4bb3e2642f9a6ddf2ace5a705b0416376 Mon Sep 17 00:00:00 2001 From: Konstantin Svist Date: Mon, 4 Mar 2024 11:39:22 -0800 Subject: [PATCH 3/3] cleanup unintentionally added a newline --- external/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/external/Makefile b/external/Makefile index ec622ed4d..340a69ffc 100644 --- a/external/Makefile +++ b/external/Makefile @@ -9,7 +9,6 @@ GCCVER := 4.9 # You should be able to just 'make ARCH=x86' and it should DTRT. ARCH_LIST := arm arm64 x86 mips APIVER := 21 - ifeq ($(ARCH),arm) TRIPLET := arm-linux-androideabi TOOLCHAIN := $(TRIPLET)-$(GCCVER)