开发 Mobile Substrate 调整

发布于 2024-11-29 22:36:32 字数 243 浏览 1 评论 0原文

我有一些关于开发移动基板调整的问题。
首先,你如何制作它们?

一定要用XCode吗?

需要什么类型的文件以及您将代码放在哪里?

如何连接到应用程序?

例如,如果我想更改 Messages 应用程序中的某些内容,我该如何编程才能将其挂接到 Messages.app 中?

我非常熟悉为应用程序商店开发常规应用程序,并且我对移动底层非常感兴趣。我真的很想知道如何去做以及从哪里开始。谢谢!

I have a few questions about developing mobile substrate tweaks.
First of all, how do you make them?

Do you have to use XCode?

What kind of files are needed and where do you place your code?

How do you hook into an app?

For example if I want to change something in the Messages app, how could I program it to hook into Messages.app?

I am pretty familiar with developing regular apps for the app store, and I am very interested in mobile substrate. I would really like to know how to do it and where to start. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

十年不长 2024-12-06 22:36:32

到目前为止,开发 MS 调整的最简单方法是使用 Theos

按照以下说明进行操作使用上面的链接安装 theos,导航到要存储项目的文件夹并运行 $THEOS/bin/nic.pl 来生成调整模板。

生成的 Tweak.xm 文件是您放置代码的位置。要构建项目,只需导航到终端中的项目目录并运行 make。如果您的系统上有dpkg,那么您可以轻松打包并安装该项目。确保您的 iDevice 上安装了 OpenSSH 并将此行添加到项目的 makefile 中:

THEOS_DEVICE_IP = [INSERTDEVICESIPHERE]

然后运行 ​​make package install 来构建您的项目,将其打包在 .deb 中,然后传输到您的设备并安装它。

Tweak.xm 文件中实际包含的代码是 Objective-C,使用一种名为 Logos 的语言来简化 Mobile Substrate 任务,其解释如下:http://iphonedevwiki.net/index.php/Logos。一般来说,代码遵循以下格式:

%hook classname //declares the class from your application you're going to override

-(void)functionyouwanttooveride {

    dosomethingnew(); //put all your new code for the method here
    return %orig;     //this calls the original definition of the method and returns the result
}
%end //end hooking classname

要找出需要重写哪些类和方法来执行您想做的任何事情,请从 cydia 安装 class-dump,ssh 到您的设备并运行 class-dump -H path/to/your/binary -o /path/where/you/want/your/classheaders.然后,您只需查看生成的标头,找到名称与您正在执行的操作相关的类和方法,然后对它们进行试验。

祝你好运!

By far, the easiest way to develop MS tweaks is to use Theos

Follow the instructions given on the link above to install theos, navigate to the folder you want to store the project in and run $THEOS/bin/nic.pl to generate a template for your tweak.

The generated Tweak.xm file is where you put your code. To build the project just navigate to the project directory in Terminal and run make. If have dpkg on your system, then you can package up and install the project easily. Make sure OpenSSH is installed on your iDevice and add this line to your project's makefile:

THEOS_DEVICE_IP = [INSERTDEVICESIPHERE]

Then run make package install to build your project, package it in a .deb, transfer it over to your device and install it.

The code that actually goes in the Tweak.xm file is objective-C with a language that simplifies Mobile Substrate tasks called Logos, which is explained here: http://iphonedevwiki.net/index.php/Logos. Generally though, the code follows this format:

%hook classname //declares the class from your application you're going to override

-(void)functionyouwanttooveride {

    dosomethingnew(); //put all your new code for the method here
    return %orig;     //this calls the original definition of the method and returns the result
}
%end //end hooking classname

To find out what classes and methods you need to override to do whatever you want to do, install class-dump from cydia, ssh into your device and run class-dump -H path/to/your/binary -o /path/where/you/want/your/classheaders. Then you just have to look through the resulting headers to find classes and methods that have names that seem relevant to what you're doing, and experiment with them.

Good luck!

掩于岁月 2024-12-06 22:36:32

我在博客上写了一个 MobileSubstrate 调整教程
如果您关注它,我希望您会发现它有用!

I wrote a MobileSubstrate tweak tutorial on my blog
If you follow it, I hope you find it useful!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文