Show HN: XFiles – FOSS File Manager and Archiver with Root Support for Android
The project was born by the need to centralize in one application several file-explorer related capabilities, since I used to use:
- jrummy&#x27;s Root Browser for generic file management: <a href="https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.jrummyapps.rootbrowser.classic" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.jrummyapps...</a>
- RAR for Android for compressed archive support: <a href="https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.rarlab.rar" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=com.rarlab.rar</a>
- AndFTP for SFTP transfers: <a href="https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=lysesoft.andftp" rel="nofollow">https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=lysesoft.andft...</a>
- Superbeam for device-to-device transfers (till four years ago, the app was broken since Android 5)
Moreover, I don&#x27;t like ads very much, and each of these applications (at least in their free flavours) are ad-supported, so I started building my own application with the needed features.<p>The main dependencies the app uses are:
  - The Botan TLS library, for checksum support, private key generation for SFTP identities, and for establishing a TLS channel for device-to-device file exchange: <a href="https:&#x2F;&#x2F;botan.randombit.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;botan.randombit.net&#x2F;</a>
  - p7zip 16.0.2 (with a few modifications) for archive management: <a href="http:&#x2F;&#x2F;p7zip.sourceforge.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;p7zip.sourceforge.net&#x2F;</a>
  - SSHJ, for SFTP client support: <a href="https:&#x2F;&#x2F;github.com&#x2F;hierynomus&#x2F;sshj" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hierynomus&#x2F;sshj</a>
  - Apache MINA for exposing a FTP server, if it&#x27;s needed to share files with other platforms not running the app: <a href="https:&#x2F;&#x2F;mina.apache.org&#x2F;ftpserver-project&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;mina.apache.org&#x2F;ftpserver-project&#x2F;index.html</a>
  - Apache Commons lang for escaping urls in the builtin HTTP server implementation (same purpose of the FTP server): <a href="https:&#x2F;&#x2F;commons.apache.org&#x2F;proper&#x2F;commons-lang&#x2F;" rel="nofollow">https:&#x2F;&#x2F;commons.apache.org&#x2F;proper&#x2F;commons-lang&#x2F;</a>
  - (work in progress) SMBJ, for SMB client support for accessing remote shared folders on Windows: <a href="https:&#x2F;&#x2F;github.com&#x2F;hierynomus&#x2F;smbj" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hierynomus&#x2F;smbj</a><p>The main features are:
  - File explorer for local filesystems, with dual backend, namely the Java API-based one, and a native one relying on an external C++ executable (Roothelper) that can be run as root if root permissions are available;
  - Supported file ops: copy, move (cut&#x2F;copy + paste) for local, copy supports interactive file conflict resolution on local filesystems;
    copy only for remote file transfer; soft and hard linking where supported, mkdir, create file (both empty and with random content and custom size)
  - List view and grid view visualization, two-tab main browser view (ViewPager, slide from one tab to the other), with multi-step sort feature (e.g. sort first by date descending, then by name ascending, etc...)
  - Multi-selection feature, also with a continuous variant (similar to what you would do on PC by holding down left mouse button, opening a selection rectangle, and moving till needed items are selected); select all&#x2F;none&#x2F;unselect all&#x2F;none&#x2F;filter selection options as well
  - Compressed archive listing and extraction (7Z,ZIP,TAR,GZ,BZ2,XZ,CAB,RAR), and creation (7Z,TAR,ZIP), with some archiving options (password, encrypt filenames, compression level)
  - Hashing support, even for multiple files and multiple hashes at once, for the following checksums: MD5, SHA1, SHA2 variants (SHA256,SHA512...), SHA3 variants, Blake2B-256
  - Remote device to device file&#x2F;folder sharing for Android, via a custom application protocol (XFiles Remote Explorer, XRE) backed by TLS with end-to-end visual verification (like the one Telegram does for private chats and VoIP calls in order to ensure MITM-proof end-to-end encryption, essentially a visual hash)
  - Search files feature, only by name for now (search-within-content feature is planned)
  - A favorite manager for storing locations, both on local and on remote filesystems (XRE,SFTP)
  - An integrated URL downloader with customizable destination path and filename
  - A widget for XRE server, and &quot;Share with...&quot; protocol handling, for making device-to-device sharing more immediate and ergonomic
See the Demos page for a quick idea of the GUI and what can be done with the app (animated GIFs illustrating use cases): <a href="https:&#x2F;&#x2F;github.com&#x2F;pgp&#x2F;XFilesDemos" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pgp&#x2F;XFilesDemos</a><p>Some consideration about the native component, Roothelper, which source is hosted on a separate repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;pgp&#x2F;XFilesRootHelper" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pgp&#x2F;XFilesRootHelper</a>
- It is a local file operations server running on Unix Domain Sockets, the Java code of the Android app communicates with it through a client class, which sends op requests and receives op results, and incremental progress for file transfers. I didn&#x27;t use JNI because of the lack of the possibility of operating as root user, and in general because I believe JNI is a heavy interface layer (not talking so much about performance, but rather about code readability).
- This executable also implements the remote transfer feature via TLS, and hence it can be run in two modes, ordinary (recive commands via local socket, not available if building for Windows), and standalone -- by exposing a XRE server for exchanging files with Android devices running the app.
- It has been written with portability in mind, it actually builds and works on Windows 7 and above (x64 only, but you can play with the build scripts in order to allow also 32-bit builds), Linux x64, OSX x64 (tested on High Sierra, XQuartz is recommended), FreeBSD, and iOS (built just for testing, running it in a terminal emulator, on iOS 6.1, not tested on more recent devices). Of course, the Android supported ABIs are x86, x64, armv7, armv8a (the apk embeds all the four library variants). Build scripts are cmake based for any platform (CMakeLists.txt), with the exception of Android for which Android.mk legacy build system is used. My choice of the TLS library went on Botan, because it was the only one I managed to build successfully on all the above-mentioned platforms (I really had a lot of trouble with OpenSSL build attempts...)<p>This product, being born for personal use, and only in a second moment re-thought for the community, is still in alpha stage, so use it with caution on sensitive files. For this reason you won&#x27;t find it neither on the Play Store nor on F-Droid; however, the prebuilt, self-signed APK is available in the Releases section of the Github page: <a href="https:&#x2F;&#x2F;github.com&#x2F;pgp&#x2F;XFiles&#x2F;releases" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pgp&#x2F;XFiles&#x2F;releases</a>