• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Themes / Apps / Mods SamSprung Cover Screen Launcher

Search This thread
Just a note for anyone testing portrait apps:

Crashing back to the widget is an issue with the orientation and adjusting the workaround may or may not be a possible fix in the widget.

Crashing back to the clock is an issue with the app itself (or a permission / settings prompt that needs to be accepted) and cannot be fixed in the widget, but may be fixed by configuring the app before attempting to launch it with the widget.
 
Thanks to whoever made the YouTube video. I have been working on improving the initial startup / return loading. It shouldn't require a restart. That is definitely inconvenient. I don't believe it does now, but I will start throwing that into the testing.

The next big feature planned is to try prioritizing apps with notifications. This will likely be second to adding some form of indicator.
 
Last edited:

senergy

Senior Member
Oct 26, 2006
151
17
After much playing with Bixby routines and autoinput I finally got this cool app working.
What are people using this for? i.e. what's the killer use case?
Please don't get me wrong, its awesome, I'm just finding it easier to open the phone.
 
After much playing with Bixby routines and autoinput I finally got this cool app working.
What are people using this for? i.e. what's the killer use case?
Please don't get me wrong, its awesome, I'm just finding it easier to open the phone.

Playing games with auto battle, keeping track of DoorDash delivery updates, and (as mentioned before) checking messages that probably don't require a reply. It might seem easier to open the phone, but it reduces wear and tear on the hinge or leaving the phone folded open to collect all that dirt in the dip.
 
  • Like
Reactions: senergy

luigi90210

Senior Member
Jul 29, 2010
541
93
Samsung Galaxy Z Flip3
Thanks to whoever made the YouTube video. I have been working on improving the initial startup / return loading. It shouldn't require a restart. That is definitely inconvenient. I don't believe it does now, but I will start throwing that into the testing.
I can confirm this bug where the widget doesn't launch apps on the cover screen and I can confirm I found a simpler fix, instead of restarting the phone, just remove the widget and readd it.

I did that and it fixed the widget
 
I can confirm this bug where the widget doesn't launch apps on the cover screen and I can confirm I found a simpler fix, instead of restarting the phone, just remove the widget and readd it.

I did that and it fixed the widget

Apps not launching should only require you to swipe up or down because the widgets don't refresh on the cover screen when opened (possible flaw in the launcher).

The issue was the initial load not displaying any apps.
 

luigi90210

Senior Member
Jul 29, 2010
541
93
Samsung Galaxy Z Flip3
Apps not launching should only require you to swipe up or down because the widgets don't refresh on the cover screen when opened (possible flaw in the launcher).

The issue was the initial load not displaying any apps.
The issue I am running into is the app will not launch the apps on the cover screen at all but instead will have the app launched when swiped up on the lock screen however the behavior continues even when the lockscreen is disabled all together. The only way I have been fixing it is by restarting my phone however I found adding and removing the widget has worked to fix those issues.

I'm not 100% sure how to recreate the bug but it happened when I was trying to watch local movies using vlc player, if it happens again I'll get a logcat
 
I've taken a minute to update the documentation and explain which limitations are being imposed on the widget and "why" they are limitations. It seems there is some traffic to the project coming from other sites that may not be aware these are not choices being made. From Github:

... i fint it highly annoying thqt you have to delete samsung health and turn off all lockscreens it would be easier if you could still use samsprung with lockscreen biometrics but to open any app using the widget you just have to tap your finger/thumb on the side mounted finger print scanner and then it will open on the cover display

We also have at least one developer from Samsung tracking the project, so my hope is that clearly citing the limitations and why they are too restrictive has some impact on future firmware updates.

The issue I am running into is the app will not launch the apps on the cover screen at all but instead will have the app launched when swiped up on the lock screen however the behavior continues even when the lockscreen is disabled all together. The only way I have been fixing it is by restarting my phone however I found adding and removing the widget has worked to fix those issues.

I'm not 100% sure how to recreate the bug but it happened when I was trying to watch local movies using vlc player, if it happens again I'll get a logcat

