diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bd803f..1342d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ +## v2.5.2 +- البوت لودر يطلع «مفتوح» صح حتى لو الروم أو مود إخفاء خلّى خصائص الإقلاع تقول «مقفل» (مثل أجهزة كوالكوم القديمة) +- الحالة تنقرا من البوت لودر نفسه أول، والروت يعني إن البوت لودر مفتوح +- لو الحالة مو معروفة تطلع «؟» بدل «مقفل» +- شكل جديد هادي وأيقونة رمادية، ومسافة أقل فوق وتحت + +**English** +- The bootloader shows as unlocked even when the ROM or a hiding module makes the boot properties say locked (older Qualcomm phones, for one) +- The state comes from the bootloader itself first, and root means the bootloader is unlocked +- An unknown state shows as "?" instead of "locked" +- A calm new look and a grey icon, with less empty space above and below + ## v2.5.1 - أول إصدار رسمي: الإضافة طلعت من التجريبي (Beta) - زر «حذف» لكل نسخة احتياطية في تبويب الباك أب، مع تأكيد قبل الحذف diff --git a/module/bin/fbs b/module/bin/fbs index 01f56f8..a6b7462 100755 --- a/module/bin/fbs +++ b/module/bin/fbs @@ -5,7 +5,7 @@ # (or one JSON object per line for long jobs), so all three always agree. Nothing here writes # to a partition: the only writes are backups and reports under /sdcard/FastbootStudio. -FBS_VERSION=2.5.1 +FBS_VERSION=2.5.2 # beta while the module is experimental; stable once it is not. release.yml publishes a beta # as a pre-release, the WebUI shows a Beta badge, and tools/build.sh checks module.prop agrees. FBS_CHANNEL=stable diff --git a/module/lib/detect.sh b/module/lib/detect.sh index fcbc6b0..a4764ce 100644 --- a/module/lib/detect.sh +++ b/module/lib/detect.sh @@ -63,6 +63,48 @@ storage_json() { printf null } +# Locked or unlocked, in I_DEVSTATE and I_LOCKED. Older bootloaders (Qualcomm msm89xx and the +# like) give no vbmeta.device_state, and ROMs and hiding modules set ro.boot.* to "locked" +# for Play Integrity, so the properties come last: first the kernel command line or +# bootconfig, then what the bootloader's AVB state means (orange is unlocked). Root needs a +# modified boot image, which a locked bootloader does not start, so with root it is unlocked. +boot_state() { + I_DEVSTATE=$(bootarg vbmeta.device_state) + if [ -z "$I_DEVSTATE" ]; then + case $(bootarg flash.locked) in + 0) I_DEVSTATE=unlocked ;; + 1) I_DEVSTATE=locked ;; + esac + fi + if [ -z "$I_DEVSTATE" ]; then + case $(bootarg verifiedbootstate) in + orange) I_DEVSTATE=unlocked ;; + green | yellow) I_DEVSTATE=locked ;; + esac + fi + _pstate=$(prop ro.boot.vbmeta.device_state) + if [ -z "$_pstate" ]; then + case $(prop ro.boot.flash.locked) in + 0) _pstate=unlocked ;; + 1) _pstate=locked ;; + esac + fi + [ -n "$I_DEVSTATE" ] || I_DEVSTATE=$_pstate + if [ "$I_ROOT" != unknown ] && [ "$I_DEVSTATE" != unlocked ]; then + I_DEVSTATE=unlocked + # Root on a phone the bootloader or the properties call locked: they were changed. + [ "$I_VBSTATE" != green ] || I_VBSTATE=orange + fi + if [ "$I_DEVSTATE" = unlocked ] && [ "$_pstate" = locked ]; then + I_VB_SPOOFED=true + fi + case $I_DEVSTATE in + unlocked) I_LOCKED=0 ;; + locked) I_LOCKED=1 ;; + *) I_LOCKED=$(prop ro.boot.flash.locked) ;; + esac +} + collect() { I_MODEL=$(prop ro.product.model) I_BRAND=$(prop ro.product.brand) @@ -90,15 +132,13 @@ collect() { elif [ -n "$_p" ] && [ "$_p" != "$I_VBSTATE" ]; then I_VB_SPOOFED=true fi - I_DEVSTATE=$(bootarg vbmeta.device_state) - [ -n "$I_DEVSTATE" ] || I_DEVSTATE=$(prop ro.boot.vbmeta.device_state) - I_LOCKED=$(prop ro.boot.flash.locked) + I_ROOT=$(root_manager) + boot_state rd "$R/proc/sys/kernel/osrelease"; I_KERNEL=$REPLY I_KMI=$(kmi_of "$I_KERNEL") rd "$R/sys/fs/selinux/enforce" case $REPLY in 1) I_SELINUX=Enforcing ;; 0) I_SELINUX=Permissive ;; *) I_SELINUX=$(getenforce 2>/dev/null) ;; esac - I_ROOT=$(root_manager) I_REASON=$(prop sys.boot.reason) [ -n "$I_REASON" ] || I_REASON=$(prop ro.boot.bootreason) diff --git a/module/module.prop b/module/module.prop index 993f31e..2327cb3 100644 --- a/module/module.prop +++ b/module/module.prop @@ -1,7 +1,7 @@ id=fastboot_studio_companion name=Fastboot Studio Companion -version=v2.5.1 -versionCode=251 +version=v2.5.2 +versionCode=252 author=IFOKNR description=Device check, partitions, live kernel log and SHA-256 backups for Fastboot Studio. Read-only, nothing runs at boot. Open the WebUI or press Action. updateJson=https://raw.githubusercontent.com/ifoknr/FastbootStudio-Companion/main/update.json diff --git a/module/webroot/app.js b/module/webroot/app.js index 9b9098f..5325aaf 100644 --- a/module/webroot/app.js +++ b/module/webroot/app.js @@ -160,9 +160,10 @@ function renderDevice() { const avb = $('#avbChip'); avb.textContent = vb ? 'AVB ' + vb : 'AVB ?'; avb.className = 'chip ' + (vb === 'green' ? '' : vb === 'orange' ? 'warn' : vb ? 'danger' : 'mute'); - const unlocked = i.boot.device_state ? i.boot.device_state === 'unlocked' : i.boot.locked === false; + // Not known stays "?": showing "locked" would be a guess. + const unlocked = i.boot.device_state ? i.boot.device_state === 'unlocked' : typeof i.boot.locked === 'boolean' ? !i.boot.locked : null; kv($('#bootKv'), [ - [T('boot.bootloader'), unlocked ? T('boot.unlocked') : T('boot.locked')], + [T('boot.bootloader'), unlocked === null ? '?' : unlocked ? T('boot.unlocked') : T('boot.locked')], ['SELinux', i.selinux], [T('boot.slot'), i.slot || T('boot.none')], [T('boot.layout'), [i.slot ? 'A/B' : 'A-only', i.dynamic ? 'dynamic' : 'static'].join(' · ')], diff --git a/module/webroot/demo.js b/module/webroot/demo.js index 702aef6..f06131f 100644 --- a/module/webroot/demo.js +++ b/module/webroot/demo.js @@ -22,7 +22,7 @@ ]; const info = { - fbs: '2.5.1', channel: 'stable', model: 'Demo Phone', brand: 'Demo', device: 'demo', product: 'demo_mt6789', + fbs: '2.5.2', channel: 'stable', model: 'Demo Phone', brand: 'Demo', device: 'demo', product: 'demo_mt6789', android: '14', sdk: '34', patch: '2026-08-05', build: 'DEMO-14.0.1', platform: 'mt6789', soc: 'mediatek', arch: 'arm64-v8a', slot: '_a', dynamic: true, treble: true, vndk: '34', boot: { vbstate: 'orange', device_state: 'unlocked', locked: false, spoofed: true }, @@ -158,7 +158,7 @@ const modules = { root: '/data/adb/modules', modules: [ - m('fastboot_studio_companion', 'Fastboot Studio Companion', 'v2.5.1', { webui: true, action: true }), + m('fastboot_studio_companion', 'Fastboot Studio Companion', 'v2.5.2', { webui: true, action: true }), m('systemless_hosts', 'Systemless Hosts', 'v1.2', { files: 1 }), m('adblock_plus', 'AdBlock Plus', 'v4.0', { files: 1, props: 2, scripts: ['service.sh'] }), m('google_sans_font', 'Google Sans Font', 'v3.1', { files: 46 }), diff --git a/module/webroot/i18n.js b/module/webroot/i18n.js index 60bbc20..836a87a 100644 --- a/module/webroot/i18n.js +++ b/module/webroot/i18n.js @@ -17,7 +17,7 @@ const STRINGS = { 'boot.title': 'Boot and security', 'boot.bootloader': 'Bootloader', 'boot.locked': 'locked', 'boot.unlocked': 'unlocked', 'boot.slot': 'Active slot', 'boot.layout': 'Layout', 'boot.treble': 'Treble / GSI', 'boot.none': 'none', - 'boot.spoofed': 'A hiding module changed ro.boot.verifiedbootstate. The state shown here is the one the bootloader reported.', + 'boot.spoofed': 'The ROM or a hiding module changed the boot properties (ro.boot.*) to look locked. The state shown here is the real one: from the bootloader, and root only works when it is unlocked.', 'kernel.title': 'Kernel', 'kernel.version': 'Version', 'kernel.nokmi': 'not GKI', 'kernel.patch': 'Security patch', 'kernel.android': 'Android', 'kernel.build': 'Build', @@ -92,7 +92,7 @@ const STRINGS = { 'boot.title': 'الإقلاع والحماية', 'boot.bootloader': 'البوت لودر', 'boot.locked': 'مقفول', 'boot.unlocked': 'مفتوح', 'boot.slot': 'السلوت الحالي', 'boot.layout': 'التقسيم', 'boot.treble': 'Treble / GSI', 'boot.none': 'ما فيه', - 'boot.spoofed': 'فيه مود إخفاء غيّر ro.boot.verifiedbootstate. الحالة المعروضة هنا هي اللي أرسلها البوت لودر نفسه.', + 'boot.spoofed': 'الروم أو مود إخفاء غيّر خصائص الإقلاع (ro.boot.*) عشان يبان الجوال مقفل. الحالة المعروضة هنا هي الحقيقية: من البوت لودر نفسه، والروت ما يشتغل إلا والبوت لودر مفتوح.', 'kernel.title': 'الكيرنل', 'kernel.version': 'النسخة', 'kernel.nokmi': 'مو GKI', 'kernel.patch': 'الباتش الأمني', 'kernel.android': 'أندرويد', 'kernel.build': 'البيلد', diff --git a/module/webroot/ifoknr-dark.svg b/module/webroot/ifoknr-dark.svg new file mode 100644 index 0000000..01b9552 --- /dev/null +++ b/module/webroot/ifoknr-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/webroot/ifoknr-light.svg b/module/webroot/ifoknr-light.svg new file mode 100644 index 0000000..36bd9e6 --- /dev/null +++ b/module/webroot/ifoknr-light.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/module/webroot/index.html b/module/webroot/index.html index bbe85db..4b12e1d 100644 --- a/module/webroot/index.html +++ b/module/webroot/index.html @@ -5,13 +5,17 @@