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

Get icon of installed apps on WebOS TV LG kotlin #412

Open
kun510 opened this issue Mar 29, 2024 · 37 comments
Open

Get icon of installed apps on WebOS TV LG kotlin #412

kun510 opened this issue Mar 29, 2024 · 37 comments

Comments

@kun510
Copy link

kun510 commented Mar 29, 2024

I'm making a sample about remote on LG TV using webOS with ConnectSDK. I can remote with some basic command, get the list of installed apps on the TV. The data of each item like this:
{"defaultWindowType":"card","requiredPermissions":["all"],"allowWidget":false,"uiRevision":1,"CPApp":false,"systemApp":true,"version":"1.0.0","enableBackgroundRun":true,"vendor":"LG Electronics, Inc.","enableCBSPolicy":false,"hasPromotion":false,"class":{"hidden":true},"tileSize":"normal","icon":"https://192.168.5.253:3001/resources/222fe81584d0dda9a0b9b7951e9206581c1409d9/AirPlay_Icon-77x77.png","lockable":true,"privilegedJail":false,"useCORSWhitelist":"cors_whitelist.json","checkUpdateOnLaunch":true,"transparent":true,"handlesRelaunch":false,"spinnerOnLaunch":true,"id":"airplay","unmovable":false,"inspectable":false,"mediaExtension":{"mse":{"enableSourceBufferFlush":true,"maxVideoSourceBuffer":150,"disableVideoIntrinsicSize":true,"enableServerSideTrick":true}},"inAppSetting":false,"trustLevel":"trusted","mediumLargeIcon":"AirPlay_Icon-115x115.png","title":"AirPlay","deeplinkingParams":"{"contentTarget" : "$CONTENTID"}","noSplashOnLaunch":true,"visible":false,"accessibility":{"supportsAudioGuidance":true},"folderPath":"/usr/palm/applications/airplay","networkStableTimeout":0,"main":"launch.html","removable":false,"type":"web","disableBackHistoryAPI":true,"installTime":0}
2024-03-29 13:57:47.123 9057-9057

With above data, I have url of icon: https://192.168.5.253:3001//resources//222fe81584d0dda9a0b9b7951e9206581c1409d9//AirPlay_Icon-77x77.png
But I can't get icon from this url
I can't find any document about this.
Can anyone help me?
Thanks a lot

@kun510 kun510 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
@kun510 kun510 reopened this Mar 29, 2024
@kun510 kun510 closed this as completed Mar 29, 2024
@kun510 kun510 reopened this Mar 29, 2024
@MuhammadAsad786
Copy link

any fix this issue about loading app icon in LG (webOs
)

@kun510
Copy link
Author

kun510 commented Apr 30, 2024

any fix this issue about loading app icon in LG (webOs )

What do you need, I fixed that

@MuhammadAsad786
Copy link

any fix this issue about loading app icon in LG (webOs )

What do you need, I fixed that

which url you to load for image , i use
https://ip:port/query/icon/appid
this link is working fine on Roku service but no working on WebOs service

@kun510
Copy link
Author

kun510 commented Apr 30, 2024

I changed the link of get Icon to ssap://com.webos.applicationManager/listLaunchPoints

@MuhammadAsad786
Copy link

MuhammadAsad786 commented Apr 30, 2024

I changed the link of get Icon to ssap://com.webos.applicationManager/listLaunchPoints

Can you provide me proper link
Because i think ssap not load from glide

@kun510
Copy link
Author

kun510 commented Apr 30, 2024

I have displayed it by passing the icon to the link ssap://com.webos.applicationManager/listLaunchPoints
Then I processed it using glide

@MuhammadAsad786
Copy link

I have displayed it by passing the icon to the link ssap://com.webos.applicationManager/listLaunchPoints
Then I processed it using glide

Ssap://com.webos.applicationManaget/appid

This link Right?

@kun510
Copy link
Author

kun510 commented Apr 30, 2024

I get the API from the link
ssap://com.webos.applicationManager/listLaunchPoints then I get the data and get the display icon from iconLink in ssap's Api json

@MuhammadAsad786
Copy link

when i get the applist throught launcher.getapplist(). this method give me list of apps. In applist i have id, name , raw variable ,

