The Loader

Native code that starts Unbound inside Discord.

The loader is Unbound's native part: a tweak on iOS, an Xposed module on Android. It runs Unbound's bundle before Discord's; addon developers don't need it.

At Launch

Each time Discord loads its JavaScript, the loader runs first:

  1. Read settings.jsonStop here if loader.enabled is false
  2. Scan addon foldersPlugins, Themes, Fonts
  3. Run Unbound's bundleThe cached copy
  4. Run Discord's bundle

The loader never runs plugins. It reads them from disk and hands them to Unbound through UnboundNative, such as UnboundNative.getPlugins() and UnboundNative.getThemes(). Running first lets Unbound hook Metro before Discord defines its modules.

Native Work

JobWhat it does
Bundle updatesDownloads a newer bundle in the background, checks signature and hash, uses it next launch.
Theme and fontsSwaps colors and fonts below JavaScript, so native views change too.
Crash guardTurns off an addon after two launches in a row end inside it.
ToolboxThe recovery menu works even when Unbound's JavaScript fails.

Next