Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Won't open in Samsung DeX mode #245

Closed
yodarunamok opened this issue Mar 29, 2019 · 26 comments · Fixed by #1114
Closed

Won't open in Samsung DeX mode #245

yodarunamok opened this issue Mar 29, 2019 · 26 comments · Fixed by #1114

Comments

@yodarunamok
Copy link

When attempting to open in on a Samsung Note 9 under DeX I see the error: "KeePass DX can't run in Samsung DeX..." It runs just fine in phone mode, just not in Samsung's desktop experience. Samsung provides some relevant information here.

@J-Jamet
Copy link
Member

J-Jamet commented Apr 12, 2019

I don't know what Samsung DeX is, and I do not have a device to test, I will document.

@chris5a
Copy link

chris5a commented Dec 4, 2019

I am looking for Samsung DeX integration as well. It would be a great feature to have.
FYI - https://www.samsung.com/global/galaxy/apps/samsung-dex/
It acts like an Android OS when you plug your phone into a monitor instead of just mirroring the phones display.

@goodevilgenius
Copy link

@J-Jamet There are two main requirements, as detailed in the link in the issue:

It has to be resizable:

<application android:resizeableActivity="true">
  <activity ... />
</application>

It must work with a mouse and keyboard:

<uses-configuration  android:reqTouchScreen="finger" />

<uses-feature  android:name="android.hardware.touchscreen"  android:required="true" />

Even without a Samsung device to test, you can test that it's resizable and works with a mouse and keyboard on just about any recent device.

@Chugi-vu
Copy link

Way to launch  KeePass DX in Samsung DEX mode
In DEX mode:

1/ Go to setting

2/ Tap on "Samsung Dex"

3/ Tap on "About Samsung Dex"

4/ Tap 5 times on "Samsung Dex Version"

5/ Reboot DEX Mode

6/ In DEX Mode go to setting and tap "Samsung Dex"

7/ Tap "Samsung LABS"

8/ Enable checkbox "Force Resize"

Screenshot_20200129-205641_KeePass DX

@alexanderadam
Copy link

alexanderadam commented Jul 22, 2020

There must be a way to get this working without going into developer mode.

@J-Jamet did you add

<uses-configuration  android:reqTouchScreen="finger" />

<uses-feature  android:name="android.hardware.touchscreen"  android:required="true" />

like mentioned above?
I'm currently using a Samsung S6 Tablet (a recent device) and I have the feeling that the app definition could be the reason for not running in DeX.

Otherwise you can check things in the Samsung DeX documentation and I will test your builds, if you want.

PS: Can you please reopen this issue?
PPS: As usual I hereby want to take the chance and thank you for your work! KeePassDX is still awesome!

@J-Jamet
Copy link
Member

J-Jamet commented Jul 22, 2020

@J-Jamet did you add

<uses-configuration  android:reqTouchScreen="finger" />
<uses-feature  android:name="android.hardware.touchscreen"  android:required="true" />

like mentioned above?

No no, I had verified that this code was not present.

You have to test with real compatible devices. For the moment I don't have one so I will leave it to the people concerned for now. ;)

@alexanderadam
Copy link

alexanderadam commented Jul 22, 2020

I have three different compatible devices available. So I can test any of your builds.

Maybe you can also try the Samsung Tab S4 in the Remote Test Lab. But I don't know how good this works.

@J-Jamet
Copy link
Member

J-Jamet commented Jul 22, 2020

I tried, it works but a lot of options are locked in the device and I cannot launch DeX mode with this method.
Otherwise you can change the parameters in the code and compile KeePassDX to improve what you want! ;)

@alexanderadam
Copy link

alexanderadam commented Jul 22, 2020

Otherwise you can change the parameters in the code and compile KeePassDX to improve what you want!

Sure thing.
Is there a Docker container that includes the build chain that I need for creating an apk for KeePassDX?
I'm obviously not a mobile dev so I obviously would prefer a container image that I can cleanly remove afterwards.

