百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

MRYIPC

> 编程语言
开源

无需RocketBootstrap即可使用iOS IPC

99 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

无需RocketBootstrap即可使用iOS IPC

MRYIPC

Easy-to-use iOS IPC without the need for RocketBootstrap

MRYIPC is an easy-to-use IPC (inter-process communication) mechanism for jailbroken devices (although it will also work on unjailbroken devices) that eliminates the need for RocketBootstrap.

MRYIPCCenter is similar in API to CPDistributedMessagingCenter, so it shouldn't be too challenging to replace current CPDistributedMessagingCenter implementations with MRYIPCCenter.

How to use

To use MRYIPC, copy MRYIPCCenter.h to $THEOS/include and usr/lib/libmryipc.dylib to $THEOS/lib. Then you can add XXX_LIBRARIES = mryipc to your Makefile and #import into any source files you want to use it in. Then add Depends: com.muirey03.libmryipc to your control file.

An example usage can be seen in ExampleClient and ExampleServer in this repository.

The client

First, create the client center:

MRYIPCCenter* center = [MRYIPCCenter centerNamed:@"com.muirey03.MRYExampleServer"];

Then, go ahead and call any method you like:

NSNumber* result = [center callExternalMethod:@selector(addNumbers:) withArguments:@{@"value1" : @5, @"value2" : @7}];

MRYIPCCenter provides 3 ways to call methods on the center:

//asynchronously call a void method
-(void)callExternalVoidMethod:(SEL)method withArguments:(id)args;
//synchronously call a method and recieve the return value
-(id)callExternalMethod:(SEL)method withArguments:(id)args;
//asynchronously call a method and receive the return value in the completion handler
-(void)callExternalMethod:(SEL)method withArguments:(id)args completion:(void(^)(id))completionHandler;

Please note that the arguments and return value type must be one that can be stored in a plist (NSString*, NSNumber*, NSData*, NSArray* or NSDictionary*).

The server

IMPORTANT NOTE: Only one server is allowed for any given name. You cannot create 2 servers in 2 different processes with the same name, that is illegal, and will cause the second process to crash.

Again, start by creating a sever center with the same name as the client (you'll need to store a reference somewhere to stop it being deallocated):

MRYIPCCenter* center = [MRYIPCCenter centerNamed:@"com.muirey03.MRYExampleServer"];

Then register any methods you want to make external:

[center addTarget:self action:@selector(addNumbers:)];

Then just implement the methods and let MRYIPC handle the rest:

-(NSNumber*)addNumbers:(NSDictionary*)args
{
	NSInteger value1 = [args[@"value1"] integerValue];
	NSInteger value2 = [args[@"value2"] integerValue];
	return @(value1 + value2);
}

MRYIPC also allows for block-based servers for more simple callbacks where you don't necessarily need an object to act as the server:

static MRYIPCCenter* center;

%ctor
{
	center = [MRYIPCCenter centerNamed:@"com.muirey03.MRYExampleServer"];
	[center addTarget:^NSNumber*(NSDictionary* args){
		NSInteger value1 = [args[@"value1"] integerValue];
		NSInteger value2 = [args[@"value2"] integerValue];
		return @(value1 + value2);
	} forSelector:@selector(addNumbers:)];
}

Credits

Feel free to follow me on Twitter @Muirey03. If you have any contributions you want to make to this, please submit a Pull Request.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言