README.android 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. aria2 for Android devices
  2. =========================
  3. aria2 is a lightweight multi-protocol & multi-source download utility
  4. operated in command-line. It supports HTTP/HTTPS, FTP, BitTorrent and
  5. Metalink.
  6. Install
  7. -------
  8. aria2 is not an ordinary Android Java application. It is a C++ native
  9. application and operates in command-line. You don't have to 'root'
  10. your device to use aria2. Because aria2 is a command-line program,
  11. you need a terminal emulator. First install Android Terminal Emulator
  12. from Android Market (or build it from source and install. See
  13. https://github.com/jackpal/Android-Terminal-Emulator/).
  14. 1. Copy aria2c executable to ``/mnt/sdcard`` on your device.
  15. 2. Run Android Terminal Emulator.
  16. 3. ``mkdir /data/data/jackpal.androidterm/aria2``
  17. 4. ``cat /mnt/sdcard/aria2c > /data/data/jackpal.androidterm/aria2/aria2c``
  18. 5. ``chmod 744 /data/data/jackpal.androidterm/aria2/aria2c``
  19. 6. Add the following commands to the initial command of Android
  20. Terminal Emulator::
  21. export HOME=/data/data/jackpal.androidterm/aria2; cd $HOME
  22. 7. Exit Android Terminal Emulator.
  23. 8. Run Android Terminal Emulator again.
  24. 9. See whether aria2c actually works by invoking ``./aria2c -v``
  25. How to use
  26. ----------
  27. See `the online manual
  28. <https://aria2.github.io/manual/en/html/>`_.
  29. Notes
  30. -----
  31. aria2c executable was generated using android-ndk-r10d.
  32. The following libraries were statically linked.
  33. * openssl 1.0.2h
  34. * expat 2.1.1
  35. * c-ares 1.11.0
  36. * libssh2 1.7.0
  37. Since Android does not have ``/etc/resolv.conf``, c-ares (asynchronous
  38. DNS resolver) is disabled by default. But name resolution is sometimes
  39. a little bit slow, so I recommend to enable c-ares. You can enable it
  40. using ``--async-dns`` and specify DNS servers using
  41. ``--async-dns-server`` option, like this::
  42. --async-dns --async-dns-server=`getprop net.dns1`,`getprop net.dns2`
  43. Additionally, the CA certificates shipped with Android don't locate in
  44. the same place as those of normal Unix-like systems do, so this
  45. workaround might be useful to securely download files via HTTPS::
  46. cat /etc/security/cacerts/* | aria2c --ca-certificate=/proc/self/fd/0 $@
  47. Because it is tedious to type these long parameters every time you use
  48. aria2c, the following wrapper shell script would be handy::
  49. #!/system/bin/sh
  50. cat /etc/security/cacerts/* | \
  51. /data/data/jackpal.androidterm/aria2c \
  52. --ca-certificate=/proc/self/fd/0 \
  53. --async-dns \
  54. --async-dns-server=`getprop net.dns1`,`getprop net.dns2` \
  55. "$@"
  56. Please note that you need to add executable file mode bit to this
  57. wrapper script too. (e.g., ``chmod 744 /PATH/TO/SCRIPT``)
  58. Known Issues
  59. ------------
  60. * Since Android does not have ``/dev/stdout``, ``-l-`` does not work.
  61. ``/proc/self/fd/0`` is a workaround for Android.
  62. * Android Terminal Emulator sometimes stops updating console. It looks
  63. like aria2c hangs, but aria2c continues to run.