Substrate extensions are simply classes that will be loaded immediately after the Java VM is initialized, allowing an opportunity to use other Substrate APIs.
Once loaded into a new blessed classloader, they will have a static method named initialize (that takes no arguments and returns void).
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <application> <meta-data android:name="com.saurik.substrate.main" android:value=".Main"/> </application> </manifest>
Android has a fine-grained permissions model that allows us to verify that Substrate extensions are only registered by packages that the user trusts enough to have the far-reaching power to make arbitrary modifications to other packages or the system itself.
Substrate manages this by registering its own permission,
cydia.permission.SUBSTRATE, which packages must request in their manifest files with the
<permission android:name="cydia.permission.SUBSTRATE" android:label="modify code from other packages" android:protectionLevel="dangerous" android:permissionGroup="android.permission-group.DEVELOPMENT_TOOLS" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="cydia.permission.SUBSTRATE"/> </manifest>