so how to create a url for app icon with these variable

@kun510
Copy link
Author

kun510 commented May 1, 2024

In raw there is data
{"defaultWindowType":"card","appsize":4696313,"CPAp":false,"systemApp":false,"version":"5.0.1","enableCBSPolicy":false,"vendor":"YuppTV" ,"hasPromotion":false,"tileSize":"normal","extraLargeIcon":"26145206897846570_16999277_192x192.png","largeIcon":"largeIcon.png","lockable":true,"transparent":false,"icon" :"https://192.168.5.253:3001/resources/4dabe31cfa8c527aed4135b5749a845833e2ae6f/icon.png","checkUpdateOnLaunch":true,"spinnerOnLaunch":true,"handlesRelaunch":false,"unmovable":false, "id":"yupptv","inspectable":false,"noSplashOnLaunch":false,"privilegedJail":false,"trustLevel":"default","mediumLargeIcon":"26145206880621944_16999277_115x115.png","splashBackground":"images /splash-screen.png","binId":465916,"title":"YuppTV","resolution":"1920x1080","visible":true,"deeplinkingParams":"","requiredEULA":"generalTerms ","inAppSetting":false,"accessibility":{"supportsAudioGuidance":false},"folderPath":"/media/cryptofs/apps/usr/palm/applications/yupptv","bgImage ":"images/LauncherBG.png","installTime":1625244800,"type":"web","main":"index.html","iconColor":"#17191c","disableBackHistoryAPI":true, "removable":true}
You just need to get the link from the icon, then put the link in trustManager, then pass it to glide and it will display

@chabelets
Copy link

chabelets commented May 22, 2024

Hey @kun510. I use Flutter and platform channel for connectSDK. I got the raw data and I got icon link that not working. I found this method in ConnectSDK, how should I use this?

WebOSTVService(null, null).getLaunchPoints(object : LaunchPointsListener {
                override fun onError(error: ServiceCommandError?) {
                    TODO("Not yet implemented")
                }
                override fun onSuccess("object": JSONArray?) {
                    TODO("Not yet implemented")
                }
            }
        )

@kun510
Copy link
Author

kun510 commented May 23, 2024

@chabelets
Use your device to call funcion launcher in ConnectableDevice's , then call funcion getLaunchPoints in WebOSTVService's and set the log.
sample :
deviceConnected?.launcher?.getLaunchPoints(object : Launcher.LaunchPointsListener {

             override fun onError(error: ServiceCommandError) {
                 Log.d("####", "onError: $error")
                 callback.onError(error,deviceConnected?.ipAddress ?: "", deviceConnected?.friendlyName ?: "")
             }

             override fun onSuccess(objectLG: JSONArray?) {
                 callback.onSuccess(objectLG, deviceConnected?.ipAddress ?: "", deviceConnected?.friendlyName ?: "")

             }
         })

@chabelets
Copy link

Thanks a lot. Works like a charm.

@chabelets Use your device to call funcion launcher in ConnectableDevice's , then call funcion getLaunchPoints in WebOSTVService's and set the log. sample : deviceConnected?.launcher?.getLaunchPoints(object : Launcher.LaunchPointsListener {

             override fun onError(error: ServiceCommandError) {
                 Log.d("####", "onError: $error")
                 callback.onError(error,deviceConnected?.ipAddress ?: "", deviceConnected?.friendlyName ?: "")
             }

             override fun onSuccess(objectLG: JSONArray?) {
                 callback.onSuccess(objectLG, deviceConnected?.ipAddress ?: "", deviceConnected?.friendlyName ?: "")

             }
         })

@chabelets
Copy link

Have you try get icon in iOS app, it seems ConnectSDK-iOS doesn't contain listLaunchPoints

@kun510
Copy link
Author

kun510 commented May 27, 2024

it's just like android

@kun510
Copy link
Author

kun510 commented May 27, 2024

Have you connected to fire tv yet?

@chabelets
Copy link

android

A can't find getLaunchPoints request in ConnectSDK-iOS, should I create this request manually?

Have you connected to fire tv yet?

No I haven't. I connected to WebOS for LG tv

@MuhammadAsad786
Copy link

