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: force the cellular signal icon -- iOS hides it without CommCenter (not here), so once the kernel says the modem is up the status bar shows the kernel's bars, and when the reading is zero just after registration it derives bars from the dBm (or shows one) so the icon is always present; the service item already carries the operator name

shimoku7428ec11c80923
diff --git a/prebuilt/SHA256SUMS b/prebuilt/SHA256SUMS
index 5cd4070..afeb543 100644
--- a/prebuilt/SHA256SUMS
+++ b/prebuilt/SHA256SUMS
@@ -1,4 +1,4 @@
-Built 2026-10-25 19:18 from this tree.
+Built 2026-10-25 19:23 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
-84f517b8bde52a6d376e17a325127c27193cae8106d8da634a5f77bb0445c617 prebuilt/userland/libhakios.sb.dylib
+33306f04783b9f6ac818f0beaaa68a4483a1b185f0a174f369fd6ea5002b5ef4 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 19fd4e2..8f3e1c1 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 08619db..c26e0e8 100644
--- a/userland/src/inject_sb.c
+++ b/userland/src/inject_sb.c
@@ -288,24 +288,43 @@ static void
update_signal_item(id self, SEL sel, long item, void *data, id sim, void *getter, void *setter)
{
int up = sysctl_int("kern.hakios.cellular_up"), registered = sysctl_int("kern.hakios.cellular_registered");
- int bars = sysctl_int("kern.hakios.cellular_bars");
+ int bars = sysctl_int("kern.hakios.cellular_bars"), dbm = sysctl_int("kern.hakios.cellular_dbm");
+ int shown;
cellular_aggregator = self;
if (original_update_signal_item) {
original_update_signal_item(self, sel, item, data, sim, getter, setter);
}
if (cellular_said++ < 8) {
- say("hakios: cellular: signal item %ld: data %p, SIM info %p, getter %p, setter %p; the kernel says up %d registered %d bars %d\n",
- item, data, (void *)sim, getter, setter, up, registered, bars);
+ say("hakios: cellular: signal item %ld: data %p, SIM info %p, getter %p, setter %p; the kernel says up %d registered %d bars %d dbm %d\n",
+ item, data, (void *)sim, getter, setter, up, registered, bars, dbm);
}
- if (up > 0 && registered > 0 && bars >= 0 && bars <= 5 && setter != NULL && data != NULL) {
- BLOCK_CALL(setter, void (*)(void *, void *, int), data, bars);
+ /*
+ * Force the signal item on. iOS hides it unless its own cellular stack (CommCenter, which is
+ * not here) says there is service, so the bars never appear on their own. The kernel knows
+ * the modem's state, so once it is up the item is shown here with the kernel's bars; when the
+ * kernel has a reading but zero bars (a brief "no signal" sample, or a reading just after
+ * registration) at least one bar is forced so the icon is visibly present rather than empty.
+ * modem_bars_off=1 (as a sysctl) is not honoured; set kern.hakios.cellular_up=0 to hide it.
+ */
+ shown = bars;
+ if (shown <= 0 && dbm < 0) {
+ shown = dbm >= -95 ? 4 : dbm >= -105 ? 3 : dbm >= -115 ? 2 : 1; /* derive from dBm when bars is 0 */
+ }
+ if (shown <= 0 && (up > 0 || registered > 0)) {
+ shown = 1; /* up but no reading yet: still show the icon */
+ }
+ if (shown > 5) {
+ shown = 5;
+ }
+ if (up > 0 && shown > 0 && setter != NULL && data != NULL) {
+ BLOCK_CALL(setter, void (*)(void *, void *, int), data, shown);
((void (*)(id, SEL, long, BOOL))objc_msgSend)(self, sel_registerName("_setItem:enabled:"), item, YES);
- if (bars != cellular_last_bars) {
- say("hakios: cellular: %d bars shown (item %ld)\n", bars, item);
+ if (shown != cellular_last_bars) {
+ say("hakios: cellular: %d bars shown (item %ld; kernel bars %d, %d dBm, registered %d)\n", shown, item, bars, dbm, registered);
}
}
- cellular_last_bars = bars;
+ cellular_last_bars = shown;
}
static void (*original_update_service_item)(id self, SEL sel, long item, void *data, id sim, id other, void *g1, void *s1, void *g2, void *s2,