android-password-store / Android-Password-Store

Android application compatible with ZX2C4's Pass command line application
https://passwordstore.app
GNU General Public License v3.0
2.59k stars 271 forks source link

Can't import SSH Key #4

Closed sauberfred closed 10 years ago

sauberfred commented 10 years ago

When i choose my key file in the file browser i just get back to the app and nothing happens. The authenticate popup does not show up even though the key is password protected. I am on a Nexus 5 (4.4.4) and have version 1.1 b4 from F-Droid installed.

zeapo commented 10 years ago

I see, that's a problem with the gif that tries to explain the perfect workflow. For the moment, once you select your ssh-key, go back, and hit clone again. It will work.

The issue is deeper than that. On KitKat, they changed the way files are opened (using Android's default file manager). The issue is being fixed.

in 1.1-b5 this will be resolved.

zeapo commented 10 years ago

This should work now. Use the apk that is available on github (app/app-release.apk)

zeapo commented 10 years ago

@sauberfred is it working now with the available version on F-droid?

sauberfred commented 10 years ago

@zeapo Yes i can import the key and when cloning i am asked for the ssh-key password. But then the app crashes ("Unfortunately, Password Store has stopped."). When i reopen the app, i get a white screen with just the orange titlebar. Neither the "plus" nor the "refresh" icon are working. But when i try to pull from the remote i am asked to reenter the ssh-key password and doing so the app crashes again. I will generate a key without a password and see if that changes anything.

zeapo commented 10 years ago

Clear the app data and retry. Can you attach the logcat output if it crashes? (see http://developer.android.com/tools/help/logcat.html) On Sep 22, 2014 2:06 PM, "Flori Rott" notifications@github.com wrote:

Yes i can import the key and when cloning i am asked for the ssh-key password. But then the app crashes ("Unfortunately, Password Store has stopped."). When i reopen the app, i get a white screen with just the orange titlebar. Neither the "plus" nor the "refresh" icon are working. But when i try to pull from the remote i am asked to reenter the ssh-key password and doing so the app crashes again. I will generate a key without a password and see if that changes anything.

— Reply to this email directly or view it on GitHub https://github.com/zeapo/Android-Password-Store/issues/4#issuecomment-56363399 .

sauberfred commented 10 years ago

Cleared the app and retried, but still crashes. I will post the logcat output tonight.

Btw I am using the ART runtime, dont know if that is a problem.

kLeZ commented 10 years ago

Probably it is. The libraries used by Android Password Store are using some optimizations of the Dalvik Engine. If you change the runtime, it will surely crash. If you can, try to change the runtime and prepare a working data set, then change the runtime again, and see if it still works. Well, the logcat is still a goodie that we wish to have, in order to support even ART ;-)

zeapo commented 10 years ago

the application does indeed crash on ART runtime, @Djabbz reported it previously. I didn't look into it yet.

kLeZ commented 10 years ago

I'm looking into it now, debugging the app through Eclipse directly on the physical device (GT-I9100 w/ CM11). I've switched to ART runtime in order to see what happens.

zeapo commented 10 years ago

The logcat shows a segfault. There is probably a double free or some similar issue.

kLeZ commented 10 years ago

I first tried switching to the ART runtime and debugging latest sources, it gave me the SIGSEGV we know about (here the logcat http://dpaste.com/1VHG9BM). Then I investigated further on the JGit library that seems to be the guilty one. After attaching the JGit sources into Eclipse in order to debug it, it has worked and thus our PwdStore.

What I've done was:

  1. Change runtime from Dalvik to ART (Developer Options > Runtime)
  2. Rebooted in order to apply the changes (ART does some optimizations a.k.a. creates his cache as even Dalvik does)
  3. Cleared data and cache for PwdStore
  4. Ran PwdStore debugging with Eclipse, that updates the apk (so some reinstallation behavior could happen)

What I expected to be: SIGSEGV while cloning. What happened: Flawless usage, repository cloned, app working.

I really don't know why it is so poor reproducible. Any ideas, you guys?

zeapo commented 10 years ago

can you check if building using jgit 3.5+ 072db0ca5c02aea9562534286bb8a582f455449a works better? @sauberfred the apk is available on 072db0ca5c02aea9562534286bb8a582f455449a app/app-release.apk

bugabinga commented 10 years ago

I am experiencing the same issue on a Nexus 5 with CM 11 and ART enabled.

  1. Enable ART
  2. Clear data of PwdStore
  3. Clone existing repo from github with ssh key file

Expected to see an imported repo. But got a blank screen as described by @sauberfred.

JGit or any of its dependencies seem a likely culprit ,because I experience a similar issues with SGit ,which also depends on JGit.

zeapo commented 10 years ago

The issue with the blank screen will soon be solved. For ART runtime... we know that it is jgit that fails. We will probably have to debug it ourselves.

kLeZ commented 10 years ago

Why not open a bug in JGit's issue tracker?

zeapo commented 10 years ago

we should indeed. But we have no usable information yet. We just know that it crashes somewhere with a segfault.

kLeZ commented 10 years ago

Ok, let's split the work. Since I'm the assignee (I had myself assigned ot it) of this bug, I will investigate on it, if you agree. In this way you could try to understand and correct the bug #13. Do you agree on this? I will investigate further by downloading the source of JGit and compiling it inside the app, in order to better debug it. I'll push to jgit_beta in order to not to pollute the master branch ;-)

zeapo commented 10 years ago

Sure, go ahead ☺

sauberfred commented 10 years ago

Don't know if that helps, but here is my logcat output of the crash: https://gist.github.com/sauberfred/d49e2292ac802f216c1a

kLeZ commented 10 years ago

We have a bug request filled, #445462. I saw that they have JGit version 3.6, so I will try to use it.

kLeZ commented 10 years ago

I'm starting to think that it is not a bug in JGit. Seems that it is a bug in the ART runtime itself, because the behavior of this bug changes from device to device. Anyone agrees? For example in my case I can run it with ART runtime without any glitch, it just works. Anybody can confirm this bug still exists?

zeapo commented 10 years ago

Does it happen on ART runtime on non-CM roms?

Sometimes it's cyanogenmod and not the library itself. On Sep 30, 2014 12:49 PM, "Alessandro Accardo" notifications@github.com wrote:

I'm starting to think that it is not a bug in JGit. Seems that it is a bug in the ART runtime itself, because the behavior of this bug changes from device to device. Anyone agrees? For example in my case I can run it with ART runtime without any glitch, it just works. Anybody can confirm this bug still exists?

— Reply to this email directly or view it on GitHub https://github.com/zeapo/Android-Password-Store/issues/4#issuecomment-57296174 .

zeapo commented 10 years ago

ATM I cannot heavily debug things as I just moved in a new house. Once I settle down I will debug it seriously.

If we can contribute to either jgit or cm that would be a great thing. On Sep 30, 2014 1:00 PM, "Mohamed Zenadi" mohamed.zenadi@gmail.com wrote:

Does it happen on ART runtime on non-CM roms?

Sometimes it's cyanogenmod and not the library itself. On Sep 30, 2014 12:49 PM, "Alessandro Accardo" notifications@github.com wrote:

I'm starting to think that it is not a bug in JGit. Seems that it is a bug in the ART runtime itself, because the behavior of this bug changes from device to device. Anyone agrees? For example in my case I can run it with ART runtime without any glitch, it just works. Anybody can confirm this bug still exists?

— Reply to this email directly or view it on GitHub https://github.com/zeapo/Android-Password-Store/issues/4#issuecomment-57296174 .

sauberfred commented 10 years ago

Ja, my original issue is for stock android on the Nexus 5 with the ART runtime.

I just downloaded and tested beta7 and it completely crashed my phone. Will upload the logcat output tonight.

zeapo commented 10 years ago

@sauberfred Sorry for the delay. Can you please try the new apk : https://github.com/zeapo/Android-Password-Store/blob/Material/app/app-release.apk It worked on my device :) This version has a lot of non-fully functional features

zeapo commented 10 years ago

Solved in 9aea6560b0b66285c7c1c47fed828c22514d9e2b