Use the old version pod in ios , you will get the response id, name, icon .
Get the icon in the list to show

@kun510
Copy link
Author

kun510 commented May 27, 2024

@MuhammadAsad786 yes sure !

@r2creations24
Copy link

I'm a little late but I am trying to do the same thing. I want to get the icon to show from the app list. I implemented the method shown above but I get:

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.

How would I add this to the TrustManager for access? I haven't worked with TrustManager before.

@kun510
Copy link
Author

kun510 commented Jan 2, 2025

@r2creations24 Can you show me the code?

@kun510
Copy link
Author

kun510 commented Jan 3, 2025

@r2creations24
Use your device to call funcion launcher in ConnectableDevice's , then call funcion getLaunchPoints in WebOSTVService's and set the log.
sample :
deviceConnected?.launcher?.getLaunchPoints(object : Launcher.LaunchPointsListener {

         override fun onError(error: ServiceCommandError) {
             Log.d("####", "onError: $error")
             callback.onError(error,deviceConnected?.ipAddress ?: "", deviceConnected?.friendlyName ?: "")
         }

         override fun onSuccess(objectLG: JSONArray?) {
             callback.onSuccess(objectLG, deviceConnected?.ipAddress ?: "", deviceConnected?.friendlyName ?: "")

         }
     })

@kun510
Copy link
Author

kun510 commented Jan 3, 2025

@r2creations24
Don't use it like this
`device?.launcher?.launchApp(
appItem.id, object : Launcher.AppLaunchListener {
override fun onError(error: ServiceCommandError?) {

                     }

                     override fun onSuccess(`object`: LaunchSession?) {

                     }
                 })`

@kun510
Copy link
Author

kun510 commented Jan 3, 2025

@r2creations24 show code, screenshot code

@kun510
Copy link
Author

kun510 commented Jan 3, 2025

@r2creations24 do you use facebook?

@kun510
Copy link
Author

kun510 commented Jan 3, 2025

Do you have any social networks where we can communicate, I will help you there

@kun510
Copy link
Author

kun510 commented Jan 3, 2025

link facebook

@kun510
Copy link
Author

kun510 commented Jan 3, 2025

check message

@r2creations24
Copy link

` val webTrust = WebOSTVTrustManager()

val mycert: X509Certificate? = webOSService?.webOSTVServiceConfig?.serverCertificate
webTrust.setExpectedCertificate(mycert)
webTrust.checkServerTrusted(arrayOf(mycert), "RSA")

`

With this, I see the certificate is now read in Logcat from a method in WebOSTVTrustManager()

I still get the

java.security.cert.CertPathValidatorException: Trust anchor for certification path not found

issue when trying to load image with Glide

Still trying to figure this out.....

@r2creations24
Copy link

Sooooo, I am persistent. HAHA. I found a workaround through Glide to accept the SSL connection. I created an AppModule for Glide by reviewing quite a few posts I found. This is the main one that started me down this path. https://futurestud.io/tutorials/glide-module-example-accepting-self-signed-https-certificates

I posted what I got to finally work here -> https://shift2dev.com/2025/01/04/how-to-fix-glide-ssl-exception-in-android-compose/

I would still like to know if there is something internally through the ConnectSDK that could be used to be able to display the images through Glide or was the solution I stated in this post the only way......

@kun510
Copy link
Author

kun510 commented Jan 4, 2025

haha, you make it more complicated and make it load a lot slower when you can just use the function to link it to the library to display without SSL

@r2creations24
Copy link

HAHA. Like I said I don't give up.

@kun510
Copy link
Author

kun510 commented Jan 4, 2025

you just need call getLaunchPoint function and display image through url, very simple but you make it more complicated

@kun510
Copy link
Author

kun510 commented Jan 6, 2025

so good,
I told you to do that from the beginning but you didn't follow me hahaha

@r2creations24
Copy link

funny but it still gives me the same issue with SSL

@kun510
Copy link
Author

kun510 commented Jan 6, 2025

You don't need SSL at all, I think you must be doing something wrong somewhere

@kun510
Copy link
Author

kun510 commented Jan 6, 2025

I advise you to keep your project private, don't make it public, because many people can steal your important project

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

No branches or pull requests

4 participants