0

虽然我是一名程序员,但我从未为任何 Apple 设备编写过代码。因此,我对 iOS 的特定知识和对其 API 的熟悉程度几乎不存在,所以请多多包涵。

我想从锁定屏幕(滑动、双击时钟等)创建一个动作,该动作将解锁并立即打开 App Switcher(我对扩展 ala SwitcherPlus 等不感兴趣)。我想这意味着编写一个小脚本,并且我可以使用一些有关 API 和其他基础知识的帮助(核心功能,不应该需要任何附带的东西)。如果需要,我愿意深入了解细节,但我对其他解决方案持开放态度。即使是像将多个 Activator 响应链接在一起这样高级别的东西也可以。

Ruby在 Cydia/Scripting (Telesphoreo) 下看到。虽然我更喜欢 Python 甚至 Bash,但我的目的是相当小的 Ruby 就可以了。我宁愿不使用Objective-C。虽然我最初的目标是上述行为,但我可以看到自己希望在未来做类似的事情,所以一些关于一般知识的技巧将不胜感激。

如果不清楚,这纯粹是个人项目。我完全不关心包装、共享、向后兼容性、商业吸引力等

PS - 到目前为止,我将我的 Cydia 查看设置为“hacker”而不是“dev”。这种努力是否表明我应该将它提升到开发?这个词似乎有点慷慨,但如果它打开了我需要的包......


编辑:我使用 iPhone 4S,iOS 5.0.1

4

1 回答 1

0

I don't think that this is possible in any scripting language. For one reason: You'll need to do code injection to achieve these goals (MobileSubstrate).

1) If you want to detect user interaction, you'll have to add ways to detect it or hook implementations which are already there. Even if you just wanna use Activator, you'll still have to develop a binary to register itself with Activator -> objC

2) There is no known way (at least to me) to interact with SpringBoard via scripts the way you want. So you'll have to make a binary which would execute the opening of the switcher.

I hope someone will have a better answer for you, but I'm very very sure that you won't get around using C/objC

There is a tool called http://www.cycript.org/ which is a bridge between JavaScript and objC, but I have never seen it being used for more than investigating.

于 2012-05-07T18:59:09.180 回答