simulate “Add to Home Screen” feature on older iPod touch

荒凉一梦 提交于 2019-12-10 11:49:27

问题


I have a jailbroken iPod Touch 1.1.4, and want to experiment with creating minimalistic "apps" just by scripting, launching Safari to a "webapp". But 1.1.4 does not have the "Add to Home Screen" shortcut option. Is there a way to simulate this just by scripting? I've tried editing the HelloPython Bash script, changing it to:

#!/bin/bash
/Applications/MobileSafari.app/MobileSafari http://gnixl.com/

And I get the error:

ABORT: Unable to register "com.apple.mobilesafari" port, 1103 unknown error code.

I removed the URL http://gnixl.com/, same error.

Is there a way to do this without using Python or Objective-C? Not that I'm not willing to use either/or, but I'm looking for the most barebones approach that will do something first.

If someone with a newer iPod touch could "add to home screen" anything and analyze what it puts into the Applications folder, that might be just the info I need. Or if someone jailbroke their device with ziphone and left the link on the homescreen, that would work too unless the "link" is actually an executable.

[update 2016-01-25: 2 github projects now up using troutinator's answer as template: https://github.com/jcomeauictx/conwaylife and https://github.com/jcomeauictx/taillight]


回答1:


Okay, I have an iPhone 3G. I created an link from Safari using the "Add To Home Screen" button. It created a directory called 54C86B09482D4560BAB46091CC75825A.webclip inside of /private/var/mobile/Library/WebClips/. That directory contains two files, icon.pngand Info.plist. icon.png is simply the icon that gets shown when looking at the apps screen.

The contents of Info.plist are where the real information is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>ClassicMode</key>
        <false/>
        <key>FullScreen</key>
        <false/>
        <key>IconIsPrecomposed</key>
        <false/>
        <key>IconIsScreenShotBased</key>
        <true/>
        <key>Scale</key>
        <real>0.32653060555458069</real>
        <key>ScrollPoint</key>
        <dict>
                <key>x</key>
                <real>0.0</real>
                <key>y</key>
                <real>-183</real>
        </dict>
        <key>Title</key>
        <string>The Daily WTF</string>
        <key>UIStatusBarStyle</key>
        <string>UIStatusBarStyleGray</string>
        <key>URL</key>
        <string>http://thedailywtf.com/</string>
</dict>
</plist>

Edit: Fixed some grammar, clarified things a bit, and added the test/example below:

So, to test this out I created a new folder called C28C8FDC2F184AAD84F77B511442548F.webclip and copied the Info.plist file over from the other directory, edited the url to http://google.com. I then re-sprung the phone and it showed up just like any other webclip. The folder name is simply a hex encoded GUID, I used http://www.somacon.com/p113.php and just selected what was after 0x for this simple test



来源:https://stackoverflow.com/questions/5075280/simulate-add-to-home-screen-feature-on-older-ipod-touch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!