It sounds like your issue has to do with the requirements for the widget to work. If you have a lockscreen enabled, you need a way to dismiss it from the cover. This can be either using "none" or "swipe" and letting the widget handle it or using one of the password / pin / fingerprint options with Bixby unlock to bypass the interaction. The widget cannot override individual app restrictions for displaying on top of the lockscreen and even if it could, doing so would open a huge security risk for exploiting it.
 
Last edited:

ChrisChoi314

Member
Oct 3, 2021
9
0
Widgets on the cover screen are granted Settings.canDrawOverlays without the need for permission approval from the user?

With the option off in the app settings, the app never requested the permission and instead simply verified that it was already granted. That is interesting...

and now the big news:

Portrait apps may now be fully functional, if my testing is correct.


The permission approval button when launching the app from the drawer shouldn't be required, but it exists in case it will help with any finicky apps / devices. It will request system settings and overlay permissions.

System settings permission will allow the widget to temporarily disable the automatic rotation option, while the overlay permission creates a fake view over the widget that is locked in portrait and steals focus from the widget to avoid it forcing the layout back to landscape. This will not, however, prevent apps with landscape support from functioning normally.

A new caveat I found is that, when charging, tapping power and waiting won't exit the current app. I do not intend to address this right now. The reason being that the controls to have the power button return to the widget also force a screen timeout to return to the widget and can cause issues with the app being displayed when opening the phone.

A quick and dirty workaround to change apps when charging is to simply open the phone a bit. This will reset the widget without breaking the expected functionality.

As it stands, the power button and a timeout will not kill the current app unless they exceed two seconds and will not kill the app at all when charging. This allows long-term use of a single app, which fits most use cases. Other options to switch apps, such as volume button overrides, are also being explored.

@ChrisChoi314 it appears your list of incompatible apps was lost in the cleanup. If you still find any, you can post the list on the issue for it.

Ok I just downloaded the new version and disabled the auto rotate on multistar from good lock to see if it would work as intended. i actually managed to get it not working after trying a couple of portrait apps. i tried tiktok and snapchat and paypal to see if it would remove the samsprung widget and limit it to 3, and it did. I apologise if that is really frustrating news, and that this was pretty late. i didnt have time to check this thread until now

BTW, is there a better way to update this app to be on the newest version? do i just download the apk from the github page ever so often?
 
Last edited:
Ok I just downloaded the new version and disabled the auto rotate on multistar from good lock to see if it would work as intended. i actually managed to get it not working after trying a couple of portrait apps. i tried tiktok and snapchat and paypal to see if it would remove the samsprung widget and limit it to 3, and it did. I apologise if that is really frustrating news, and that this was pretty late. i didnt have time to check this thread until now

BTW, is there a better way to update this app to be on the newest version? do i just download the apk from the github page ever so often?

For now. Update notifications will come when there are less frequent updates.
 
Added a quick and dirty update feature. Going forward, opening the app itself will pop onto Github to the latest release if it is newer than the one currently installed.

I still haven't decided whether or not the full automated self-updating feature will make it from my other apps. It's a lot of overhead for what is supposed to be a small widget.
 

Bryanpen77

Member
Dec 4, 2020
14
12
Hey just a quick suggestion. There is another front screen widget that opens websites called SubUI browser. It works without removing any locks and doesn't crash. But it's also kinda scary that you can use the browser on the outer screen all while the phone is locked. I wonder if the person who made SubUI browser is here. I am sure he could shed light on how he got the widget working without removing the locks
 
  • Angry
Reactions: ChrisChoi314
Hey just a quick suggestion. There is another front screen widget that opens websites called SubUI browser. It works without removing any locks and doesn't crash. But it's also kinda scary that you can use the browser on the outer screen all while the phone is locked. I wonder if the person who made SubUI browser is here. I am sure he could shed light on how he got the widget working without removing the locks

I hope you meant that as a joke.

The browser works because it is self-contained. It's all explained in quite a bit of detail throughout this thread and the one for the browser.
 

Attachments

  • Screen Shot 2021-10-11 at 10.44.13 PM.png
    Screen Shot 2021-10-11 at 10.44.13 PM.png
    34.5 KB · Views: 30
Last edited:
  • Like
