Android Substrate SDK

The Android SDK ships with a tool called the SDK Manager, which can be used to install both first- and third- party add-ons and "extras". By integrating into this mechanism, it becomes easy for developers to check for updates. This guide shows how to install the Cydia Substrate SDK using this system.

Adding the Manifest URL

First, open the SDK manager. You can either do this directly from Eclipse (Window » Android SDK Manager), or you can run the android tool directly from the command line.

Tools » Manage Add-on Sites...

User Defined Sites

New...

http://asdk.cydiasubstrate.com/addon.xml

OK

Close

Extras » Cydia Substrate API »

Install 1 package...

Install

Close

Direct Download URL

The primary benefit of the SDK Manager is that it allows developers working with many SDKs to find out about and download any available upgrades from a single interface.

However, the SDK Manager is buggy, or might not support your platform; you might even simply hate it: that's OK (I do, too).

Download Cydia Substrate SDK r2

What is in the SDK?

The Substrate SDK will be installed to extras/saurikit/cydia_substrate in your Android SDK folder. It contains these files:

substrate.h: This header file contains prototypes for the native Substrate API.

lib/*/libsubstrate*.so: Native libraries you would link against to use Substrate API.

substrate-api.jar: Include this jar with your project (yes: throw it right in and let it get included as part of your distributed APK).

substrate-bless.jar: AspectJ hack to javac that makes it easier to work with private members. See also: Java Access Control.

aspectjweaver.jar: AspectJ itself. This is sadly most of the size of the SDK (doh! ;P).

Clearing the Manifest Cache

Sometimes, the Android SDK Manager refuses to see new packages or updates. This seems to be due to faulty caching logic. Sadly, even setting the most restrictive possible "do not cache this" headers does not keep the SDK Manager from using old files. Thankfully, there is a high-level feature for clearing the cache.

Android SDK Manager » Preferences...

Clear Cache

Subsequent requests for package manifest files should go through to the server, and you should get the latest version.