Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

caenv= in SpringBoard too: CoreAnimation's switches that hold the frame rate back are read by the process that animates as well as by the one that composes

shimoku74a5620fff1c8f
diff --git a/userland/src/inject_sb.c b/userland/src/inject_sb.c
index f93446d..f908322 100644
--- a/userland/src/inject_sb.c
+++ b/userland/src/inject_sb.c
@@ -1246,6 +1246,38 @@ load_tweaks(void)
}
}
+/*
+ * Boot-arg caenv=NAME=VALUE: CoreAnimation's switches here as in the window server (inject.c), set before QuartzCore
+ * reads them. The ones that hold the frame rate back (CA_MINIMUM_FRAME_DURATION and its kind) are read by the
+ * process that animates as well as by the one that composes, and SpringBoard animates the home screen.
+ */
+static void
+caenv(void)
+{
+ char arguments[1024] = "";
+ size_t size = sizeof(arguments) - 1;
+
+ if (sysctlbyname("kern.bootargs", arguments, &size, NULL, 0) != 0) {
+ return;
+ }
+ for (const char *argument = arguments; (argument = strstr(argument, "caenv=")) != NULL; argument += 6) {
+ char setting[128];
+ size_t length = strcspn(argument + 6, " ");
+ char *equals;
+
+ if ((argument != arguments && argument[-1] != ' ') || length == 0 || length >= sizeof(setting)) {
+ continue;
+ }
+ memcpy(setting, argument + 6, length);
+ setting[length] = 0;
+ if ((equals = strchr(setting, '=')) != NULL) {
+ *equals = 0;
+ setenv(setting, equals + 1, 1);
+ say("hakios: caenv: %s=%s for SpringBoard\n", setting, equals + 1);
+ }
+ }
+}
+
__attribute__((constructor))
static void
hakios_springboard_init(void)
@@ -1272,6 +1304,7 @@ hakios_springboard_init(void)
});
return;
}
+ caenv();
/*
* The tweaks of the package manager's prefix, if one is installed: ElleKit's loader
* (/var/jb/usr/lib/TweakLoader.dylib) reads /var/jb/usr/lib/TweakInject and opens the tweaks