And is there any documentation how to build it in general? The FAQ and the README doesn't seem to include anything build related and the repository doesn't seem to have any doc or documentation directory.
So can you please point me to the build instructions?

Also I'm not sure whether this is helping but Samsung also has an App Testing Guide for windowed / DeX applications.

@J-Jamet
Copy link
Member

J-Jamet commented Jul 22, 2020

No there is no docker. For the build, the easiest is to use Android Studio as an IDE, it allows you to build easily.
Otherwise I'll look to get a DeX compatible device, which model would you advise me? (just for testing) one with the smallest memory.

@J-Jamet
Copy link
Member

J-Jamet commented Jul 22, 2020

Also I'm not sure whether this is helping but Samsung also has an App Testing Guide for windowed / DeX applications.

I have already tested with this method and have no problem, that's why I closed this issue.

@alexanderadam
Copy link

alexanderadam commented Jul 22, 2020

For the build, the easiest is to use Android Studio as an IDE, it allows you to build easily.

It seems that there are a few images and Dockerfiles with Android Studio. I will try a few of them in the following days and hopefully I will manage to build a apk.

Just to be sure:

the lines

<uses-configuration  android:reqTouchScreen="finger" />
<uses-feature  android:name="android.hardware.touchscreen"  android:required="true" />

have to be inserted into the AndroidManifest.xml, right?

I'll look to get a DeX compatible device, which model would you advise me? (just for testing) one with the smallest memory.

According to Samsung "All flagship models released after Galaxy S8/S8+" should support DeX. Including the Galaxy S9, S10, S20, Note8, Note9 and Note10 series and Galaxy A90 5G As well as the Galaxy Tab S4, S5e and Tab S6.

I'm not sure which of them has the smallest memory (you mean RAM, right?), though. But I believe all of them have at least 4 GB of RAM.

EDIT: It seems that 1Password also had this issue once, but was able to solve it in June, last year. I asked for a hint on Twitter.
In the case of 1Password the reason was the Input Method Service / Soft Keyboard.
But they didn't tell how they solved the issue with the Input Method Service.

PS: I found another app (KDE connect) with the same error message.

@alexanderadam
Copy link

@J-Jamet do you know whether there's any possibility to check what 1Password might have changed to fix the Input Method Service bug on Samsung Dex and maybe apply this on KeePass DX as well?

@J-Jamet
Copy link
Member

J-Jamet commented Oct 2, 2020

Just to be sure: the lines have to be inserted into the AndroidManifest.xml, right?

No, it is clearly indicated:

"Do not explicitly declare the touchscreen support as it may disable the mouse and the keyboard interactions. This explicit declaration is shown in the code below."

do you know whether there's any possibility to check what 1Password might have changed to fix the Input Method Service bug on Samsung Dex and maybe apply this on KeePass DX as well?

Unfortunately no I can't, I don't have Samsung device and 1Password is not open source so I can't see the code to study how it works.

@nathaneltitane
Copy link

I'm adding my two cents to this bug thread as Ihave made the transition to keepass after a massive breach report - i am very happy with the application and as someone who uses their Note 10+ as their main and only computer (dev, programming and design) I would greatly appreciate if the application would support being launched on Dex, even if it keeps its phone size and format.

Unfortunately, the Dex xlabs 'force resize' has no effect as of this latest Android/Dex version and makes using the wallet impractical for applications that do not have attributes or triggers for the autofill.

As a reference, and I do not know if this can help, but here is the official reference lin in making applications Dex compatible without too much change in their code

Thank you

@alexanderadam
Copy link

alexanderadam commented Oct 30, 2020

I set the whole Android environment up (Studio, SDK, loading a huge load of dependencies, running into various issues). But I finally did it.

