Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SFTP Open File crashes app #2263

Closed
hyproman opened this issue Mar 8, 2023 · 15 comments
Closed

SFTP Open File crashes app #2263

hyproman opened this issue Mar 8, 2023 · 15 comments

Comments

@hyproman
Copy link
Contributor

hyproman commented Mar 8, 2023

The app crashes after tapping Okay on the SFTP Open File dialog box.

Version: 1.09e-r3

Steps to reproduce:

  1. From main/initial panel, tap Open File
  2. Tap SFTP
  3. Fill out connection details
  4. Tap OK

Expected: The file chooser panel should be displayed
Actual: The main panel is displayed

logcat shows the app crashes due to target SDK compatibility issues:

D KP2A_FC : getLaunchFileChooserIntent
E keepass2android: Invalid ID 0x00000000.
...
D KP2A_FC_P: lastPathSegment:check_connection
D KP2A_FC_P: Check connection...
E ImeBackDispatcher: Ime callback not found. Ignoring unregisterReceivedCallback. callbackId: 9661337
E AndroidRuntime: FATAL EXCEPTION: Thread-4
E AndroidRuntime: Process: keepass2android.keepass2android, PID: 7547

E AndroidRuntime: java.lang.IllegalArgumentException: keepass2android.keepass2android: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E AndroidRuntime: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
E AndroidRuntime:        at android.app.PendingIntent.checkFlags(PendingIntent.java:404)
E AndroidRuntime:        at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:487)
E AndroidRuntime:        at android.app.PendingIntent.getActivity(PendingIntent.java:473)
E AndroidRuntime:        at android.app.PendingIntent.getActivity(PendingIntent.java:437)
E AndroidRuntime:        at keepass2android.javafilestorage.SftpUserInfo$1.run(SftpUserInfo.java:54)
@hyproman
Copy link
Contributor Author

hyproman commented Mar 8, 2023

Well I'm officially confused...

This is a duplicate of bug #2223, which I fixed in #2234. It was merged into the mainline well before v1.09e-r3 was released. I just checked out the v1.09e-r3 tag and the fix is there. I just built and installed the (Net) debug APK and confirmed it does not crash.

It would seem the v1.09e-r3 git tag does not reflect the v1.09e-r3 release APKs?

@PhilippC
Copy link
Owner

PhilippC commented Mar 9, 2023

I checked this and it is indeed confusing. I found one mistake: I forgot to commit & push the modified Manifest files (increasing version code & number) and strings.xml (for the changelog) and then tagged the wrong commit (because I did not notice I had uncommited changes). I fixed this, but this does not explain what you saw.

In my local repository, your change is present, and the .aar files for JavaFileStorage have been built 2 hours before I built the final apk which makes me assume that the fix should correctly be present.

I will upload a new release shortly and will make sure to make clean before building.

@PhilippC
Copy link
Owner

PhilippC commented Mar 9, 2023

I published 1.09e-r4 - can you check if it the crash is gone there?

@hyproman
Copy link
Contributor Author

hyproman commented Mar 9, 2023

Sadly 1.09e-r4 has the same issue. The line number in the crash indicates that commit isn't included for some reason. I also checked out the 1.09e-r4 tag and the commit is included there. Weird.

03-09 15:47:17.124  2223  3344 E AndroidRuntime: FATAL EXCEPTION: Thread-7
03-09 15:47:17.124  2223  3344 E AndroidRuntime: Process: keepass2android.keepass2android, PID: 2223
03-09 15:47:17.124  2223  3344 E AndroidRuntime: java.lang.IllegalArgumentException: keepass2android.keepass2android: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
03-09 15:47:17.124  2223  3344 E AndroidRuntime: Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
03-09 15:47:17.124  2223  3344 E AndroidRuntime:        at android.app.PendingIntent.checkFlags(PendingIntent.java:404)
03-09 15:47:17.124  2223  3344 E AndroidRuntime:        at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:487)
03-09 15:47:17.124  2223  3344 E AndroidRuntime:        at android.app.PendingIntent.getActivity(PendingIntent.java:473)
03-09 15:47:17.124  2223  3344 E AndroidRuntime:        at android.app.PendingIntent.getActivity(PendingIntent.java:437)
03-09 15:47:17.124  2223  3344 E AndroidRuntime:        at keepass2android.javafilestorage.SftpUserInfo$1.run(SftpUserInfo.java:54)
03-09 15:47:17.171  2223  2223 D KP2A    : onAR

Screenshot_20230309-154619_Keepass2Android

@PhilippC
Copy link
Owner

PhilippC commented Mar 10, 2023 via email

@hyproman
Copy link
Contributor Author

@PhilippC I just emailed you SFTP test account details. When I have a few minutes I'll try out the build artifact and report back.

@hyproman
Copy link
Contributor Author

The latest artifact build for tag 1.09e-r4 (Net) does work.

However the (Net) apk on the v1.09e-r4 Release page crashes

@PhilippC
Copy link
Owner

lesson learned: make clear && make Configuration=Release Flavor=Net is not a good idea, if build-properties.props set Flavor=NoNet. I need to run make clear Flavor=Net && make Configuration=Release Flavor=Net then.

@hyproman
Copy link
Contributor Author

Oh weird. I guess I've been doing that by default (by accident), but I also would have guessed make clean would clear out everything. Glad you figured it out.

@PhilippC
Copy link
Owner

please verify this is fixed in https://github.com/PhilippC/keepass2android/releases/tag/v1.09e-r5. When I just wanted to test again, I wasn't able to reach your server , but in previous tests it seemed to be fine.

@hyproman
Copy link
Contributor Author

I wish I had better news to report.

I just downloaded and clean installed v1.09-r5 (net) from your link above and it still crashes trying to connect to the SFTP server. Exact same stack trace as before, including line numbers (that do not line up to SftpUserInfo.java in source). Actually did it three times to convince myself that I'm not crazy. Worth noting that the About panel does show v1.09-r5.

If I check out v1.09e-r5 tag and clean build using make Flavor=Net Configuration=Release and install/use the signed Release APK, it does not crash. Similarly, clean building without Configuration=Release and installing/using the signed Debug APK does not crash.

It still feels to me like somehow the java bits aren't being cleanly built? That's the only way I can see that the version number would be up-to-date but the Java code be behind.

As for the test server, it looks like my ISP blocked your most-recent connection attempt, citing "IP Reputation"; I guess they think your address is suspicious. I don't have any control over what they are doing there (wish I did). I'll keep it up and running but also will look for a better alternative.

@PhilippC
Copy link
Owner

Now I'm fully confused. I just tested again and this time was able to connect. I uninstalled and reinstalled from https://github.com/PhilippC/keepass2android/releases/tag/v1.09e-r5 and it still worked.

PhilippC added a commit that referenced this issue Mar 20, 2023
…d a new release based on this clean to see if it helps with #2263.
@PhilippC
Copy link
Owner

@aeongdesu
Copy link

aeongdesu commented Mar 20, 2023

Can you try with v1.09e-r5b (release)?

@PhilippC it worked for me! I'm using SM-P615N and android version is 13.

@hyproman
Copy link
Contributor Author

Yes! Success with v1.09e-r5b!!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants