deku-messaging / DekuSMS-Android

Android SMS app ~ Featuring E2EE, Cloud Forwarding, RMQ integrations
GNU General Public License v3.0
370 stars 19 forks source link

E2EE: Key exchange fails #213

Closed mathieumd closed 9 months ago

mathieumd commented 9 months ago

Thank you very much for this app! I was desperate to find a replacement for Silence, which is obviously unmaintained.

However, while trying to start encrypted conversation (which I understand is done by clicking on the lock icon, next to the contact name), it fails with a red message.

Screenshot_20240216_130622

Failed, click to retry

If I click to retry, the app seems to restart, and eventually crash.

Looks like #156.

I'm not sure I can/know how to send SMS through data channel, neither if that is desirable. Is there no other way to start an encrypted conversation?

sherlockwisdom commented 9 months ago

The retry feature is truly broken, I will work on fixing it.

To figure out why it keeps failing however, please if possible can you capture and share a logfile with me? The data channels are actually automatic (same protocol as SMS just byte data rather than text) so you don't have to do anything for that. Unless that protocol isn't supported by your service provider (but can best know from seeing some logs).

Also which version of the app are you using?

mathieumd commented 9 months ago

I'm reluctant to share Android bugreport, please understand. But I will happily grep what you need into it!

For example (the problem happened at 12:03 and I retried now at 15:03):

grep -A1 'AndroidRuntime: Process: com.afkanerd.deku' bugreport-*.txt
02-15 18:49:08.918 10260 12510 12510 E AndroidRuntime: Process: com.afkanerd.deku, PID: 12510
02-15 18:49:08.918 10260 12510 12510 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference
--
02-15 18:49:14.777 10260 15714 15714 E AndroidRuntime: Process: com.afkanerd.deku, PID: 15714
02-15 18:49:14.777 10260 15714 15714 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.isEmpty()' on a null object reference
--
02-16 12:04:04.703 10265 12276 12276 E AndroidRuntime: Process: com.afkanerd.deku, PID: 12276
02-16 12:04:04.703 10265 12276 12276 E AndroidRuntime: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.
--
02-16 12:04:08.974 10265 12492 12492 E AndroidRuntime: Process: com.afkanerd.deku, PID: 12492
02-16 12:04:08.974 10265 12492 12492 E AndroidRuntime: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.
--
02-16 12:04:22.007 10265 12545 12545 E AndroidRuntime: Process: com.afkanerd.deku, PID: 12545
02-16 12:04:22.007 10265 12545 12545 E AndroidRuntime: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.
--
02-16 12:04:24.274 10265 12624 12624 E AndroidRuntime: Process: com.afkanerd.deku, PID: 12624
02-16 12:04:24.274 10265 12624 12624 E AndroidRuntime: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long period of time.

grep '02-16 12:03:' bugreport-*.txt  |grep -i deku |grep -w E
02-16 12:03:06.125 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 12:03:06.213 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 12:03:06.253 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 12:03:06.258 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 12:03:14.324 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 12:03:14.327 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 12:03:21.602 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 12:03:21.605 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10

grep '02-16 15:03:' bugreport-*.txt  |grep -i deku |grep -w E
02-16 15:03:23.844 10265 18991 18991 E m.afkanerd.deku: Not starting debugger since process cannot load the jdwp agent.
02-16 15:03:30.295  1000  1932  2198 E ShortcutService: Failed to verity-protect /data/system_ce/0/shortcut_service/packages/com.afkanerd.deku.xml
02-16 15:03:30.295  1000  1932  2198 E ShortcutService: java.io.IOException: Failed to enable fs-verity on /data/system_ce/0/shortcut_service/packages/com.afkanerd.deku.xml: Inappropriate ioctl for device
02-16 15:03:30.137 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
02-16 15:03:30.145 radio  3482  3482 E CarrierPrivilegesTracker: Unable to find uid for package com.afkanerd.deku and user 10
sherlockwisdom commented 9 months ago

I agree with you not to share the full log, what you have captured there is perfect I can use that to try to replicate. I think it's an oversight on my part - look out for 0.41.0 today or tomorrow

mathieumd commented 9 months ago

Thanks @sherlockwisdom!

I'm using 0.40.0 from F-Droid, BTW.

sherlockwisdom commented 9 months ago

please feel free to re-open this if issues persist in 0.41.0. This solves the retry issue, but not sure why you may not able to send data sms - perhaps a configuration from your carrier