Reactions: ChrisChoi314
Code:
        try {
            val applicationInfo: ApplicationInfo = packageManager.getApplicationInfo (
                launchPackage, PackageManager.GET_META_DATA
            )
            applicationInfo.metaData.putString(
                "com.samsung.android.activity.showWhenLocked", "true"
            )
        } catch (e: PackageManager.NameNotFoundException) {
            e.printStackTrace()
        }

If it were only possible for one app to inject meta data into another without root, this would be the end of workarounds.
 

Bryanpen77

Member
Dec 4, 2020
14
12
I hope you meant that as a joke.

The browser works because it is self-contained. It's all explained in quite a bit of detail throughout this thread and the one for the browser

I hope you meant that as a joke.

The browser works because it is self-contained. It's all explained in quite a bit of detail throughout this thread and the one for the browser.
Didn't mean any offense. Just thinking if someone knew this was on my phone they could just swipe over and browse into whatever site I am using. But I do love the extra functionality with the second screen.
 

luigi90210

Senior Member
Jul 29, 2010
541
93
Samsung Galaxy Z Flip3
It sounds like your issue has to do with the requirements for the widget to work. If you have a lockscreen enabled, you need a way to dismiss it from the cover. This can be either using "none" or "swipe" and letting the widget handle it or using one of the password / pin / fingerprint options with Bixby unlock to bypass the interaction. The widget cannot override individual app restrictions for displaying on top of the lockscreen and even if it could, doing so would open a huge security risk for exploiting it.
Except I'm using swipe or no lock screen(both supported configs according to your OP) and the bug is occuring

Sounds like you should relearn how to read instead of blaming the user for reporting a bug with your app because I clearly stated that I disabled the lockscreen entirely and still couldn't launch apps without either restarting the phone or removing the widget and enabling it again

It's not my job to bug report for you, I'm doing you a favor by telling you about it, don't be rude and blame me for experiencing a bug you wrote into the code...
 
  • Angry
Reactions: ChrisChoi314
Except I'm using swipe or no lock screen(both supported configs according to your OP) and the bug is occuring

Sounds like you should relearn how to read instead of blaming the user for reporting a bug with your app because I clearly stated that I disabled the lockscreen entirely and still couldn't launch apps without either restarting the phone or removing the widget and enabling it again

It's not my job to bug report for you, I'm doing you a favor by telling you about it, don't be rude and blame me for experiencing a bug you wrote into the code...

