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

Add apps to home screen #62

Closed
wants to merge 9 commits into from
Closed

Conversation

Vishram1123
Copy link

Using a helper shortcut (to generate web clips) as well as a url scheme, it is made possible to add apps to home screen.

Next launched app is configured using livecontainer://launchapp?exec=[app name percent encoded].app, then the app can be launched normally.

The helper shortcut (integrated into the app in the settings tab) automates the launching of the app, and the adding of the app to the homescreen (located here: https://www.icloud.com/shortcuts/f777072dfe4d48ada1004c496f76154f)

Solves #61

(please excuse my awful objc code, this is my first time using objective c)

@Vishram1123
Copy link
Author

(Also I had no way to test this with jit or trollstore, so I don't know if this would work with that, but it should because all it is doing is automating the didSelectRowAtIndexPath and launchButtonTapped methods (kinda))

@Vishram1123
Copy link
Author

Opening the context menu for an app on the list view page will bring up an option to add the app to the home screen, which uses the helper shortcut to add the webclip representation of the app to homescreen

@Vishram1123
Copy link
Author

One problem is when the web clip is deleted from the home screen, the corresponding profile isn't deleted along with it, leading to unnecessary clutter in the Profiles tab in Settings

@waveblitzd
Copy link

my experience using this fork has been great, however there were some concerns that occurred to me. first, the apps cannot be quickly interchanged between one another (the livecontainer app must be exited and refreshed beforehand). also, the profiles seem to be disappearing after the phone is rebooted. i used cowabunga lite so idk if thats part of the issue, but its something that occurred to me nonetheless.

aside from that, is there a way to customize the shortcuts that the livecontainer helper generates? i have custom icon layouts so that would be a huge help

@Xhastin1
Copy link

my experience using this fork has been great, however there were some concerns that occurred to me. first, the apps cannot be quickly interchanged between one another (the livecontainer app must be exited and refreshed beforehand). also, the profiles seem to be disappearing after the phone is rebooted. i used cowabunga lite so idk if thats part of the issue, but its something that occurred to me nonetheless.

aside from that, is there a way to customize the shortcuts that the livecontainer helper generates? i have custom icon layouts so that would be a huge help

Could u help a brother out? kinda struggling with this.

@khanhduytran0
Copy link
Owner

@Vishram1123 Thanks for your contribution. I’ll look into when I have time.

@Vishram1123
Copy link
Author

@waveblitzd and @Xhastin1 (sorry for the late response, I am out of the country):

  1. The apps cannot be interchanged as it seems that LiveContainer loads the dylib of the guest app before loading its own AppDelegate, which prevents it from being able to hot swap the currently loaded app. Additionally, there is unfortunately no way to quit the app from within the app, as dlclose-ing the inner app's dylib cannot be done while the inner app is running.

  2. I don't have a MDC-enabled device, so I have no way to test that. However, you can create your own homescreen shortcut by creating a shortcut in the Shortcuts app with two actions: opening the url livecontainer://launchapp?exec=[your app's name percent encoded] and then opening the LiveContainer app

  3. Yes, it is possible, the shortcut is called using a url scheme (shortcuts://run-shortcut?name=LiveContainerHelper&input=[base64 encoded json ({name: app name} for just launching the app, or {name: app name, image: base64 encoded app icon})]), so if you wanted to modify any part of that, you can.

@khanhduytran0 thanks!

@khanhduytran0
Copy link
Owner

The apps cannot be interchanged as it seems that LiveContainer loads the dylib of the guest app before loading its own AppDelegate, which prevents it from being able to hot swap the currently loaded app. Additionally, there is unfortunately no way to quit the app from within the app, as dlclose-ing the inner app's dylib cannot be done while the inner app is running.

You’re right. Moreover, another issue is the internal state of all classes cannot be reset, and leaked memory regions will stay leaked. For example, UIApplicationMain can only be called once.

@aqeqe
Copy link

aqeqe commented May 26, 2024

@waveblitzd and @Xhastin1 (sorry for the late response, I am out of the country):

  1. The apps cannot be interchanged as it seems that LiveContainer loads the dylib of the guest app before loading its own AppDelegate, which prevents it from being able to hot swap the currently loaded app. Additionally, there is unfortunately no way to quit the app from within the app, as dlclose-ing the inner app's dylib cannot be done while the inner app is running.
  2. I don't have a MDC-enabled device, so I have no way to test that. However, you can create your own homescreen shortcut by creating a shortcut in the Shortcuts app with two actions: opening the url livecontainer://launchapp?exec=[your app's name percent encoded] and then opening the LiveContainer app
  3. Yes, it is possible, the shortcut is called using a url scheme (shortcuts://run-shortcut?name=LiveContainerHelper&input=[base64 encoded json ({name: app name} for just launching the app, or {name: app name, image: base64 encoded app icon})]), so if you wanted to modify any part of that, you can.

@khanhduytran0 thanks!

My apologies, i meant as in:
I’m having trouble setting it up.

im not an expert in this whole coding/shortcuts thing, so i was hoping someone could simplify it perhaps?

i have the shortcut but whenever i launch it,
It says: Can only be launched by LiveContainer.

@Vishram1123
Copy link
Author

My apologies, i meant as in:

I’m having trouble setting it up.

im not an expert in this whole coding/shortcuts thing, so i was hoping someone could simplify it perhaps?

i have the shortcut but whenever i launch it,

It says: Can only be launched by LiveContainer.

Oh you don't have to interact with the shortcut directly; simply force click (right click, 3d touch, etc.) one of the apps, then click "Add to Home Screen":

image

After that, allow the shortcut to add the profile to Settings, install the downloaded profile in Settings, and then you will have your app on the home screen.

@Vishram1123
Copy link
Author

@aqeqe
Copy link

aqeqe commented May 26, 2024

My apologies, i meant as in:
I’m having trouble setting it up.
im not an expert in this whole coding/shortcuts thing, so i was hoping someone could simplify it perhaps?
i have the shortcut but whenever i launch it,
It says: Can only be launched by LiveContainer.

Oh you don't have to interact with the shortcut directly; simply force click (right click, 3d touch, etc.) one of the apps, then click "Add to Home Screen":

image

After that, allow the shortcut to add the profile to Settings, install the downloaded profile in Settings, and then you will have your app on the home screen.

Thats odd.. i dont have a feature like that?
IMG_8501
IMG_8502

@Vishram1123
Copy link
Author

Vishram1123 commented May 26, 2024

Are you using the Actions artifact from this repo or my fork? What does your Settings tab look like? @aqeqe

@aqeqe
Copy link

aqeqe commented May 26, 2024

Are you using the Actions artifact from this repo or my fork? What does your Settings tab look like? @aqeqe

I hate the GitHub UI cuz its so confusing for me
-but after some trial and error i finally got it to work.
I didn’t know you had your own modified version of Livecontainer, thanks.

aea103a5-ab2c-41c0-9190-c13a2668f3d3.mov

Some apps like Spotify and uYou+ work, but for some weird reason others won’t, like MCPE and Provenance.

MCPE and Provenance work, only if i launch them directly in livecontainer myself tho, like the developer intended.

@Vishram1123 Vishram1123 marked this pull request as draft May 27, 2024 03:01
@Vishram1123
Copy link
Author

Converted this to a draft to make a few more changes to make this a bit more streamlined.

@Vishram1123 Vishram1123 marked this pull request as ready for review May 27, 2024 04:44
@Vishram1123
Copy link
Author

I updated the shortcut and the LiveContainer app to not only launch the app via a url scheme, but also by updating a file with a string. As such, the shortcut (at https://www.icloud.com/shortcuts/291fbac584d04f5e81038fc009c58b8c) requires the user to specify the location of the LiveContainer data folder, so it can modify the nextLaunch file with the new name of the file. The old shortcut should still work, but this prevents the flash that occurs before the app is launched.

@waveblitzd
Copy link

the build seems to have failed on your fork, is there a prebuilt ipa for this version yet? i tried using the new shortcut and it just won't work now

@Vishram1123
Copy link
Author

missing....semicolon............

@aqeqe
Copy link

aqeqe commented May 27, 2024

missing....semicolon............

https://drive.google.com/file/d/1eGpfnnrvEoIUhsJ5339ZwDX0APctC8re/view?usp=drivesdk

What am i doing wrong? :/

@waveblitzd
Copy link

getting the same issue as above

@Vishram1123
Copy link
Author

Give the shortcut the LiveContainer folder, not the nested Data folder

@waveblitzd
Copy link

i'm getting an error that says "app could not be opened" in shortcuts after changing the folder

@Vishram1123
Copy link
Author

Try setting the folder while reinstalling the shortcut?

@waveblitzd
Copy link

still getting the issue, is replacing the shortcut good enough or should i be deleting my old one and then reinstalling?

@aqeqe
Copy link

aqeqe commented May 28, 2024

Try setting the folder while reinstalling the shortcut?

IMG_8591

https://youtu.be/DmH6YPWhaDY?feature=shared

yeah same problem tho, something’s not right.

@Vishram1123
Copy link
Author

Reinstalling should be sufficient; when you scroll down to the very bottom, what does the open command look like?

@waveblitzd
Copy link

IMG_7001

@barnoii
Copy link

barnoii commented Jun 9, 2024

IMG_7001

clicking on LiveContainer next to Open and selecting LiveContainer from the list seemed to fix it for me

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

Successfully merging this pull request may close these issues.

None yet

6 participants