mitro-co / mitro

Repository for all Mitro client & server code
GNU General Public License v3.0
1.65k stars 243 forks source link

Get mitro to compile on Intellij. #129

Closed levibostian closed 8 years ago

levibostian commented 8 years ago

I do not using Eclipse so I wanted to get mitro to compile via Intellij14.

App compiles successfully and installs to Android device.

winstonhong commented 8 years ago

Hello levibostian.

Thank you very much for your quick reply.

The official Mitro server is shutting down on September 30th, 2015.

I can NOT create a new Mitro account to test Android Mitro client.

I can log in to a local Mitro server such as https://10.10.10.100:8443/mitro-core/api using Chrome or Firefox successfully.

Do you successfully log in to a local Mitro server such as https://10.10.10.100:8443/mitro-core/api?

Thank you.

Best regards,

Winston Hong

levibostian commented 8 years ago

So, are you saying I need to take mitro-core, run it on my local machine and try to connect to it via the app?

winstonhong commented 8 years ago

Hello levibostian.

Thank you very much for your quick reply.

Yes. I take mitro-core, run it on my local machine and try to connect to it via the Android client app, but I fail.

However, I can connect to it via the Mitro Firefox and Chrome web browser.

I build self-hosting mitro server 10.10.10.100 on Ubuntu 14.04, according to the following installation guide.

https://www.hashtagsecurity.com/mitro-login-manager-on-premise-2/

The official Mitro server is shutting down on September 30th, 2015. Therefore, the Android client app built based on your source code can NOT connect with the official Mitro server next Month.

https://www.mitro.co/

I modified the following code.

Line 49

//private static final String API_BASE_PATH = "https://www.mitro.co/mitro-core/api/";

Line 50

private static final String API_BASE_PATH = "http://10.0.10.100:8080/mitro-core/api/";

or

Line 50

private static final String API_BASE_PATH = "https://10.0.10.100:8443/mitro-core/api/";

https://github.com/levibostian/mitro/blob/master/mitro-core/android/MitroApp/src/co/mitro/mitro/MitroApi.java

I can use Firefox and Chrome web browser to login

both https://10.0.10.100:8443/mitro-core/api/

and http://10.0.10.100:8080/mitro-core/api/

But I fail to login the above two APIs using the Android client app.

Thank you.

Best regards,

Winston Hong

levibostian commented 8 years ago

When you say: "Yes. I take mitro-core, run it on my local machine and try to connect to it via the Android client app, but I fail." do you mean that you took my code and you failed? Or did it fail for a reason that has nothing to do with my changes?

If you have not tested my code on a working Mitro core install, would you mind doing so for me? Getting an install up and running sounds a little more involved then I am hoping to do myself especially when I will just be uninstalling it afterwards anyway.

winstonhong commented 8 years ago

Hello levibostian.

Thank you very much for your quick reply.

Yes. I took your code for Mitro-Android client app from the following link.

https://github.com/levibostian/mitro/tree/master/mitro-core/android

I provide my experiment results of Mitro-Android client app as follows.

(1) I only replace the "android" folder of the original mitro-core with your "android" folder.

I fail to compile the "android" folder of the original mitro-core from the following link using Eclipse or Intellij. https://github.com/mitro-co/mitro/tree/master/mitro-core/android

I replace the "android" folder of the original mitro-core with your "android" folder.

Then I can create Android client app using your code from the following link using Intellij. https://github.com/levibostian/mitro/tree/master/mitro-core/android

Note that Mitro team remove Android client app from the Android store, as mentioned by you on April 10, 2015 in the following link.

https://github.com/mitro-co/mitro/issues/115

(2) Testing Mitro-Android client app created by your code using Intellij with the official Mitro server.

https://www.mitro.co/mitro-core/api/

(2a) Install the Mitro-Chrome plugin from the Chrome web store.

https://chrome.google.com/webstore/detail/mitro-login-manager/iljkkpbfidmehafdbcacnhcaipdgbeij?hl=en

(2b) Sign-Up a new Mitro account (e.g., winston.hong@email.com)

(2c) Log in to Email account winston.hong@email.com , and click the account activation link

(2d) Log in to Mitro account winston.hong@email.com successfully using Mitro-Chrome plugin

(2e) Log in to Mitro account winston.hong@email.com using Mitro-Android client app for the first-time

A message "a device activation link has been sent to your Email account" appears in the GUI of Mitro-Android client app

http://appslollipop.com/Apps_Mitro-Password-Manager_Lollipop.html

(2f) Log in to Email account winston.hong@email.com , and click the device activation link

(2g) Log in to the official Mitro account winston.hong@email.com using Mitro-Android client app again

Mitro-Android client app automatically closes, and a window "Unfortunately, Mitro has stopped. OK" pops-up

I fail to log in to the official Mitro server (https://www.mitro.co/mitro-core/api/) using Mitro-Android client app created by your code. The official Mitro server can recognize Mitro-Android client app created by your code, and send a device activation link to my Email account.

But after I click the device activation link, The official Mitro server told me that "Mitro service has stopped". However, I can still log in to the official Mitro server using Mitro-Chrome plugin.

Do you log in to the official Mitro server (https://www.mitro.co/mitro-core/api/) using Mitro-Android client app created by your code recently? Thanks.

(3) Testing Mitro-Android client app created by your code using Intellij with the self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/)

(3a) Follow the installation guide to build self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/)

