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

Applications are not properly detected when used from within certain types of profiles. #184

Open
3 tasks done
pressRtowin opened this issue Feb 19, 2023 · 5 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@pressRtowin
Copy link

Steps to reproduce

This is a bit of a weird one and I suggest taking a look at these two issues for more context:

I'm not a developer, so frankly, I'm not sure what's causing the behavior I'm about to describe but I've tested it fairly extensively so I'll provide as much information as I can here.

But essentially, I use apps like OpenLinkWith—and since discovering it, URL Checker—for an additional purpose outside their standard use cases. On most flagship Samsung phones and tablets, you're able to have up to 4 copies of the same application installed (though it takes a bit of trickery to get the 4th) by using the main user account, a Work profile, Secure Folder, and Samsung's Dual Messenger feature.

By having a copy of URL Checker installed in each profile, I'm able to send links and open apps between profiles much more easily than usually available. The method varies a bit depending on the profile. It's easy to go between the Secure Folder and Main profiles for instance, as Samsung includes an item in the Share and Open With menus in both profiles that allows access to the other's apps. The work profile is a bit trickier, as Island's work profile has security settings in place that block most "Open with" actions from accessing Work apps, but as "Share" actions don't have this limitation, I can simply use Share & Open as a workaround.

Other than some security differences as mentioned, these two profiles work very much as you'd expect any managed profile on Android to behave. But where things get really weird is the Dual Messenger profile. Firstly, by default, the feature is limited to only allowing certain social media apps to be installed, but it's easy to work around this issue by using ADB to install a package installer like SAI to the Dual Messenger profile, and then using it going forward to install whatever you want.

Once you're able to install whatever you want, you'll notice that some apps just behave a bit weird. These apps very much behave as if the barrier between profiles has been lessened in some way. Unlike the other two profiles, Dual Messenger apps appear in most list of apps you might come across in system settings, mixed in with your main user apps, rather than separated. As mentioned in one of the issues linked above, some activity launcher apps (but not all) end up launching the main user's equivalent activity instead (for some but not all activities), despite using a copy of the activity launcher installed on the Dual Messenger profile—something the copies of the apps in the other two profiles can never do.

In the case of opening and sharing apps like OpenLinkWith and URL Checker, I've found that the list of available applications they display when running the copy of the app installed in the Dual Messenger profile is that of the main user, rather than correctly showing the apps installed to the Dual Messenger profile. This makes it impossible or extremely difficult to send some links to the correct app in the Dual Messenger profile.

I realize this is a very circumstantial issue, and one that depends on using an official One UI feature in a very non-approved way, but it would be quite useful to the few of us who use these programs this way too figure out exactly what makes the Dual Messenger profile so different, and how to get it working as it should.

Let me know if I can clarify anything further here.

Expected behavior

URL Checker, when installed to User 95 (configured via Samsung's Dual Messenger) shows a list of other apps installed to User 95 when using the "Open with" feature (Share uses the system share menu for User 0, but this doesn't matter as User 95's apps are included in this list, as mentioned above).

Actual behavior

URL Checker instead only shows a list of User 0's apps, despite being installed to User 95.

URLCheck version

2.9.1

Android version

13

Android Custom/Specific ROM or Device

One UI

Other details

No response

Acknowledgements

  • I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
  • I have written a short but informative title.
  • I will fill out all of the requested information in this form.
@pressRtowin pressRtowin added the bug Something isn't working label Feb 19, 2023
@TrianguloY
Copy link
Owner

Incredible work both on the research and the explanation!
I checked the linked issues, and it seems it's a common issue, although apparently you can "fix" it sometimes by installing the app as dual itself, or having a proxy to redirect the opening versions.

I'm very interested in a solution, not for this app (well, that too) but for another one of mine, because being able to detect and open a dual version is like the holy grail of Samsung.

I'm not sure if I can be on any help, if there is a way I can try to implement it, and if there is something I can test just explain and I'll do my best. Not sure about how the proxy activity should work, is there any app out there with a solution? That ActivityLauncher seems like it, but with all the ghost messages it was a bit hard to follow the conversation :/

@pressRtowin
Copy link
Author

I checked the linked issues, and it seems it's a common issue, although apparently you can "fix" it sometimes by installing the app as dual itself, or having a proxy to redirect the opening versions.

Yep, that's why I have 4 copies of apps like Share & Open, OpenLinkWith, and URL Checker installed. But while they all work as expected in every other profile, Dual Messenger versions just act as if they were installed in User 0. My best guess is that there's a very specific method that needs to be used to detect other Dual Messenger apps. It may be worth looking at some other apps that don't offer similar functionality, but do correctly list Dual Messenger (and only Dual Messenger) apps when installed in Dual Messenger.

Some of those apps include:

I'm very interested in a solution, not for this app (well, that too) but for another one of mine, because being able to detect and open a dual version is like the holy grail of Samsung.

Hah, it's refreshing to come across someone else familiar with the madness that is user profiles on Samsung. Unrelated but as a dev, any clue why some apps (Google Play, McDonald's) can launch ONCE AND ONLY ONCE in Dual Messenger, and will only crash on subsequent launch attempts, even if you clear app cache and data, until you reboot the phone, which will allow you to launch the app ONCE again?

