mercredi 27 janvier 2016

[Guide] DNSCrypt for AArch64



Requirements:
  • Linux computer (x86_64)

  • Android NDK (r10e is the newest so far, get the 64-bit one)

  • libsodium (grab newest tar.gz, currently 1.0.8)

  • dnscrypt-proxy (1.6.0 will not work, grab master zip)


Here's how I did it:
1. Install the NDK (chmod a+x android-ndk-r10e.bin , then ./android-ndk-r10e.bin)
2. Run

Code:


export ANDROID_NDK_HOME=<NDK Location>

3. Run

Code:


tar -xvf libsodium-<ver>

on libsodium archive, and unzip on dnscrypt-proxy master.
4. Enter the folder of libsodium, and replace the android-build.sh in dist-build with the one in the first zip below. Also included is a modified version of android-armv7-a.sh named android-armv8a.sh.
5. Do ./dist-build/android-armv8-a.sh. When the script finishes it will tell you where the output is.
6. (Optional) Run android-toolchain-armv8-a/aarch64-linux-android/bin/strip on the output .so (typically in libsodium-android-armv8-a/lib/libsodium.so)
7. Now we do

Code:


export SODIUM_ANDROID_PREFIX=<libsodium output>

8. Enter the folder of dnscrypt, and basically unzip the second zip below in dist-build. Again, do ./dist-build/android-armb8-a.sh.
9. Now you have a fresh compilation of AArch64 dnscrypt-proxy!
10. (Optional) Run android-toolchain-armv8-a/aarch64-linux-android/bin/strip on the output binaries (typically in dnscrypt-proxy-android-armv8-a/system/xbin/dnscrypt/, do both dnscrypt-proxy and hostip).

Credits:
qwerty12 for the basic instructions

Changes:
libsodium's android-build:

Code:


NDK_PLATFORM:-android-16  to  NDK_PLATFORM:-android-21

libsodium's android-arm-v8-a:

Code:


Renamed

TARGET_ARCH=armv7-a  changed to  TARGET_ARCH=armv8-a
-mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -marm  removed(not compatible with AArch64's gcc)

-Os to -O3

ARCH=arm to ARCH=arm64

HOST_COMPILER=arm-linux-androideabi  to  HOST_COMPILER=aarch64-linux-android


dnscrypt-proxy's android-build:

Code:


NDK_PLATFORM:-android-18  to  NDK_PLATFORM:-android-21

dnscrypt-proxy's android-armv8-a: Similar to libsodium's





Download from this link

Aucun commentaire:

Enregistrer un commentaire