https://www.hashtagsecurity.com/mitro-login-manager-on-premise-2/

https://github.com/mitro-co/mitro/issues/79

(3b) Follow the installation guide to create the Mitro-Chrome plugin and Mitro-Firefox plugin

https://www.hashtagsecurity.com/mitro-login-manager-on-premise-2/

https://github.com/mitro-co/mitro/issues/79

(3c) Log in to Mitro account winston.hong@email.com at the self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/) SUCCESSFULLY using the self-created Mitro-Chrome plugin and Mitro-Firefox plugin based on the original Mitro code

https://github.com/mitro-co/mitro

Yes. My Email account winston.hong@email.com receives the account activation link sent by the self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/)

I click the account activation link

I log in to the self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/) SUCCESSFULLY using Mitro-Chrome plugin created by the original mitro code

(3d) Log in to Mitro account winston.hong@email.com using Mitro-Android client app created by your code for the first-time

A message "login fails" appears in the GUI of Mitro-Android client app, NOT a message "a device activation link has been sent to your Email account" appears

No. My Email account winston.hong@email.com does NOT receive the device activation link sent by the self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/)

I FAIL to log in to the self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/) using Mitro-Android client app created by your code

(4) The root causes of the failure for login to both the official Mitro server and the self-hosting Mitro server using Mitro-Android client app created by your code can be aummarized as follows:

(I) The official Mitro server has stopped the service for Mitro-Android client app, while it will terminate all the service for Mitro-Chrome and Mitro-Firefox plugin on September 30, 2015.

(II) https://10.10.10.100:8443/mitro-core/api/ only owns the self-signing SSL certificate instead of the official SSL certificate issued by SSL certificate provider (which requires the annual certification fee)

(III) In addition to Line 49 and Line 50 of MitroApi.java, Probably we need to modify other code to let the self-hosting Mitro server (https://10.10.10.100:8443/mitro-core/api/) to recognize Mitro-Android client app created by your code. Yes. The offical Mitro server can recognize Mitro-Android client app created by your code, but has terminated the service.

Thank you very much.

Best regards,

Winston Hong

levibostian commented 8 years ago

Wow. That was a pretty well done test. I did not expect you to take the time to do that, thanks!

It sounds to me like I need to go through my code and fix it somewhere to allow login to become successful. I thought that my changes where simply a refactor allowing the ability for devs to build the app via IntelliJ but I guess something got messed up somewhere?

Now, unfortunately, I do not have the urge to fix these issues as I do not use Mitro anymore since they shut down. So I am not sure when I will ever get to this if I ever do. So for now, I am going to close this issue.

Sorry if you feel your time was wasted. You went above and beyond with helping me!! Thanks!

winstonhong commented 8 years ago

Hello levibostian.

Thank you very much for your quick reply.

I found the root cause of the failure to communicate with Mitro server.

(1) I import the project from the existing source (i.e., your code). I only import mitro-core/android folder Then I can create Mitro-Android APK successfully using Intellij on Windows 7 instead of Ubuntu14.04.

But in this way, I fail to import the following package into Mitro-Android APK created by your code.

import co.mitro.api.RPC; import co.mitro.api.RPC.ListMySecretsAndGroupKeysResponse.GroupInfo; import co.mitro.api.RPC.ListMySecretsAndGroupKeysResponse.SecretToPath; import co.mitro.core.crypto.KeyInterfaces.CryptoError; import co.mitro.core.crypto.KeyInterfaces.KeyFactory; import co.mitro.core.crypto.KeyInterfaces.PrivateKeyInterface; import co.mitro.core.crypto.KeyczarKeyFactory; import co.mitro.keyczar.KeyczarJsonReader;

https://github.com/levibostian/mitro/blob/master/mitro-core/android/MitroApp/src/co/mitro/mitro/MitroApi.java

(2) I import the project from the existing source (i.e., your code).

If I import mitro-core/ folder, I fail to create Mitro-Android APK using Intellij.

Note that my Android ADT is 4.4.2, that is, android:targetSdkVersion="19" according to your ADT configuration as well as Mitro ADT configuration.

https://github.com/levibostian/mitro/blob/master/mitro-core/android/MitroApp/AndroidManifest.xml

Would you please share your experience on compiling/building Mitro-Android client APK? Thanks.

Do you create your Mitro-Android client on Ubuntu14.04/Linux instead of Windows 7/8?

Thank you very much.

Best regards,

Winston Hong

levibostian commented 8 years ago

I compile using Lubuntu 14.04 so yes, Ubuntu 14.04.

I use IntelliJ 14 and don't "import code" into IntelliJ because you will have lots of failures compiling the code (that is what this pull request does, fix those failures compiling the code). So instead, "open an existing project" in IntelliJ to open up my code.

winstonhong commented 8 years ago

Hello levibostian.

Thank you very much for your quick reply.

I will try to compile Mitro-Android client using IntelliJ 14 on Ubuntu 14.04 desktop.

Thank you very much.

Best regards,

Winston Hong