Android App for MEG. Not finished yet
As a debug feature you can remove a symmetric key for communicating with the client.
Steps:
- From the home screen click on
Installation
- Click on
Advanced Options
- Click
DEBUG: REVOKE AES SYMMETRIC
. - Go back to home screen and click
Login
- Go to client, remove symmetric key on client, and scan new key.
Now you will have a new symmetic key pair to use when communicating with the client.
[Needed]
- Java Development Kit (JDK) 8
- Android Studio
[Needed]
- Java Development Kit (JDK) 8
- Android Studio
- Extras (includes the Android Debug Bridge)
sudo apt-get install android-tools-adb
- Connect your phone to your development computer as explained here.
- Launch Android Studio and step through the setup wizard.
- Click
Next
through the first screen or two (options should be obvious) until you get to theInstallation Type screen
. - On the
Installation Type
screen selectCustom
and clickNext
. - Select your IDE theme etc.
- On the
SDK Components Setup
screen select all checkboxes and clickNext
. - Click through the remaining screens (if any) until you are presented with a
Finish
button. Click it.
- Click
- Once the Android Studio setup process is finished you can start a new project. Click
Checkout project from Version Control
and selectGitHub
.- Enter your GitHub username and password. Click
Login
. Note: you might need to fork the code from hahnicity/MEGAndroid first if you don't have write access to the repository. - Setup a master password for the database or leave blank to disable password protection.
- Select the MEGAndroid repository or fork from your GitHub account.
- Select the location where you want the code to reside. The directory name should already be correct, so don't change it. Click
Clone
.
- Enter your GitHub username and password. Click
- On the
Import Project from Gradle
screen, selectUse default gradle wrapper (recommended)
. Now, before you can continue, you'll need to make alocal.properties
file in your cloned MEGAndroid project.- Go to the location where your MEGAndroid project exists. Inside the MEGAndroid folder create a file called
local.properties
. - On the first line of the
local.properties
file put something like the followingsdk.dir=/path_to/sdk
. Note: on Linux this will probably be something likesdk.dir=/home/user/Android/Sdk/
- Go to the location where your MEGAndroid project exists. Inside the MEGAndroid folder create a file called
- Leave the other settings on the
Import Project from Gradle
screen at their defaults. ClickOK
. - If you see an error like "Cause: failed to find target with hash string 'android-23' in: /home/user/Android/Sdk" run /home/user/Android/Sdk/tools/android and select the version of the API that you're missing (23, for Android 6.0 in this example... you may also need Android SDK Build Tools 23.0.1) and install.
- You should now be able to finish out the installation.
- When the setup is complete Android Studio will want to compile the code. When this process is finished, check the
Gradle
tab in the bottom right corner. If you see a message saying the build was successful, you are ready to install the app on your phone.
- Select
Run > Debug
from the menu (note in some versions of Android Studio you might need to selectinstallDebug
from the Installation tab). This should trigger the installation on your phone. - If your gradle build fails, you may have to install the 32bit libz, on ubuntu this is accomplished by
sudo apt-get install zlib1g:i386
- After the installation completes, you'll need to give MEG the proper permissions on your phone. Enable the
Camera
by going toSettings > Apps > MEG > Permissions
.
- You get a message that says something to the effect of, Failed to find Build Tools revision 23.0.1.
- Run the command
android list sdk -a
in the terminal. Make note of the list. Find the one with the same version number as the error message, in this case 23.0.1. Remember the line number. - If this fails go to step 2 below.
- Run a command similar to this one:
android update sdk -a -u -t 3
but change the last argument. - IMPORTANT: the last number after
-t
should be the line number from the previous step. - Your sdk will now update and you should be able to complete the setup process.
- Run the command
- If you can't run android commands from the terminal:
- In the MEGAndroid directory run the following commands in succession:
export ANDROID_HOME=~/Android/Sdk
(change "~" to "$HOME" on Mac)export PATH=$ANDROID_HOME/tools:$PATH
- Test the above by typing
android
in the terminal. If it launches the Android SDK Manager, you know it works. Close the SDK Manager. You should now be able to continue with your setup.
- If the project installation still fails:
- Run the following command:
set ANDROID_HOME=/path_to/sdk
.
- Run the following command: