Port Wallace Toolbox and Project Lycan Qualcomm features to engmenu
This commit is contained in:
1 parent
8ae2dd3b39
commit
6d31efd796
20 files changed
+2021
-132
No files matched your search
@@ -25,7 +25,7 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`2
|
||||
- Uses a lightweight cross-compiled **Xlibre** server with `modesetting` KMS, partial-rectangle `ShadowFB` SPI updates, and zero Wayland overhead.
|
||||
- **Patched `dwm`** provides a `240x320` vertical bottom-stack (`bstack`) layout, a 24px top status bar, a transparent `"Menu"` / `"Names"` desktop softkey bar, a Conky desktop clock and status widget (which refreshes automatically when changing time, timezone, or wallpaper, or when logging out), and `< 2 ms` handling of physical slider (`SW_LID`) and wake keys.
|
||||
2. **Preloaded resident DWM plugins (`< 2 ms` wakeup)**:
|
||||
- Core phone applications (`dmenu`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `passcode`, `modem`, `networks`, `ringtones`, `wallpapers`, `music`, `sip`, `email`, `irc`, `tox`, `smallweb`, `gps`, `locker`) run as preloaded resident daemons (`dwm-plugin <name> --preload`) that sleep at 0% CPU and open instantaneously over FIFO/socket IPC.
|
||||
- Core phone applications (`dmenu`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `passcode`, `modem`, `networks`, `ringtones`, `wallpapers`, `music`, `sip`, `email`, `irc`, `tox`, `smallweb`, `webarchy`, `gps`, `privacy`, `locker`) run as preloaded resident daemons (`dwm-plugin <name> --preload`) that sleep at 0% CPU and open instantaneously over FIFO/socket IPC.
|
||||
- All UI elements — including the `dunst` notification daemon (`bananarchy-sync-dunst-theme`) — share the **NeoUI SDK (`libneoui.so` + `/usr/include/neoui.h`)** and a single **XRDB theming engine** (`~/.xthemes/*.xth` -> `~/.Xresources`) with 20 preinstalled color schemes, proportional font sizing (`theme.baseFontSize`), and live reload without restarting X11. NeoUI exposes both C++20 classes and a C-compatible FFI (`neoui_*`) for building custom native or scripted (`yabasic` via `~/Projects/neoui.yab`, `~/Projects/neoui_demo.yab`, and `~/Projects/bulls_cows.yab`, paired with **NeoNet** in `~/Projects/neonet.yab` and `~/Projects/neonet_demo.yab` for `libcurl` HTTP/HTTPS and TCP/TLS/UDP socket networking) `240x320` GUI applications — see [SDK.md](./SDK.md) for the complete API reference and examples.
|
||||
3. **First-class terminal (`st`) and 6-mode `fcitx5-t9` keypad input**:
|
||||
- `st` is patched with HarfBuzz OpenType ligature shaping (`Fira Code` default) and live `.Xresources` reload.
|
||||
@@ -122,7 +122,7 @@ You can switch layouts, focus, and workspaces using the **Window management menu
|
||||
- `Mod4+Shift+q`: close the focused window.
|
||||
|
||||
#### 3.1.2 Preloaded native DWM applications
|
||||
All twenty-four phone applications are compiled as shared-object plugins (`/usr/lib/dwm/plugins/*.so`), preloaded at `dwm` startup, and awakened over `/tmp/dwm_plugin_<name>.fifo` in `< 2 ms`:
|
||||
All twenty-five phone applications are compiled as shared-object plugins (`/usr/lib/dwm/plugins/*.so`), preloaded at `dwm` startup, and awakened over `/tmp/dwm_plugin_<name>.fifo` in `< 2 ms`:
|
||||
|
||||
1. **System and context menus (`dmenu.so` / `dmenu` / `xdmenu`)**:
|
||||
- **Open / close**: press **Left softkey (`Menu`)** for the **System menu** or **Right softkey (`Back`)** inside an application for its **Context menu**; press the same softkey or `Escape` to close.
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
### Keypad-first user experience and native DWM plugins
|
||||
Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs a suite of 25 preloaded C/C++ plugins inside DWM that sleep at 0% CPU and open in `< 2 ms`:
|
||||
- **System and context menus (`dmenu`)**: instant full-screen 10-line vertical menus with live T9 filtering, built-in submenus, and hardware toggles.
|
||||
- **Passcode-based fullscreen phone locker (`xlocker`), GUI passcode configurator (`xpasscode`), and Duress Mode**: zero-bypass `240x320` fullscreen numeric passcode lock screen verified against the current user's system shadow password (`/usr/bin/bananarchy-verify-passcode`), blocking all desktop, menu, drawer, terminal, and power actions while locked and automatically handing off the display only during incoming calls. Includes a NeoUI **Passcode Configurator (`xpasscode` / `passcode.so`)** in `Config -> Passcode` to change the real Linux user password (`user`, any numeric length `>= 4` digits) and configure a separate **Duress Passcode**. Entering the duress passcode on the lock screen switches the session into **Duress Mode** (`/tmp/duress_home` blank profile with no contacts, SMS, call logs, or personal files, microSD unmounted and disabled, `xfiles` clamped to the profile directory, Passcode/Privacy Center/Engineering Menu/Tox/IRC/SIP/`st` terminal hidden and blocked, `*#06#` displaying a session-persistent random Luhn-valid IMEI derived from the device's TAC, and theme/wallpaper locked to `NordFrost.xth` and `nordic-peaks.png` until poweroff or reboot).
|
||||
- **Passcode-based fullscreen phone locker (`xlocker`), GUI passcode configurator (`xpasscode`), and Duress Mode**: zero-bypass `240x320` fullscreen numeric passcode lock screen verified against the current user's system shadow password (`/usr/bin/bananarchy-verify-passcode`), blocking all desktop, menu, drawer, terminal, and power actions while locked and automatically handing off the display only during incoming calls. Includes a NeoUI **Passcode Configurator (`xpasscode` / `passcode.so`)** in `Config -> Passcode` to change the real Linux user password (`user`, any numeric length `>= 4` digits) and configure a separate **Duress Passcode**. Entering the duress passcode on the lock screen switches the session into **Duress Mode** (`/tmp/duress_home` blank profile with no contacts, SMS, call logs, or personal files, microSD unmounted and disabled, `xfiles` clamped to the profile directory, Passcode/Privacy Center/Tox/IRC/SIP/`st` terminal hidden and blocked, `*#06#` displaying a session-persistent random Luhn-valid IMEI derived from the device's TAC, and theme/wallpaper locked to `NordFrost.xth` and `nordic-peaks.png` until poweroff or reboot).
|
||||
- **Privacy Center (`xprivacy` / `privacy` / `privacy.so`) and `/usr/bin/bananarchy-privacy-ctl`**: 5-tab NeoUI privacy and tunneling control center (`1:Tor`, `2:Warp`, `3:OVPN`, `4:GS`, `5:WG`, hidden and disabled in Duress Mode) with zero background CPU or battery consumption when services are turned off:
|
||||
- **Tor (`1:Tor`)**: start/stop the Tor anonymity daemon (`SocksPort 9050`, `TransPort 9040`, `DNSPort 9053`) and transparently route all native phone traffic and/or Wi-Fi hotspot (`10.42.0.0/24`) and USB-tethered (`usb0`) traffic through Tor.
|
||||
- **GS-Warp (`2:Warp`)**: start/stop the GSocket-tunneled OpenVPN client (`gs-warp` / `gs-warp-simple.sh` over `tun_gswarp`), configure a custom GSocket secret string (defaulting to the MD5 of the selected `.ovpn` profile), and route native and/or Wi-Fi/USB-tethered traffic through it.
|
||||
|
||||
@@ -43,6 +43,8 @@ permit nopass :wheel as root cmd /usr/bin/bananarchy-verify-passcode
|
||||
permit nopass :wheel as root cmd bananarchy-verify-passcode
|
||||
permit nopass :wheel as root cmd /usr/bin/bananarchy-engmenu-exec
|
||||
permit nopass :wheel as root cmd bananarchy-engmenu-exec
|
||||
permit nopass :wheel as root cmd /usr/bin/bananarchy-engmenu-ctl
|
||||
permit nopass :wheel as root cmd bananarchy-engmenu-ctl
|
||||
permit nopass :wheel as root cmd /usr/bin/bananarchy-bt-obex
|
||||
permit nopass :wheel as root cmd bananarchy-bt-obex
|
||||
permit nopass :wheel as root cmd /usr/bin/bananarchy-privacy-ctl
|
||||
|
||||
@@ -45,6 +45,11 @@ if command -v iw >/dev/null 2>&1; then
|
||||
iw dev wlan0 set power_save on 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Restore any persistent Engineering Menu Wi-Fi/BT MAC and IMEI override state
|
||||
if [ -x /usr/bin/bananarchy-engmenu-ctl ]; then
|
||||
/usr/bin/bananarchy-engmenu-ctl apply-boot >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
# Automount microSD card if present at boot (unbinds 7864900.sdhci when slot is empty)
|
||||
if [ -x /usr/bin/sxmo_sdcard.sh ]; then
|
||||
/usr/bin/sxmo_sdcard.sh automount boot >/dev/null 2>&1 &
|
||||
|
||||
+1072
File diff suppressed because it is too large.
Load diff
@@ -20,6 +20,9 @@ on() {
|
||||
rc-update add bluetooth
|
||||
fi
|
||||
sleep 0.4
|
||||
if [ -s /etc/bananarchy/bt_mac ] && [ -x /usr/bin/bananarchy-engmenu-ctl ]; then
|
||||
/usr/bin/bananarchy-engmenu-ctl apply-boot >/dev/null 2>&1 || true
|
||||
fi
|
||||
timeout 2 bluetoothctl power on >/dev/null 2>&1 || true
|
||||
|
||||
bt_name=""
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
libtoxcore.so.2.23.0
|
||||
libtoxcore.so.2.24.0
|
||||
Executable
BIN
Binary file not shown.
@@ -1130,14 +1130,85 @@ PY
|
||||
imei1=""
|
||||
imei2=""
|
||||
imei_sv=""
|
||||
if [ -s /tmp/bananarchy_imei_override ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /tmp/bananarchy_imei_override 2>/dev/null || true
|
||||
imei1="${IMEI1:-}"
|
||||
imei2="${IMEI2:-}"
|
||||
elif [ -s /var/lib/bananarchy/imei_override ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /var/lib/bananarchy/imei_override 2>/dev/null || true
|
||||
imei1="${IMEI1:-}"
|
||||
imei2="${IMEI2:-}"
|
||||
fi
|
||||
if detect_qmicli_modem; then
|
||||
dms_ids="$($QMICLI_MODEM --dms-get-ids 2>/dev/null || true)"
|
||||
imei1="$(printf "%s\n" "$dms_ids" | sed -n "s/.*IMEI: '\([0-9]\{14,16\}\)'/\1/p" | head -n1)"
|
||||
[ -z "$imei1" ] && imei1="$(printf "%s\n" "$dms_ids" | sed -n "s/.*IMEI: '\([0-9]\{14,16\}\)'/\1/p" | head -n1)"
|
||||
imei_sv="$(printf "%s\n" "$dms_ids" | sed -n "s/.*IMEI SV: '\([^']*\)'/\1/p" | head -n1)"
|
||||
fi
|
||||
if [ -z "$imei1" ]; then
|
||||
imei1="$(mmcli -m any -K 2>/dev/null | awk -F': ' '/modem\.3gpp\.imei/ {print $2; exit}')"
|
||||
fi
|
||||
# Decode NV 550 (SIM1) and context1/550 (SIM2) from tunning tar partition if present
|
||||
if { [ -z "$imei1" ] || [ -z "$imei2" ]; } && [ -e /dev/disk/by-partlabel/tunning ] && command -v python3 >/dev/null 2>&1; then
|
||||
eval "$(python3 - /dev/disk/by-partlabel/tunning << 'PY' 2>/dev/null || true
|
||||
import sys, tarfile
|
||||
def dec(d):
|
||||
if not d or len(d) < 9 or d[0] != 0x08 or (d[1] & 0x0F) != 0x0A: return ""
|
||||
s = str((d[1] >> 4) & 0x0F) + "".join(f"{b & 0x0F}{(b >> 4) & 0x0F}" for b in d[2:9])
|
||||
return s if s.isdigit() and len(s) == 15 else ""
|
||||
try:
|
||||
with tarfile.open(sys.argv[1], "r:*") as tf:
|
||||
for m in tf.getmembers():
|
||||
n = m.name.lstrip("./")
|
||||
if n == "nvm/num/550":
|
||||
v = dec(tf.extractfile(m).read())
|
||||
if v: print(f"TUN1={v}")
|
||||
elif n == "nvm/context1/550":
|
||||
v = dec(tf.extractfile(m).read())
|
||||
if v: print(f"TUN2={v}")
|
||||
except Exception:
|
||||
pass
|
||||
PY
|
||||
)"
|
||||
[ -z "$imei1" ] && [ -n "${TUN1:-}" ] && imei1="$TUN1"
|
||||
[ -z "$imei2" ] && [ -n "${TUN2:-}" ] && imei2="$TUN2"
|
||||
fi
|
||||
# Decode IMEI1 (0x88) and IMEI2 (0x108) from rf_nv partition (nokia-sparkler, nokia-leo, etc.)
|
||||
if { [ -z "$imei1" ] || [ -z "$imei2" ]; } && { [ -e /dev/disk/by-partlabel/rf_nv ] || [ -e /dev/disk/by-partlabel/rfnv ]; } && command -v python3 >/dev/null 2>&1; then
|
||||
rfnv_dev="/dev/disk/by-partlabel/rf_nv"
|
||||
[ -e "$rfnv_dev" ] || rfnv_dev="/dev/disk/by-partlabel/rfnv"
|
||||
eval "$(python3 - "$rfnv_dev" << 'PY' 2>/dev/null || true
|
||||
import sys
|
||||
SIGVAL = b"IEMI"
|
||||
SIGPOS = 0x80
|
||||
SIGVAL2 = b"\x92\x8a\x9a\x92"
|
||||
SIGPOS2 = SIGPOS + 0x80
|
||||
def dec(d):
|
||||
if not d or len(d) < 9: return ""
|
||||
inv = bytes(((b >> 4) | ((b & 15) << 4)) for b in d[:9])
|
||||
s = inv.hex()[3:]
|
||||
return s if len(s) == 15 and s.isdigit() else ""
|
||||
try:
|
||||
with open(sys.argv[1], "rb") as fh:
|
||||
fh.seek(SIGPOS)
|
||||
v1 = fh.read(4)
|
||||
fh.seek(SIGPOS2)
|
||||
v2 = fh.read(4)
|
||||
if v1 == SIGVAL and v2 == SIGVAL2:
|
||||
fh.seek(SIGPOS + 8)
|
||||
i1 = dec(fh.read(9))
|
||||
fh.seek(SIGPOS2 + 8)
|
||||
i2 = dec(fh.read(9))
|
||||
if i1: print(f"RFNV1={i1}")
|
||||
if i2: print(f"RFNV2={i2}")
|
||||
except Exception:
|
||||
pass
|
||||
PY
|
||||
)"
|
||||
[ -z "$imei1" ] && [ -n "${RFNV1:-}" ] && imei1="$RFNV1"
|
||||
[ -z "$imei2" ] && [ -n "${RFNV2:-}" ] && imei2="$RFNV2"
|
||||
fi
|
||||
# Query secondary AT channel (/dev/wwan0at1) if present
|
||||
if [ -c "/dev/wwan0at1" ]; then
|
||||
at_out="$(timeout 1 sh -c '
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
libtoxcore.so.2.23.0
|
||||
libtoxcore.so.2.24.0
|
||||
BIN
Binary file not shown.
@@ -55,6 +55,7 @@ if command -v docker >/dev/null 2>&1; then
|
||||
[ ! -f "$BASE_DIR/prebuilt/sxmo-x11/usr/bin/dwm" ] || \
|
||||
[ ! -f "$BASE_DIR/prebuilt/sxmo-x11/usr/bin/st" ] || \
|
||||
[ ! -f "$BASE_DIR/prebuilt/sxmo-x11/usr/lib/dwm/plugins/dmenu.so" ] || \
|
||||
[ ! -f "$BASE_DIR/prebuilt/sxmo-x11/usr/lib/dwm/plugins/engmenu.so" ] || \
|
||||
[ ! -f "$BASE_DIR/prebuilt/sxmo-x11/usr/lib/dwm/plugins/privacy.so" ]; then
|
||||
echo " -> Missing prebuilt sxmo-x11/NeoUI artifacts; running scripts/build-sxmo-x11.sh..."
|
||||
"$BASE_DIR/scripts/build-sxmo-x11.sh"
|
||||
@@ -170,6 +171,8 @@ if [ -d "$BASE_DIR/prebuilt/sxmo-x11/usr" ]; then
|
||||
fi
|
||||
chown 0:0 "$TARGET_ROOTFS/usr/bin/bananarchy-engmenu-exec" 2>/dev/null || true
|
||||
chmod 4755 "$TARGET_ROOTFS/usr/bin/bananarchy-engmenu-exec" 2>/dev/null || true
|
||||
chown 0:0 "$TARGET_ROOTFS/usr/bin/bananarchy-engmenu-ctl" 2>/dev/null || true
|
||||
chmod 0755 "$TARGET_ROOTFS/usr/bin/bananarchy-engmenu-ctl" 2>/dev/null || true
|
||||
if [ -d "$BASE_DIR/prebuilt/games/usr" ]; then
|
||||
cp -af "$BASE_DIR/prebuilt/games/usr/." "$TARGET_ROOTFS/usr/"
|
||||
fi
|
||||
|
||||
+840
-126
File diff suppressed because it is too large.
Load diff
@@ -2596,12 +2596,31 @@ inline DeviceImeis queryDeviceImeis() {
|
||||
return cachedDuress;
|
||||
}
|
||||
|
||||
const char* kOverrideImeiFile = "/tmp/bananarchy_imei_override";
|
||||
std::string ovrImei1;
|
||||
std::string ovrImei2;
|
||||
{
|
||||
std::ifstream oin(kOverrideImeiFile);
|
||||
std::string oline;
|
||||
while (std::getline(oin, oline)) {
|
||||
if (oline.rfind("IMEI1=", 0) == 0) {
|
||||
ovrImei1 = trimStr(oline.substr(6));
|
||||
} else if (oline.rfind("IMEI2=", 0) == 0) {
|
||||
ovrImei2 = trimStr(oline.substr(6));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!cached.imei1.empty() && !cached.imei2.empty()) {
|
||||
if (!ovrImei1.empty()) cached.imei1 = ovrImei1;
|
||||
if (!ovrImei2.empty()) cached.imei2 = ovrImei2;
|
||||
return cached;
|
||||
}
|
||||
|
||||
DeviceImeis res = cached;
|
||||
queryQrtrDmsImeis(res);
|
||||
if (!ovrImei1.empty()) res.imei1 = ovrImei1;
|
||||
if (!ovrImei2.empty()) res.imei2 = ovrImei2;
|
||||
|
||||
if (res.imei1.empty() || res.imei2.empty()) {
|
||||
std::string helperOut = runCaptureCmd(
|
||||
|
||||
Reference in new issue
Block a user