Coder Social home page Coder Social logo

h0medev / libobjcipc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from a1anyip/libobjcipc

0.0 2.0 0.0 226 KB

An inter-process communication (between app and SpringBoard) solution for jailbroken iOS

Objective-C 96.35% Makefile 0.84% Shell 0.32% C 2.49%

libobjcipc's Introduction

libobjcipc

An inter-process communication (between app and SpringBoard) solution for jailbroken iOS. Specifically written for iOS 7 (not tested on previous versions).

It handles the socket connections between SpringBoard and app processes, the automatic set up of process assertions and the auto disconnection after timeout or the process terminates.

You only need to call the static methods in the main class OBJCIPC. Messages and replies can be sent synchronously (blocking) or asynchronously.

Basic Usage

The basic usage of the library is to have an extra MobileSubstrate extension which hooks into a specific app to set up an incoming message handler. Another instance in SpringBoard process sends a message to that app and wait for its reply.

Usage (Send message)

// Asynchronous message sent from SpringBoard to app (MobileTimer in this case)
[OBJCIPC sendMessageToAppWithIdentifier:@"com.apple.mobiletimer" messageName:@"Custom.Message.Name" dictionary:@{ @"key": @"value" } replyHandler:^(NSDictionary *response) {
	NSLog(@"Received reply from MobileTimer: %@", response);
}];
   
// Asynchronous message sent from app to SpringBoard
[OBJCIPC sendMessageToSpringBoardWithMessageName:@"Custom.Message.Name" dictionary:@{ @"key": @"value" } replyHandler:^(NSDictionary *response) {
	NSLog(@"Received reply from SpringBoard: %@", response);
}];

// Omit replyHandler parameter to send messages synchronously; return value will be the reply (NSDictionary).

Usage (Handle incoming messages)

// Handle messages sent from any app in SpringBoard
[OBJCIPC registerIncomingMessageFromAppHandlerForMessageName:@"Custom.Message.Name"  handler:^NSDictionary *(NSDictionary *message) {
	// return something as reply
	return nil;
}];

// Handle messages sent from the specific app in SpringBoard
[OBJCIPC registerIncomingMessageHandlerForAppWithIdentifier:@"com.apple.mobiletimer" andMessageName:@"Custom.Message.Name" handler:^NSDictionary *(NSDictionary *message) {
	// return something as reply
	return nil;
}];

// Handle messages sent from SpringBoard in app
[OBJCIPC registerIncomingMessageFromSpringBoardHandlerForMessageName:@"Custom.Message.Name" handler:^NSDictionary *(NSDictionary *message) {
	// return something as reply
	return nil;
}];

libobjcipc's People

Contributors

eswick avatar a1anyip avatar se4c0met avatar

Watchers

James Cloos avatar H0medev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.