bang590/JSPatch sits at 11.3k stars on GitHub, written primarily in Objective-C. JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
JSPatch bridges Objective-C and JavaScript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. That makes the APP obtaining the power of script language: add modules or replacing Objective-C code to fix bugs dynamically.
JSPatch is still in development, welcome to improve the project together.
You can also try to use JSPatch Convertor to convertor code from Objective-C to JavaScript automatically.
Installation
CocoaPods
CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like JSPatch in your projects. See the "Getting Started" guide for more information.
# Your Podfile
platform :ios, '6.0'
pod 'JSPatch'
Manually
Copy JSEngine.mJSEngine.hJSPatch.js in JSPatch/ to your project.
// JS
defineClass("JPTableViewController", {
// instance method definitions
tableView_didSelectRowAtIndexPath: function(tableView, indexPath) {
var row = indexPath.row()
if (self.dataSource().count() > row) { //fix the out of bound bug here
var content = self.dataSource().objectAtIndex(row);
var ctrl = JPViewController.alloc().initWithContent(content);
self.navigationController().pushViewController(ctrl);
}
},
dataSource: function() {
// get the original method by adding prefix 'ORIG'
var data = self.ORIGdataSource().toJS();
return data.push('Good!');
}
}, {})
Go to wiki page for more details: Usage of defineClass
Extensions
There are some extensions provide support for custom struct type, C methods and other functional, call +addExtensions: after starting engine to add extensions:
include('test.js') //include function provide by JPInclude.m
var view = require('UIView').alloc().init()
//CGAffineTransform is supported in JPCGTransform.m
view.setTransform({a:1, b:0, c:0, d:1, tx:0, ty:100})
Extensions can be added dynamiclly in JS, which is recommended:
require('JPEngine').addExtensions(['JPInclude', 'JPCGTransform'])
// `include()` and `CGAffineTransform` is avaliable now.
You can create your own extension to support custom struct type and C methods in project, see the wiki page for more details: Adding new extensions
The most recent commit recorded on bang590/JSPatch was 6.0 years ago, based on the GitHub push timestamp. The repository has 2.2k forks — one of the better signals of community interest.
How many stars does bang590/JSPatch have?
bang590/JSPatch has 11.3k GitHub stars — refresh the page for the live number, or check github.com/bang590/JSPatch. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is bang590/JSPatch open source?
Yes — bang590/JSPatch ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/bang590/JSPatch.
What is bang590/JSPatch?
bang590/JSPatch (bang590/JSPatch) is a Objective-C project on GitHub. From the project's own README: JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.
Where do I read more about bang590/JSPatch?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/bang590/JSPatch is the definitive source.
Read full README in the tab above.
Curious whether JSPatch is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about JSPatch.