Giter VIP home page Giter VIP logo

patcher's Introduction

Ruby OsX Application Bundle Patcher

What for?

This tiny ruby script patches specific files in application bundles, it reads all nessecary informations from a xml file. I was tired of patching manually...

Usage

  1. Create xml file with all information. The structure is simple:
<patches>
	<patch app="YourAppName" version="VersionNumber">
		<file path="PathToFile">
			<md5>md5 value of original file</md5>
			<code>
				<original>code to patch</original>
				<patched>replacement</patched>
			</code>
		</file>	
	</patch>
</patches>

<patches> can contain multiple <patch>-tags, as well as <patch> can contain more than one <file>-tags, <file> can contain multiple <md5>-tags and last but not least multiple <code>-tags. The original code should contain enough code to identify the correct location. Then the patched code replaces the original byte by byte from the beginning (please take a look at the example).

  1. Call patcher.rb with 2 parameters: $PathToApplication $PathToPatchFile

  2. You are done. A backup of the patched file was automatically created, in case something went wrong. The patcher appended the suffix .orig .

Example

There is an example application "HelloWorld.app" and a corresponding xml-file. Feel free to test it with ./patcher.rb ./HelloWorld.app/ ./patches.xml .

Acknowledgment

Torsten wrote the very first patch script, which inspired me to pimp it a bit. The sample application is taken from Andrew Nesbitt's blog: http://teabass.com/hello-world-in-cocoa/ , which was modified by me, to demonstrate how the patcher works.

Limitations

At the moment, this script only works with ruby version 1.8.7. I tested only what I needed for my stuff, so be careful.

patcher's People

Watchers

HCiSO 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.