I'm trying to understand your issue to fix it. I'm not obligated to release free software or provide you with any support at all. If you choose not to report a bug and you're the only one that appears to be facing it, how much are you hurting anyone else?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    thank you how can i share a log with you so you can help me troubleshoot

    When you launch the app from the drawer, it's the button that has Logcat in the text.
    1
    It saves the file to /sdcard/Android/data/ in the app directory

    It saves the file to /sdcard/Android/data/ in the app directory
    Thank you sent LOGCAT TXT you requested to your email '[email protected]' hope you can figure it out
    1
    Could you email them to [email protected] as well, thanks - TwistedUmbrella is the creator of the SamSprung app, while I found the original trick to load custom widgets on the cover screen so I know quite well where the various components of the cover screen system are in these apps. If I can find out another way around the block, I'll open a pull request in TwistedUmbrella's repo for the app with a fix. Thanks again for your help!
    1
    I appreciate what you did, but let's not go implying that being first and being the only one capable of doing it are the same thing.
    I didn't mean it that way at all, I was just clarifying that I was a different person and so was asking for the files to be sent to a different email address... As I said in the previous comment, I've spent a long time picking these apps apart to work out exactly how the whole cover screen system works, so I thought I could help by trying to find out exactly what's changed.
    1
    Any luck on getting it to work again on one ui4.0 on z flip 3?

    It's not something that would be kept secret.
  • 10
    In all fairness, I don't think i've explained why the limitations are what they are and should probably have done that a while ago.

    The cover screen is effectively like plugging in a second screen on a previous S or Note series phone. DeX is effectively a secondary home launcher. Since this screen is part of the phone, instead of connected by a cable, a second launcher is used instead of DeX.

    The outer screen supports a second launcher, such as Nova or Smart Launcher 5. It also supports a primary launcher having a secondary launcher activity. Samsung, on the other hand, has disabled this support in favor of a hardcoded launcher that's built into the firmware.

    Samsung's launcher has been broken into the home screen, which is the clock selection, and widget pages. It's been further limited by only allowing certain widgets to be available on the widget pages.

    Being a system app signed by Samsung, they've gone a step further. The widgets allowed must system apps or signed by Samsung, as well. One loophole exists, which is Samsung Health. It does not need to be a system app, since you can install it from Google Play. It also doesn't need to be signed by Samsung for whatever reason. It does, however, still need to match up with the expected widget inside the expected app.

    This app takes advantage of the loopholes by using the specific component name (package / package.activity) of the Samsung Health widget and the package for Samsung Health. Because of this, the app must also be a widget, though. It cannot be a full launcher.

    Widget functionality is limited, but can support launching apps. This is another loophole that uses the widget list support to act as a fake launcher. Since the core launcher behind the widgets is still a launcher, it will launch apps on the cover screen.

    Like a normal Android screen, configuration changes are handled by the current activity being displayed. In this case, that would be whatever app is launched. The widget gets taken along for the ride. To minimize the impact of the launched app, the widget is designed to ignore any configuration changes, which would usually trigger the list to refresh.

    A few unique problems exist because of the cover screen being composed of widgets. One is that they do not follow the expected life cycle of a widget. They are not refreshed when they appear, which is why a swipe is sometimes needed to make list items clickable. Another is that they cannot perform any of the prep an activity provides, such as handling the lock screen. When an activity requests overriding the lock screen, it only extends to the activity and not to any it launched.

    This leaves us with what you see. A widget that exploits a bunch of loopholes within the limitations of the widget framework.
    9
    ic_widget_preview.png


    This is a WIP launcher for the cover screen that allows you to run apps without opening the phone.

    This is primarily useful for checking recent messages, running background tasks, or performing actions that do not require a keyboard or the full screen.

    Current limitations:
    • Apps require Screen lock type set to None / Swipe in Settings -> Lock screen
      • Bixby unlock can be used as a workaround for other lock types
    • Keyboards will not open on the cover screen and some app functionality is limited
      • Firmware limitation by Samsung - Secondary IME support is disabled
    • Switching apps requires tapping power and waiting for at least two seconds to close the app before launching the widget again (turn on cover, swipe to widget). The app list, however, can be swiped closed.

    • Samsung Health must be uninstalled to free up the package name for the whitelisted widgets. Installing this app will then add it as an option in the cover screen widgets.
      • Firmware limitation by Samsung - Widget package name or signature




    This app replaces Samsung Health and will not work with any other app that requires uninstalling Samsung Health. One UI 4.0 (beta X) disabled this workaround.​


    Thanks @CarudiBu for discovering the workaround to load a custom widget.
    5
    Done. Now you can hide / unhide apps for the widget with a long press on the item (in the app settings).
    5
    Widgets on the cover screen are granted Settings.canDrawOverlays without the need for permission approval from the user?

    With the option off in the app settings, the app never requested the permission and instead simply verified that it was already granted. That is interesting...

    and now the big news:

    Portrait apps may now be fully functional, if my testing is correct.


    The permission approval button when launching the app from the drawer shouldn't be required, but it exists in case it will help with any finicky apps / devices. It will request system settings and overlay permissions.

    System settings permission will allow the widget to temporarily disable the automatic rotation option, while the overlay permission creates a fake view over the widget that is locked in portrait and steals focus from the widget to avoid it forcing the layout back to landscape. This will not, however, prevent apps with landscape support from functioning normally.

    A new caveat I found is that, when charging, tapping power and waiting won't exit the current app. I do not intend to address this right now. The reason being that the controls to have the power button return to the widget also force a screen timeout to return to the widget and can cause issues with the app being displayed when opening the phone.

    A quick and dirty workaround to change apps when charging is to simply open the phone a bit. This will reset the widget without breaking the expected functionality.

    As it stands, the power button and a timeout will not kill the current app unless they exceed two seconds and will not kill the app at all when charging. This allows long-term use of a single app, which fits most use cases. Other options to switch apps, such as volume button overrides, are also being explored.

    @ChrisChoi314 it appears your list of incompatible apps was lost in the cleanup. If you still find any, you can post the list on the issue for it.

    3
    Also done. Now the switches work as they were intended and long press is no longer used.