Blog: http://www.ddcs.re
email: exportit.ddcs@gmail.com
It has as main objective to permit the use of your data located in your Android phone or tablet, on other devices like another Android system or your PC, or if the media is compatible on your TV set. For that, it uses the most standard protocols, UpnP and Http.
eXport-it implements a Server and a Client (two icons on your Android desktop). The server build a list of the video, audio and image files, and additionally the pdf and eBook files it can find in your Android system. The list of these files with their characteristics are set in memory and published through a UpnP Directory Service and an HTTP server.
The files are distributed only in four categories: the video files (mp4, webm and 3gpp) the audio files (mp3, ogg and m4a), the image files (jpeg, gif or png), and ebooks (pdf, prc, epub, pdb, mobi and djvu).
The server is not designed to manage thousands of files, a few hundred looks like what we have normally on a phone or tablet.
First of all, just start the server and wait for the end of initialization process. If you are on Wifi or on Mobile network you can check the status and the URLs to try it. Fort most of the people the server is inaccessible from Mobile network. You can first check what your server is distributing with a web browser pointing to the local URL after going out the server window (the real server is running in the background). It is also possible to use the IPv6 loopback address to access the HTML page from your browser with an URL like "http://[::1]:8192".
As second step, you can use the server configuration to change your server name and perhaps adapt the font size to your language and device.
The next step consists in defining a user name and password as administrator with access to all categories.
When it works, you can define additional user names with access to specific categories.
And finally you can define "port forwarding" when you are connected on your home Wifi to be accessible from Internet. If you are using the full application with UPnP support, you have just to define a non null port alias in the configuration and check on the console if it works. With the free application you have to configure manually your ADSL router. When it looks good you can try it from home with any web browser you have, using a free public Web proxy with Javascript support.
HTTPS although supported, doesn't look to be the best for normal users due to the complexity to use it with smartphones and the poor performances compared to simple HTTP.
When port forwarding and authentication are working, you can use the "club" option to be easily accessible on Internet, publishing your data on www.ddcs.re. To test your own server requires the use of a Web proxy because your own external IP address is not accessible from your Wifi network. This option permits to avoid the distribution of a changing URL with IP address and port number, just clicking on the right server line defined by your server name, a small description sentence and one of your image as icon.
The UPnP support is provided by Teleal Cling 1.0.5 (Copyright (C) 2010 Teleal GmbH, Switzerland), and the Http Server is built on top of NanoHTTPD version 1.25, Copyright 2001,2005-2012 Jarno Elonen and 2010 Konstantinos Togias. Thus this application contains LGPL software. Both are modified versions, not native code. The TelealCling library is only one jar file built with a few modifications required by the application from clingcore, clingsupport (1.0.5) and telealcommon (1.0.14) jar files... NanoHttpd was modified to support the "HEAD" method, to add the DLNA HTTP headers, request logging and to provide an initial home page. The source code is available as the executable.
All the emoticons used in the comments were designed and made by Enrico Gollnow (Erni). Visit his website to find more info about him and his smileys (http://www.gomotes.com).
The password encryption routine uses Tom Wu's jsbn library (Javascript BigInteger and RSA) on web browser side and the SpongyCastle java library on server side.
This application use JmDNS, an implementation of multi-cast DNS in Java for service discovery and registration. This library is fully interoperable with Apple's Bonjour protocol. All my thanks to Arthur van Hoff, Rick Blair and Kai Kreuzer, for this efficient library licensed under the Apache License, Version 2.0.
This application uses an HTML5 video player called Playr developed by Julien 'delphiki' Villetorte gdelphiki@gmail.com under MIT License, all my thanks for this great job and the permission to use it.
We are using PDF.JS to show PDF files through a WebView. This Open Source project is subject to an Apache Version 2 license. PDF.js (https://mozilla.github.io/pdf.js/) is a Portable Document Format (PDF) viewer that is built with HTML5. PDF.js is community-driven and supported by Mozilla.
The epubjs-reader package (https://github.com/futurepress/epubjs-reader) is used for epub eBooks and the books are shown in a WebView. This software is available through an MIT License.
We are now using Acme4J as Java Client (https://shredzone.org) for the _Automatic Certificate Management Environment_ (ACME) protocol as specified in the RFC 8555 (https://tools.ietf.org/html/rfc8555). ACME is a protocol that a certificate authority (CA) and an applicant can use to automate the process of verification and certificate issuance. It is an independent open source implementation that is not affiliated with or endorsed by Let's Encrypt.
Acme4J needs the Jose4j library (https://bitbucket.org/b_c/jose4j/wiki/Home) which is a robust and easy to use open source implementation of JSON Web Token (JWT) and the JOSE specification suite.
The two main components are the server and the client, and, after installation, you have two icons on your desktop.
The server starts a long running service which is in fact, the real Media server providing UPnP and HTTP services. This service is running in the background, just a small notification icon is set on Android taskbar. An important subtask of the server, is the configuration. By default the server exports all your data files on the local Wifi network. You can select/deselect files through the configuration.
The client processes data distributed by UPnP servers found on the local (Wifi) network. It has as subtasks a Mediaplayer for showing mp4, webm or 3gpp videos and listening to mp3, ogg or m4a audio files, a Webview dialog window for displaying photos. In addition, a background service can be started for downloading files from the server. When started before the server, the client initialize the UPnP service but without distributing data files, a sort of empty server. This service is needed to get access to other UPnP servers.
In system's settings, then Advanced settings, you can find Battery manager. To keep the server up and running permanently, you should select Performance for the Power plan, and activate this app in protected apps and in power-intensive apps.
If feasible you must keep your WiFi active when your device is sleeping and the server runs, and in addition, if your device has an integrated DLNA stack, you should not look for "nearby devices" in system settings.
The server requires access to the file system and to read the phone settings for detecting state changes like on Wifi or if data transmission is activated if connected to mobile network. Optionally the server can send SMS when the external IP address is changed (option in the configuration) and the country code by Access_Coarse_Location, (not a precise location just the two letters country code). The client program uses the permission to write to external storage for saving downloaded files, and the record audio permission for showing curves when listening to music.
To publish files on Internet with your eXport-it server, you have to configure the HTTP server port aliasing in your ADSL router. UPnP protocol is not available on Internet, only HTTP. The default port number is 8192 (you can modify it through the configuration), and an alias port for the public network, must be given on the ADSL router associated with the Wifi IP address of the eXport-it server. The default external port number in the configuration is 0, but you can set what you want like 8192 or 80. The URL to use to access your server, is given on top side of the server window.
My Web server had been supporting HTTPS with self-signed certificates for years, but, although it works, this way gives troubles and error messages. That is the reason why, I decided to implement the Automatic Certificate Management Environment_ (ACME) protocol, to get and maintain standard X509 certificates.
The ACME protocol has some technical requirements, it is not usable for everybody. To use this protocol, you need a fixed DNS name on your external IP address. The X509 certificate must be set only on a DNS name not on an IP addresses.
To get the certificate from Let's Encrypt, you need to use an HTTP server with the standard port number (80) on this external DNS name. With my application, you can get the certificate only on a server running with HTTP external port alias set to "80". Only one server can use this value on your home Wi-Fi network. When you have a valid certificate, you can use the HTTPS default port of "443" only on one of your Web servers set as "alias port". But to avoid to "root" your device you should use ports above 1024 as "local" port numbers by sample 8080 for HTTP and 8443 for HTTPS.
The "configuration" panel is modified to support port aliases for both HTTP and HTTPS protocols, and in addition you can give a DNS name you know working, for your external IP address This name will be defined in your X509 certificate in addition to the name of your network provider if you have one. The certificate is automatically distributed to other export-it servers running on the same Wi-Fi network, permitting to use HTTPS over Internet but with other port alias values.