Now I can create a build that's starting on an Android Desktop environment (like Samsung DeX), by following the mentioned hint and removing android:permission="android.permission.BIND_INPUT_METHOD" from the service MagikIME.

But I don't know how it's possible to build a workaround by that information, since I have no experience with Android development (maybe someone at the Samsung forum knows what to do).

But at least I have a working installation now for Samsung DeX 🎉

@J-Jamet
Copy link
Member

J-Jamet commented Oct 30, 2020

Thank you @alexanderadam for your detailed comment.
Now that the problem has been highlighted, a way must be found to remedy it, but it's problematic because this permission is necessary for the use of the Mgikeyboard. I will see if it is possible to remove this feature only for Samsungs in DEX mode, but we have to know how to filter them in the manifest, I don't know if it's possible.

@alexanderadam
Copy link

Now I got an official answer from Samsung support (Jakia.Sultana):

3rd-party keyboard is not allowed in Samsung DeX, so following permission will block the app in DeX.

android:permission="android.permission.BIND_INPUT_METHOD"

@J-Jamet
Copy link
Member

J-Jamet commented Mar 29, 2021

Since the problem comes from the Magikeyboard permission, I thought I could make a separate bundle as it will become mandatory soon. The idea would be to download only the Magikeyboard if you need it and not to download it if you are on Samsung. But I still have to study the feasibility, maybe the manifest can't be changed anyway.

@J-Jamet
Copy link
Member

J-Jamet commented Mar 29, 2021

I also read that enabling developer options on Samsung DeX could make it work but I don't know if it's true. If someone can test it would be nice.

@alexanderadam
Copy link

alexanderadam commented Apr 2, 2021

Since the problem comes from the Magikeyboard permission, I thought I could make a separate bundle as it will become mandatory soon. The idea would be to download only the Magikeyboard if you need it and not to download it if you are on Samsung.

I have no experience with Android development or Android bundles but Samsung devices can switch between DeX/Desktop mode and 'regular' mode.
So your mobile phone could be in regular mode all the time. Then you are connecting to a monitor via WiFi or USB-C and then you are using DeX mode.
So it's not per device in general but per current state.

In regular mode KeePassDX is working. So it's like switching to another desktop environment on GNU/Linux or *BSD (in case you are aware of this concept).

Is the concept of bundles allowing to switch a bundle per run?

PS: Thank you so much for delivering such a great FOSS experience. KeePassDX is a wonderful app that I happily recommend and it's great that you care, maintain and give feedback. 🙏 The only two issues that I have personally with KeePassDX are this DeX issue and the search issue. This is probably a very good quota. 😉

@alexanderadam
Copy link

Wow, nice! I'm looking forward to test it once it is available in an F-Droid release! 🤩

Thank you so much @chenxiaolong!

@J-Jamet
Copy link
Member

J-Jamet commented May 21, 2022

A user just told me that Samsung DEX was not working with version 3.4.4. I can't test, so can you tell me if this is the case or just a bad configuration?

@J-Jamet J-Jamet reopened this May 21, 2022
@chenxiaolong
Copy link
Contributor

Sure, I can give it a try today and debug if needed.

@chenxiaolong
Copy link
Contributor

I built the 3.4.4 tag from source (with a different package name so I have a fresh configuration) and I'm not encountering any issues in DeX.

The same limitation from before still applies though: KeePassDX must be run once outside of DeX mode before it will work inside DeX. The Android framework will not allow the DexModeReceiver broadcast receiver to run unless the app successfully launches once. I think it might be worth having the user try this.

(Would it be worth adding a FAQ entry for this? Running once outside of DeX is required after initial installation, force stop, or clearing data.)

@J-Jamet
Copy link
Member

J-Jamet commented May 23, 2022

Thank you for checking so quickly, it is much appreciated.

Modified FAQ: https://github.com/Kunzisoft/KeePassDX/wiki/FAQ#why-doesnt-the-samsung-dex-mode-work-immediately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants