Skip to content

StevenBlock v2.0

Latest

Choose a tag to compare

@mikropsoft mikropsoft released this 11 Nov 07:43
· 3 commits to main since this release
060f98e

๐Ÿ›ก๏ธ StevenBlock v2.0

v2.0 keeps everything v1.0 does and removes its biggest wait: the reboot. Changes now go live the moment you make them, lists can be stacked, updates can run on a schedule, and the whole module checks and repairs itself. Your list, rules and settings are carried over automatically.

๐Ÿš€ Highlights

  • โšก Live apply โ€” new lists and rules take effect without a reboot whenever your device allows it, with an honest โ€œReboot requiredโ€ fallback.
  • โž• Add-ons โ€” stack 14 optional lists (content categories, security feeds, device tracker lists) on top of your main list.
  • ๐Ÿ”— Your own lists โ€” add up to 8 custom HTTPS lists by address.
  • ๐Ÿ”„ Auto-update โ€” optional daily, 3-day or weekly schedule that only downloads what changed.
  • โœณ๏ธ Wildcard allow rules โ€” *.example.com allows a domain together with all of its subdomains.
  • ๐Ÿ” Domain lookup โ€” find out whether and why a domain is blocked, search by keyword and fix it with one tap.
  • ๐Ÿ“ฅ Rule import and export โ€” move your rules in and out as plain text.
  • ๐Ÿฉบ Health Check and ๐Ÿ› ๏ธ Repair โ€” verify the whole setup and rebuild it from the cache.
  • ๐Ÿ” Private DNS guard โ€” your Private DNS provider is never blocked.
  • ๐Ÿ—œ๏ธ Compressed downloads โ€” about 75โ€“79% less data in our measurements.

โšก Live apply

  • โœ๏ธ The hosts file is written in place into the file that is already mounted, so Android sees the new content immediately.
  • ๐Ÿ” After every change StevenBlock compares the live /system/etc/hosts with its own file and only then reports โ€œActive nowโ€.
  • ๐Ÿ”— If Android is using a stale copy and no other module provides a hosts file, StevenBlock bind-mounts its own file right away instead of waiting for the next boot.
  • ๐Ÿ” If the change can't be made live โ€” another module owns the hosts file, or the mount point can't be replaced โ€” the familiar reboot banner appears. Nothing is ever reported as applied when it isn't.
  • ๐Ÿงฑ Settings โ†’ โšก Live apply turns it off and restores the v1.0 behaviour: atomic swap, then reboot.
  • ๐Ÿงฝ The DNS cache flush now runs after a live change, when it actually matters, instead of before a reboot.
  • ๐ŸŸข Disabling and enabling the blocker is live as well.

โž• Add-ons and custom lists

  • ๐ŸŽญ Content categories from StevenBlack: Fake news, Gambling, Adult content, Social networks.
  • ๐Ÿ” Security from HaGeZi: Encrypted DNS bypass, Threat Intelligence.
  • ๐Ÿ“ฑ Device & app trackers from HaGeZi: Xiaomi, Samsung, Huawei, OPPO & Realme, Vivo, Amazon, TikTok, Microsoft.
  • โœจ The tracker add-on that matches your device's brand is marked For your device.
  • ๐Ÿงฎ Lists are merged and de-duplicated across all sources. Every add-on shows how many of its entries are new on top of your main list.
  • ๐Ÿงฉ Flip several switches, review the changes โ€” including warnings for large or strict add-ons โ€” and apply them in one task with per-list progress (โ€œ2 of 3โ€).
  • ๐Ÿ”— Custom lists accept hosts files, plain domain lists and simple ||domain^ lists, up to 64 MB each.
  • ๐Ÿ›Ÿ If a new add-on can't be downloaded, nothing changes. If an existing add-on can't be refreshed during an update, its previous version stays in use and you're told.
  • โ™ป๏ธ Switching the main list keeps your add-ons and only downloads the new main list.

๐Ÿ”„ Auto-update

  • ๐Ÿ•’ Off by default. Daily, every 3 days or weekly.
  • ๐Ÿ˜ด One sleeping shell process, started only while the setting is on, wakes up every 15 minutes to see whether a check is due.
  • ๐Ÿ”Ž A check reads the first 8 KB of each list. Full downloads only happen for lists that changed.
  • ๐Ÿ›‘ After a failed attempt it waits about an hour.
  • โšก Updated lists go live without a reboot.

๐Ÿงฉ Domain rules

  • โœณ๏ธ Wildcard allow rules: *.example.com covers the domain and every subdomain.
  • โš–๏ธ Contradictions are caught, including wildcard ones: blocking a domain that a wildcard allows, or allowing a wildcard that covers one of your block rules.
  • ๐Ÿ” Check this domain explains whether a domain is blocked, by which list, add-on or rule, how many of its subdomains are blocked, and offers the matching fix. A keyword lists the blocked domains that contain it.
  • ๐Ÿ“ฅ Import rules understands allow / block lines, hosts lines, +domain / -domain and plain domains, previews how many entries are valid, and can add to or replace your rules. The whole import is one rebuild and is rolled back if it fails.
  • ๐Ÿ“ค Export rules shows every rule as copyable text.
  • ๐Ÿ”Ž A filter box appears once a rule list gets long.
  • โฑ๏ธ Quick rule changes that arrive at the same time now wait for each other instead of failing with โ€œAnother task is still runningโ€.

๐Ÿฉบ Health Check, Repair and status

  • ๐Ÿฉบ Health Check verifies the hosts file line by line and by checksum, the mount, conflicting modules, the cache, list age, the scheduler, the downloader, the connection to the list server, BusyBox, free storage and your Private DNS provider.
  • ๐Ÿ“‹ Report turns status, health check and the latest log lines into text for a bug report.
  • ๐Ÿ› ๏ธ Repair rebuilds the hosts file from the cache, records a new checksum and mounts the file if needed โ€” without downloading anything.
  • ๐Ÿ” Private DNS guard: when Android's Private DNS uses a provider hostname, that hostname is left out of the blocklist. Your own Block rule still wins.
  • ๐Ÿ“Š Check Status now also shows add-ons, auto-update, live apply, the Private DNS provider and the hosts file size.
  • ๐Ÿ•’ The overview warns when your lists are more than a week old.

๐Ÿ–ฅ๏ธ WebUI

  • โš™๏ธ New Settings sheet for live apply and auto-update.
  • โž• New Add-ons section with switches, groups and an apply bar.
  • ๐Ÿ“œ Logs can be filtered by warnings or errors and copied.
  • ๐Ÿท๏ธ Overview tags for live apply, auto-update and the Private DNS guard.
  • โฌ‡๏ธ Progress shows which list is being downloaded and its real size, even for compressed transfers.
  • โŒจ๏ธ Dialogs keep keyboard focus inside them, and every control has an accessible name.
  • ๐Ÿ“ฑ Layout fixes for narrow screens down to 320 px.
  • ๐ŸŽจ Same look, same emoji, same dark and light themes.

๐Ÿ’ป Command line

  • ๐Ÿงพ Every WebUI action is a documented command of sb.sh with one line of JSON as output and a meaningful exit status.
  • โณ New wait command blocks until the running task has finished โ€” ideal for scripts.
  • โ“ New help command.

๐Ÿš„ Performance

Measured on the same x86-64 test machine with BusyBox 1.36 and the real HaGeZi Ultimate list (614,141 entries); medians of three runs. Phones are slower, but the ratios carry over.

v1.0 v2.0
Install HaGeZi Ultimate 5.1 s 5.1 s
Add a block rule 1.2 s 1.2 s
status call 29 ms 20 ms
lists call 36 ms 18 ms
Data directory 55.6 MB 17.1 MB
Download size of HaGeZi Ultimate 21.2 MB 4.5 MB
  • ๐Ÿ—œ๏ธ curl downloads are compressed in transit: 75โ€“79% less data for the three lists we measured.
  • ๐Ÿ—‚๏ธ Backups are compressed and only taken before list changes, which is where most of the storage saving comes from.
  • ๐Ÿด Status and list requests start far fewer helper processes.
  • ๐Ÿงน The list normalizer is about 25% faster on its own (HaGeZi Ultimate: 5.0 s โ†’ 3.8 s) with byte-identical output on all 22 real lists we compared. That time is reinvested in the new checksums, merging and verification, so installing a list takes about as long as before.
  • ๐Ÿงต Building the hosts file is split into a merge step, which only runs when your lists change, and a streaming step for rule changes that needs about 12 MB of memory regardless of list size. A rule change on a 1.6-million-entry setup takes about 5 seconds on the test machine.
  • ๐Ÿ”— The applied-state check recognises the mounted file by identity before falling back to a byte comparison.

๐Ÿ› Fixed

  • ๐Ÿงฐ Requests from the browser WebUI ran on Android's system shell and tools instead of the root manager's BusyBox, so they could behave differently from every other code path or fail on devices without a system awk. Every process now switches to BusyBox on its own.
  • ๐Ÿ”ข Task results could stop appearing in the WebUI after a reinstall, because the task counter restarted while the WebUI remembered a higher number. The counter is now time-based.
  • ๐Ÿ—‚๏ธ Backups 2 and 3 were kept but never used. Recovery now tries all three.
  • ๐Ÿ” A first download that failed five times stayed failed until you retried by hand. It is now retried at every boot.
  • ๐ŸŒ Domains whose name starts with ip6- were silently dropped from every list. Only real system names are skipped now.
  • ๐Ÿ•’ For lists whose server sends neither an ETag nor a date header, the update check didn't fall back to Last-Modified and downloaded them again every time.
  • ๐Ÿงพ Verification only counted block entries, so stray lines in the hosts file went unnoticed. The line count is now exact, the health check validates every line, and a checksum is compared at every boot.
  • ๐Ÿ”— A โ€œconflictโ€ or โ€œmount failedโ€ state could stick for the rest of the session after the hosts file had been applied.
  • ๐Ÿงญ A leftover KernelSU or APatch file on a Magisk device could make StevenBlock report the wrong root manager.
  • โœ‚๏ธ Cancelling a BusyBox wget download left its TLS helper running for a moment.
  • ๐Ÿ“ Two tasks writing to the log at the same moment could clobber each other while the log was being trimmed.
  • ๐Ÿงฎ A stored value that ended in = lost that character when it was read back. Settings and state files are now parsed without field splitting.
  • ๐Ÿ“ญ A list server that answers a size probe with HTTP 416 is handled instead of being reported as an error.
  • ๐Ÿ“„ README.md referred to a LICENSE file that was missing from the zip. It is included now.

