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

inject_sb: the cellular signal view in active mode while registered -- the bars showed but grey: UIKit's _UIStatusBarSignalView draws them inactive until CommCenter (not here) reports service; setSignalMode: is replaced so the cellular view (not Wi-Fi) is active while the kernel says registered, and the modes asked for are logged

shimoku74091770b751ce
diff --git a/prebuilt/SHA256SUMS b/prebuilt/SHA256SUMS
index d8831a2..685886b 100644
--- a/prebuilt/SHA256SUMS
+++ b/prebuilt/SHA256SUMS
@@ -1,4 +1,4 @@
-Built 2026-10-25 19:56 from this tree.
+Built 2026-10-25 19:59 from this tree.
04263e76d6cc8b13e8f9e89229afa8f4d3039d8f3714ca7fd1d6e8603091d28b prebuilt/mach.development.bcm2837
3de0d8b2095989a9a8f9f9679b8bec01d80bad38eee535d934d29b7b76fee984 prebuilt/loader.efi
@@ -11,7 +11,7 @@ b089fec6fe19149c3a61f8645ea3c28b19a051d4d053794ae459ff6a7c947805 prebuilt/userl
ef496beee457476dcda607d27cb26398b1fc463b6f6c7fe21012eb4c0c26edb9 prebuilt/userland/libhakios.app.dylib
530c2e681093ece2afe7f5180a4723bd46d92f7af39edc0a8c77136136a4dad6 prebuilt/userland/libhakios.dylib
d8680034e5f0cdecd396cd7488e9d0f30037223ebc57f5309f99a6cd45a4ad26 prebuilt/userland/libhakios.media.dylib
-2ac431a5f5d588ab76a80abbe6f1be9934c13adc4794226de9ba777745075f36 prebuilt/userland/libhakios.sb.dylib
+d4f1c6b06b4b016b1a3ea77d741382053efde0093a5a8f77226a215bee87b232 prebuilt/userland/libhakios.sb.dylib
da392e632eb6978164c4c191b73773cf4ceac2c288d1b9697d35fd1f938f73f3 prebuilt/userland/libhakios.tweaks.dylib
8ba7ffba4ff62aff74ab144fc25c61873408320511a83c9b8faf941f32e965d0 prebuilt/userland/mg_test
8dccf07fb4d9f406fcf558355cc9f3a1614a39c29e5bb79740aa5c5e972023fe prebuilt/userland/net_test
diff --git a/prebuilt/userland/libhakios.sb.dylib b/prebuilt/userland/libhakios.sb.dylib
index 11fe5e5..bdd9a9b 100755
Binary files a/prebuilt/userland/libhakios.sb.dylib and b/prebuilt/userland/libhakios.sb.dylib differ
diff --git a/userland/src/inject_sb.c b/userland/src/inject_sb.c
index 946ad7a..c40430a 100644
--- a/userland/src/inject_sb.c
+++ b/userland/src/inject_sb.c
@@ -386,9 +386,59 @@ update_service_item(id self, SEL sel, long item, void *data, id sim, id other, v
}
}
+/*
+ * The bars are drawn by UIKit's signal view, whose "signal mode" says how: inactive (all bars grey),
+ * searching, or active (the bars that count dark). iOS's cellular stack (CommCenter, not here)
+ * puts it in active mode once there is service; without it the bars stay grey whatever their
+ * number. So for the cellular signal view (not the Wi-Fi one), while the kernel says the modem is
+ * registered, the mode is made active. The modes seen are said in the log once each.
+ */
+static void (*original_set_signal_mode)(id self, SEL sel, long mode);
+static long cellular_active_mode = 2; /* _UIStatusBarSignalView: 0 inactive, 1 searching, 2 active */
+
+static void
+set_signal_mode(id self, SEL sel, long mode)
+{
+ static unsigned said_modes;
+ const char *name = object_getClassName(self);
+ bool cellular = name != NULL && strstr(name, "Cellular") != NULL;
+ long wanted = mode;
+
+ if (cellular && mode < 8 && !(said_modes & (1u << mode))) {
+ said_modes |= 1u << mode;
+ say("hakios: cellular: %s asked for signal mode %ld\n", name, mode);
+ }
+ if (cellular && sysctl_int("kern.hakios.cellular_registered") > 0 && mode != cellular_active_mode) {
+ wanted = cellular_active_mode;
+ }
+ original_set_signal_mode(self, sel, wanted);
+}
+
+static void
+signal_view_hook(void)
+{
+ static const char *const classes[] = { "_UIStatusBarCellularSignalView", "_UIStatusBarSignalView" };
+
+ for (unsigned c = 0; c < sizeof(classes) / sizeof(classes[0]); c++) {
+ Class cls = objc_getClass(classes[c]);
+ Method method = cls ? class_getInstanceMethod(cls, sel_registerName("setSignalMode:")) : NULL;
+
+ if (method == NULL) {
+ say("hakios: cellular: no -[%s setSignalMode:]\n", classes[c]);
+ continue;
+ }
+ original_set_signal_mode = (void (*)(id, SEL, long))method_getImplementation(method);
+ method_setImplementation(method, (IMP)set_signal_mode);
+ say("hakios: cellular: -[%s setSignalMode:] replaced (types \"%s\"): active while the kernel says registered\n",
+ classes[c], method_getTypeEncoding(method));
+ return; /* the base class's method serves the subclasses */
+ }
+}
+
static void
cellular_hook(void)
{
+ signal_view_hook();
{
const char *service_selector = "_updateServiceItem:withData:SIMInfo:otherSIMInfo:serviceStringGetter:serviceStringSetter:"
"serviceCrossfadeStringGetter:serviceCrossfadeStringSetter:serviceContentTypeGetter:serviceContentTypeSetter:"