Made SRP working with ProviderAPI methods more frequently than not in localhost, but I cannot succeed in api.bitmask.net with my personal account. Next step: add tests from api.bitmask.net.
This commit contains:
- SRP algorithm improved (validate method uses trim, and some other
trims have been added).
- Refactored calculatePasswordHash, so that it receives a String instead
of a char array, and now it is capable of escaping "\" correctly.
- A 1000*2 successful logins, with a new test that performs 1000 trials
for 2 different username/password/server trios.

Next step: think about how the user is going to trigger the log in
fragment.
Coded logout method, and tested.
Coded dialog (now there is a button in the Dashboard), time to test.

I need to implement bypass for dev.bitmask.net, because bitmask.net is
down.
Added danger mode: we can bypass dev.bitmask.net hostname io exception.
"Trust completely" checkbox saves that trust for the new provider
entered, so that if in the future the client tries to log in or
whatever, it can use the certificate downloaded when added.

Log in dialog works ok, showing a toast when authentication fails (by
this time, I have not managed to get a correct login due to
dev.bitmask.net problems).

dev.bitmask.net works perfectly, via adding it as a new provider
(MeanderingCode, this is for you ;) ).

All GET requests are done by default Android URL class, which means that
certificates trusted by Android are also trusted by us. If there are
problems when logging in due to certificates, the app is able to use
only the certificate associated to the provider in the moment it was
selected as the chosen provider.
Changed the message shown when checking if the password is valid or not.

Refactored LeapSRPSession so that there is no need to send A twice.
If the app is restarted with a custom provider selected, the client can
request a log in without certificates problems.

I've removed the addition of the certificate when downloaded
eip-service.json, because I already do that in LeapHttpClient.

Solves issue 2367: https://leap.se/code/issues/2367
Logging in successfully to dev.bitmask.net :)

The problem was that I needed to append the api_version to the api_uri.
I was doing well in tests because I hardcoded the api urls, but in
production code I was getting from provider.json only api_url and not
api_version.
Ready to create a new branch for the download of the new user auth'ed
certificate.

Next step in this branch: detect what the selected provider support in
terms of authenticated/anon users, and show login/logout methods
consecuently.
After loggin in successfully, the new client certificate is downloaded.

It is stored in SharedPrefs, with ConfigHelper.cert_key (="cert") key.
Log in and Log out options are shown only if allow registration is true.

Allow registration is present in provider.json.

Provider.json is downloaded from both preseeded and custom providers.

Authentication success or fail is notified correctly to the user.
A bit more clean.

I've upper cased ConfigHelper constants.

I've created a new method in ConfigHelper, to send requests to a server,
that it's used when sending A and M1.
Anon certificate is downloaded if possible.

I download the anon certificate only if allow_anonymous is true, and
before launching Dashboard.

I store it in SharedPreferences, with "cert" key, as a JSON object.
First version of the README and ant build.xml

This is the first commit of this branch. It contains the README file
with instructions for different user targets (Compiling, Running on the
emulator and Debugging from console), and the ant build.xml file.

debug.sh is an experimental script, because it uses "sleep" to
synchronize between Emulator and adb install and run. If you want to use
it, please look for that "sleep" lines and update their numbers
according to your experience.
debug.sh works without initial big sleep.

I've found the way to detect if the emulator has finished booting, so
that I can install and start leap_android without problems.

I've moved the last sleep before the pid calculation, because sometimes
it wasn't calculated well (I think because I asked for it too soon).
Added new file: run.sh

It just runs the emulator, installs leap_android and runs it. No
debugger session is returned.
Starting basic adt vim plugin.

If I execute AndroidRun, run.sh is not called but echoes are printed.
README now suggest to use scripts.

I've also simlinked README.txt to README. In the future, if we want to
write another file in another format (MarkDown?), we will only have to
change the target of the README file.
README now suggest to use scripts.

I've entered a new script: compile.sh

I've also simlinked README.txt to README. In the future, if we want to
write another file in another format (MarkDown?), we will only have to
change the target of the README file.