I'm not sure if I can be on any help, if there is a way I can try to implement it, and if there is something I can test just explain and I'll do my best. Not sure about how the proxy activity should work, is there any app out there with a solution? That ActivityLauncher seems like it, but with all the ghost messages it was a bit hard to follow the conversation :/

Without getting too political, the ghost messages were a back and forth between some contributors/maintainers of forks disagreeing about that app's maintainer's decision to remove Russian support from the app due current geopolitical affairs. So nothing regarding the actual issue.

Unfortunately, Activity Launcher is not able to launch any activity within Dual Messenger from the list of activities I tested there, with the exception of Hide Camera Cutout for some reason(?????). All the other activities either launch within User 0's Settings app, or don't launch at all. However, all the tested activities can be launched as User 95 via ADB, so it's likely there's a way to do it correctly.

Since it is possible via ADB, I have no clue how to actually do so, but based on my understanding, it should be possible to add integration with Shizuku (or just direct wireless debugging integration I guess) and launch Dual Messenger apps that way?

It seems there are two issues at play here:

  1. Identifying which Dual Messenger apps are installed correctly when installed in Dual Messenger (seems like at least solutions exist to this already)
  2. Actually launching those apps (which is where there's a lot of weird behavior going on)

@TrianguloY
Copy link
Owner

I didn't know 1 was already "solved", I'll try to check how those other apps are able to detect dual versions (thanks for the links!)

As for 2, my two cents: apparently when you use Samsung's official share dialog, the dual versions are present because Samsung itself injects them. This seems to be a Samsung specific "feature" not available to other apps.
There is a strange package called "samsung da agent" that apparently works as an official proxy for dual apps (it even had a security issue in the past if I'm not mistaken). I haven't been able to "use" it though, but maybe it is possible.

@pressRtowin
Copy link
Author

pressRtowin commented Feb 19, 2023

I didn't know 1 was already "solved", I'll try to check how those other apps are able to detect dual versions (thanks for the links!)

As for 2, my two cents: apparently when you use Samsung's official share dialog, the dual versions are present because Samsung itself injects them. This seems to be a Samsung specific "feature" not available to other apps. There is a strange package called "samsung da agent" that apparently works as an official proxy for dual apps (it even had a security issue in the past if I'm not mistaken). I haven't been able to "use" it though, but maybe it is possible.

An interesting detail I noticed. Even though Activity Launcher is correctly detecting which apps are installed on Dual Messenger, when it actually loads the application list, it looks like it's loading the incorrect User 0 version for any apps that are also installed on User 0, with the exception of some system apps. As Dual Messenger apps cannot run without the same app being installed on User 0, this happens to be all apps, excluding the aforementioned system apps. The one exception to this is Snapchat, and I'm pretty sure I know why. That's the app I used to initialize the Dual Messenger feature (to get the actual profile set up), meaning I cloned it from the actual official UI. IIRC, apps cloned this way are added to some sort of Dual Messenger "registry" that affects some functions here and there (though I don't recall which). Sideloading apps to Dual Messenger bypasses this process.

On the other hand, Applications Info seems to load all the correct versions of apps.

Interesting info about the Share dialog. I have to wonder why Samsung went so far out of the way to make Dual Messenger not function like other profiles . . .

Side note: I'm not the biggest fan of making something dependent on wireless debugging or Shizuku, as I prefer things not breaking if I have to reboot my phone somewhere I don't have wifi, or if I accidentally turn wireless debugging off 😂

@pressRtowin
Copy link
Author

pressRtowin commented Feb 19, 2023

Image demonstrating what I was talking about in the first part above. Notice the Dual Messenger icons on the applications. Unlike Activity Launcher, Applications Info has the correct symbol on all apps.

Screenshot_20230219_173153_Applications Info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants