Skip to content

Commit

Permalink
Merge pull request #1365 from Fry-kun/arm64
Browse files Browse the repository at this point in the history
Add configs for arm64 binary builds.
  • Loading branch information
ukanth authored Apr 4, 2024
2 parents 7a0b8cf + d88b2fb commit 11ed0bd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/src/main/java/dev/ukanth/ufirewall/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions external/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
aarch64-linux-android/
arm-linux-androideabi/
i686-linux-android/
mipsel-linux-android/
Expand Down
8 changes: 7 additions & 1 deletion external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ 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
APIVER := 21
ifeq ($(ARCH),arm)
TRIPLET := arm-linux-androideabi
TOOLCHAIN := $(TRIPLET)-$(GCCVER)
NDK_ABINAME := armeabi
endif
ifeq ($(ARCH),arm64)
TRIPLET := aarch64-linux-android
TOOLCHAIN := $(TRIPLET)-$(GCCVER)
APIVER := 21
NDK_ABINAME := arm64-v8a
endif
ifeq ($(ARCH),x86)
TRIPLET := i686-linux-android
TOOLCHAIN := x86-$(GCCVER)
Expand Down

0 comments on commit 11ed0bd

Please sign in to comment.