README.android 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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-r14b.
  32. The following libraries were statically linked.
  33. * openssl 1.0.2o
  34. * expat 2.2.5
  35. * zlib 1.2.11
  36. * c-ares 1.14.0
  37. * libssh2 1.8.0
  38. Since Android does not have ``/etc/resolv.conf``, c-ares (asynchronous
  39. DNS resolver) is disabled by default. But name resolution is sometimes
  40. a little bit slow, so I recommend to enable c-ares. You can enable it
  41. using ``--async-dns`` and specify DNS servers using
  42. ``--async-dns-server`` option, like this::
  43. --async-dns --async-dns-server=`getprop net.dns1`,`getprop net.dns2`
  44. Additionally, the CA certificates shipped with Android don't locate in
  45. the same place as those of normal Unix-like systems do, so this
  46. workaround might be useful to securely download files via HTTPS::
  47. cat /etc/security/cacerts/* | aria2c --ca-certificate=/proc/self/fd/0 $@
  48. Because it is tedious to type these long parameters every time you use
  49. aria2c, the following wrapper shell script would be handy::
  50. #!/system/bin/sh
  51. cat /etc/security/cacerts/* | \
  52. /data/data/jackpal.androidterm/aria2c \
  53. --ca-certificate=/proc/self/fd/0 \
  54. --async-dns \
  55. --async-dns-server=`getprop net.dns1`,`getprop net.dns2` \
  56. "$@"
  57. Please note that you need to add executable file mode bit to this
  58. wrapper script too. (e.g., ``chmod 744 /PATH/TO/SCRIPT``)
  59. Known Issues
  60. ------------
  61. * Since Android does not have ``/dev/stdout``, ``-l-`` does not work.
  62. ``/proc/self/fd/0`` is a workaround for Android.
  63. * Android Terminal Emulator sometimes stops updating console. It looks
  64. like aria2c hangs, but aria2c continues to run.