๐Ÿ”’ Security

  • โœ‹ A multi-line argument passed from a root shell or the root manager bridge could slip an unvalidated line into a rule list. Arguments with line breaks are rejected, and rule lists are written by a single validating engine.
  • ๐Ÿ” curl is restricted to HTTPS, including redirects.
  • ๐Ÿ˜ Downloads are capped at 64 MB, both by the announced size and by the size on disk.
  • ๐Ÿ“ฎ The browser WebUI sends its token in the request body with POST. Host, Referer and the request method are checked, and API responses carry X-Frame-Options, nosniff and no-store.
  • ๐Ÿ–ผ๏ธ In a browser, the WebUI refuses to run inside another page.
  • ๐Ÿงฑ Identifiers, settings values and custom list addresses are validated against strict patterns before they are used. Custom lists must be HTTPS addresses with a real domain name.
  • ๐Ÿงพ The session token is created with private permissions from the start.
  • ๐Ÿงจ Background helpers started by a download are stopped together with it.

๐Ÿ” Changed

  • ๐Ÿงพ The hosts file no longer has a comment header. It contains the two localhost lines and block entries only.
  • ๐Ÿ—‚๏ธ Backups are compressed and created before list changes, not before rule changes.
  • ๐Ÿ”„ โ€œUpdate Current Listโ€ is now Update Lists and covers add-ons too.
  • ๐Ÿงฉ The minimum number of valid entries is set per list: 1,000 for main lists, lower for the small add-ons.
  • ๐Ÿ“œ The update manifest now points to CHANGELOG.md.
  • ๐Ÿงน CHANGELOG.md, LICENSE and update.json are not copied to the device.
  • ๐Ÿ’ฌ Messages say โ€œActive nowโ€ when a change is live and โ€œReboot to applyโ€ only when it isn't.

โฌ†๏ธ Upgrading from v1.0

  • โ™ป๏ธ Your main list, domain rules and enabled or disabled state are kept. The cached list is moved to the new layout, so nothing is downloaded again.
  • ๐Ÿ”Œ All v1.0 commands and their JSON fields still exist. New fields were added, none were removed.
  • โšก Live apply starts on, auto-update starts off.
  • ๐Ÿ” Reboot once after installing the update.

๐Ÿงช Quality

  • ๐Ÿงช About 900 automated backend checks, run in each of five simulated environments: Magisk-, KernelSU- and APatch-style setups with BusyBox ash, BusyBox wget instead of curl, and a setup without any root manager BusyBox (mksh, toybox, one-true-awk).
  • ๐Ÿงฎ Every embedded awk program is unit-tested against four awk implementations.
  • ๐Ÿงซ Covered: fresh, offline, recovery and upgrade installs, every command, download failures, cancellation, concurrency, boot-time repair, the scheduler, the local server and its request checks, hostile input, and live apply on bind mounts, overlay mounts, stale copies and conflicting modules.
  • ๐ŸŒ End-to-end browser tests of the WebUI in both the local-server mode and the root-manager bridge mode.
  • ๐Ÿ“ฅ Real downloads from GitHub for the main lists and all add-ons. hBlock's server couldn't be reached from the test environment, so that list was exercised with a simulated copy only.
  • โš ๏ธ These tests ran in a simulated Android environment on Linux. A run on a physical device is not part of them.

๐Ÿ›ก๏ธ StevenBlock v1.0

StevenBlock was rewritten from scratch, so this brand-new architecture started a fresh version line at v1.0.

  • ๐Ÿ–ฅ๏ธ Brand-new WebUI for lists, updates, domain rules, status and logs.
  • โš™๏ธ Fully automatic install with root manager detection, conflict checks and cleanup of older versions.
  • ๐Ÿ”‹ No permanent background processes; the local WebUI server only runs while you use it.
  • ๐Ÿ›Ÿ Validated downloads, backups, atomic writes and post-write verification with automatic restore.
  • ๐Ÿงช Applied-state check, and a direct mount when the root manager doesn't mount the hosts file.
  • ๐ŸŽฏ Seven blocklists: StevenBlack Main, hBlock and HaGeZi Light, Normal, Pro, Pro++ and Ultimate.
  • ๐Ÿงฉ Allow and block rules for single domains.
  • ๐Ÿ”’ Local only, token-protected, no telemetry.
  • โฌ†๏ธ Replaced the terminal menu, volume-key installer and Energized lists of v5.0.