. * . \ | / . * .
* . '-- (O) --' . *
.-. / | \ .---. .
/|*|\ /|v|v|\ .-.
.-. \| | |/ .-. .-. *| |*| |* /|v|\
/|*|\ | | | /|*|\ /|v|\ | |v| | *| |*|*
\| | |/ -|*|*|- \| | |/ *| | |* *| |*| |* | | |
| | | | | | | | | [QR] | |v| | |v| | *| |v|*
-|*|*|- \| | |/ -|*|*|- *| | |* *| |*| |* | | | .-.
.-. | | | | | | | | | .-. | |v| .-. | |v| | *| |*|*/|v|\
/|*|\| | | \| | |/ | | | /|v|\*| | |*/|v|\| |*| | | | |*| | |*
| | |*|*|*|- | | | -|*|*|-*| | | | | |*| | |*| |v|* *| | | | |v|
|_|_||_|_| |_|_| |_|_| |_|_|_|_|_||_|_|_|_|_|_| |_|_|_|_|_|
..:o::::..::^::::..:::o::..::::..:::^:::..::::o:::..:::^:::..::o..
~ ~ AREOLE-DPC-HWTF :: Trichocereus bridgesii & pachanoi (SP) ~ ~
(Preview the full 256-color terminal ANSI scene anytime with cat banner.ans.)
Own your phone, silence the adware, and keep zero lock-in.
AREOLE-DPC-HWTF ("How Wait... That's Free?!") is a self-hosted, single-machine Android Provisioning Controller (DPC) and HTTP/QR console. Instead of handing management of a brand-new or freshly reset Android phone to a third-party cloud vendor—or settling for a drawer full of preloaded carrier installers, silent promo downloaders, and noisy notification popups—you run a tiny local Python server + compile your own signed Android DPC APK in about two minutes.
Scan one QR code on the factory Welcome screen (tap empty space 6 times), let Android enroll your own controller, strip bloatware across the system cleanly, optionally silence non-core app notifications by default, optionally sideload companion tools like Thingino (v0.6.0), and whenever you are done, tap Deprovision & Remove Controller to drop ownership without wiping a single photo, message, or setting.
Video Walkthrough (by WLTechBlog)

▶ Watch on YouTube: Bypassing Android Carrier Activation — Turn Discounted Pre-Paid Phones Into Awesome WiFi Tablets!
- Zero accounts, zero cloud fees, zero telemetry: Everything compiles locally, signs with a freshly generated private keystore on your own disk (
.gitignored), and runs on pure Python 3 standard library + SQLite. - Unrestricted by design: Commercial enterprise tools lock down USB debugging, app installs, Wi-Fi changes, and accounts.
AreoleDPCactively callsDevicePolicyManager.clearUserRestriction()on all 15 common lockouts (plus clears user-control locks and system update policies) so you always stay the boss of your hardware. - Safe, reversible debloating: Hides retail/carrier bloat packages with
setApplicationHidden()(no/systempartition surgery, so OS security updates continue working) while carefully leaving core utilities and everyday essentials—Dialer, Messages, Camera, Play Store, Google Drive, YouTube Music, YouTube, and Google Photos—completely untouched. While management is active you can unhide anything; when you later deprovision, hidden packages are converted to permanent user-0 uninstalls so the clean phone survives the exit (see Non-Destructive Deprovisioning below). - Calm status bar out of the box: Optional Notifications Off by Default denies
POST_NOTIFICATIONSon non-core apps on Android 13–16+, leaving calls, SMS, alarms, and system alerts intact. - Non-destructive exit: Because first-boot Device Owner (
PROVISIONING_MODE_FULLY_MANAGED_DEVICE) lets the controller callclearDeviceOwnerApp(), you can revoke management anytime from the phone app or Web UI without factory-resetting your personal data. - Optional IP camera companion: Built-in, SHA-256-verified fetch &
PackageInstallerdelivery for the open-source Thingino Android App (v0.6.0).
Want a coding assistant to set this up with you step-by-step and watch the live HTTPS tunnel while you scan the QR code on your phone? Clone or open a terminal in this folder and paste the block below directly into agy, codex, hermes, or claude:
Help me clone, build, and run AREOLE-DPC-HWTF from GitHub on this machine so I can
provision and debloat an Android phone using 6-tap QR enrollment (or ADB fallback).
Follow these exact steps and explain what each command does as we go:
1. Check OS packages and ensure OpenJDK 17/21, python3, curl, unzip, and qrencode are installed.
2. If not already inside the repo, clone:
git clone https://github.com/chieftechnicalwizard/AREOLE-DPC-HWTF.git && cd AREOLE-DPC-HWTF
3. Run the bootstrap script with HTTPS tunnel and optional Thingino support:
chmod +x setup.sh build_dpc.sh server.py
./setup.sh --with-tunnel --with-thingino
4. Verify static/areole-dpc.apk built cleanly and read out the signing certificate
URL-safe SHA-256 checksum using apksigner.
5. Launch the provisioning server with an ephemeral HTTPS tunnel:
python3 server.py --tunnel
6. Watch the printed Web Console URL (http://127.0.0.1:8780) and HTTPS Tunnel URL
(https://*.trycloudflare.com). Help me:
- Pick "First-Boot 6-Tap Device Owner" in the Web UI
- Fill optional Wi-Fi SSID/password if I want the phone to auto-join Wi-Fi
- Choose my bloatware / notification-mute / Thingino checkboxes
- Walk me through factory-reset Welcome screen -> 6 taps -> scan QR -> verify
device check-in on the "Enrolled Devices" tab
- Verify no secrets or keystores were committed if I inspect git status.
- Linux host (Debian / Ubuntu / Mint, Arch / Omarchy / Manjaro, Fedora / RHEL / Rocky / Alma, openSUSE, Alpine, Void, or NixOS) with Java JDK 17+ (
javac/keytool), Python 3.10+,unzip,zip,curl, andqrencode(optional, for sharp SVG QR codes in the browser). ./setup.shauto-detectsapt-get,pacman,dnf,zypper,apk, andxbps-installto install missing dependencies automatically (or pass--skip-depsif you manage tools yourself).- A compatible Android-powered phone (Android 9–16+ tested; includes a curated retail and carrier bloat preset that is safe across compatible Android devices).
Manual per-distribution dependency install commands (optional)
| Distribution | Package Manager Command |
|---|---|
| Debian / Ubuntu / Pop!_OS / Mint | sudo apt-get update && sudo apt-get install -y python3 qrencode curl unzip zip openjdk-21-jdk-headless |
| Arch Linux / Omarchy / Manjaro | sudo pacman -Sy --needed python qrencode curl unzip zip jdk21-openjdk |
| Fedora / RHEL / Rocky / Alma | sudo dnf install -y python3 qrencode curl unzip zip java-21-openjdk-devel |
| openSUSE (Tumbleweed / Leap) | sudo zypper install python3 qrencode curl unzip zip java-21-openjdk-devel |
| Alpine Linux | sudo apk add python3 libqrencode-tools curl unzip zip openjdk21-jdk bash |
| Void Linux | sudo xbps-install -Sy python3 qrencode curl unzip zip openjdk21 |
| NixOS / Nix | nix-shell -p openjdk21 python3 qrencode curl unzip zip --run './setup.sh --skip-deps --with-tunnel --with-thingino' |
git clone https://github.com/chieftechnicalwizard/AREOLE-DPC-HWTF.git
cd AREOLE-DPC-HWTF
chmod +x setup.sh build_dpc.sh server.py
./setup.sh --with-tunnel --with-thinginoWhat ./setup.sh does for you:
- Checks/installs Java JDK,
qrencode,curl,unzip,zip, and Python 3. - Downloads official Google Android
commandlinetools(platforms;android-35,build-tools;35.0.0, andplatform-toolsadb37.x—which fixes Wireless ADB pairing failures seen in older OS-packagedadb 34.xbuilds) into~/.local/share/android-sdk/. - Generates your private
.keystore+ random 24-character password insidekeystore/(never tracked by git) and compilesandroid_dpc/intostatic/areole-dpc.apk. - With
--with-tunnel, fetchescloudflaredinto~/.local/bin/cloudflared. - With
--with-thingino, downloadsthingino-android.apkv0.6.0intostatic/apps/and checks its exact SHA-256 digest (bf4e9181d282f595dd40caf0a8d8b26d16f34135ab96e8acc87f89fde96a81af).
Why --tunnel? Android 14, 15, and 16 Setup Wizard (ManagedProvisioning) refuses plain http:// download URLs during 6-tap QR provisioning. Adding --tunnel opens a temporary, zero-account trycloudflare.com HTTPS endpoint pointing at your local server—and server.py automatically blocks admin/QR/ADB endpoints with HTTP 403 from that public tunnel so only the phone APK fetch and device check-in routes are reachable outside your LAN.
python3 server.py --tunnelOpen your browser locally to http://127.0.0.1:8780.
Prefer not to install Java JDK, qrencode, or the Android SDK onto your host OS? Run everything isolated inside one reproducible container using Dockerfile, docker-entrypoint.sh, and compose.yaml.
Zero baked secrets: No signing keys or APKs are built into the container image. On first boot, docker-entrypoint.sh generates your own private RSA-2048 keystore inside the persistent /var/lib/areole volume, signs areole-dpc.apk, and reuses that same identity across future restarts or container upgrades.
git clone https://github.com/chieftechnicalwizard/AREOLE-DPC-HWTF.git
cd AREOLE-DPC-HWTF
docker compose up -d --build
docker compose logs -fOpen http://127.0.0.1:8780 in your browser. Look in docker compose logs -f for the live https://*.trycloudflare.com tunnel URL (or check the Server URL dropdown in the Web UI).
| Environment Variable | Default | Purpose |
|---|---|---|
AREOLE_MDM_PORT |
8780 |
Web console & APK server port |
ENABLE_TUNNEL |
1 |
Start an ephemeral Cloudflare HTTPS Quick Tunnel (0 = LAN / ADB only) |
INSTALL_THINGINO |
0 |
Pre-download & SHA-256 verify Thingino v0.6.0 on startup (1 = enable) |
REBUILD_APK |
0 |
Force recompiling areole-dpc.apk with the existing persistent keystore (1 = rebuild) |
Direct docker run / podman run equivalent:
docker build -t areole-dpc-hwtf .
docker run -d --name areole-dpc \
--network host \
-e ENABLE_TUNNEL=1 \
-v areole_state:/var/lib/areole \
areole-dpc-hwtfNetworking note:
network_mode: host(default incompose.yaml) letsserver.pydetect your real LAN IP addresses and reach Android Wireless Debugging on your subnet directly. On macOS or Windows Docker Desktop, comment outnetwork_mode: hostincompose.yamland uncommentports: ["127.0.0.1:8780:8780"](6-tap QR via the--tunnelHTTPS URL and/setupwork identically!).
Run one deployment for many strangers — each visitor provisions and debloats their own phone without anyone being able to see or touch anyone else's device, and without creating accounts. The default self-hosted behavior (full console, LAN discovery, ADB tab) stays exactly as before; public mode is opt-in.
AREOLE_PUBLIC=1 AREOLE_PUBLIC_BASE_URL=https://areole.example.com python3 server.py --public
# or: python3 server.py --public --public-base-url https://areole.example.com
# containers: ENABLE_PUBLIC=1 (+ AREOLE_PUBLIC_BASE_URL) in compose.yaml| Credential | Holder | Grants |
|---|---|---|
areole_session cookie |
Each visitor's browser (auto-created, HttpOnly/SameSite=Lax, Secure behind HTTPS) |
A private ~48h session: QR generation + visibility/control of only that session's devices |
enrollment_token |
Each enrolled phone (embedded in its QR, sent on every check-in; the server keeps the token only for the life of its session, then purges it) | That one device's check-in — first check-in binds token→device, and a token can never claim a second device or another session's device |
Concretely: /api/status, /api/device/command, and /api/device/delete are scoped to the session's own devices (cross-session targets return 404, revealing nothing); /api/device/checkin requires a valid token; /api/qr always points at your canonical public origin; the ADB tab is disabled (it drives the server host's adb daemon and cannot be multi-tenant). Per-IP rate limits apply to check-ins, QR generation, and session creation.
When a session expires (default 48h; the expected flow is under a day), the server automatically queues DEPROVISION_KEEP_PERSONAL for each of its devices. Phones enrolled in public mode run a light built-in background check-in (~every 15 min, set only when the QR carried auto_retire) so that final remove-the-controller command is delivered even if the user never reopens the app. After a grace window (default 24h) every trace is purged: devices, app inventories, commands, tokens. Users can always leave earlier with the in-app Deprovision & Remove Controller button, which works fully offline.
-
Your own HTTPS reverse proxy in front (Android 14–16 Setup Wizard rejects plain
http://download URLs). It must forwardX-Forwarded-Protoso the session cookie gets itsSecureflag. Caddy example:areole.example.com { reverse_proxy 127.0.0.1:8780 } -
Set
AREOLE_PUBLIC_BASE_URLso QR payloads carry your canonical origin (otherwise it is derived from each request'sHost+X-Forwarded-Proto). -
Tuning:
AREOLE_SESSION_TTL(hours, default 48) andAREOLE_RETIRE_GRACE(hours after expiry before the hard purge, default 24). -
Remember: with one signing keystore you are the Device Owner identity strangers' phones trust — keep
keystore/safe and expect abuse-handling responsibilities (e.g. someone provisioning a stolen phone).
-
Choose Options in the Web UI (
http://127.0.0.1:8780)- Template Type:
Android 9.0–16+ (Signature Checksum — Recommended) - Provisioning Mode:
First-Boot 6-Tap Device Owner (Self-Clear Without Wipe) - Server URL: Select the
https://*.trycloudflare.comtunnel URL at the top of the dropdown. - Profile Label / Wi-Fi (Optional): Enter a label (
Ownerby default). Filling your Wi-Fi SSID & password inside the QR payload lets the phone connect automatically without typing a password on glass! - Toggles: Check Strip OEM & Carrier Bloatware, Notifications Off by Default, and optionally Install Thingino App (v0.6.0).
- Template Type:
-
Trigger the Hidden QR Scanner on Android
- Power on a factory-reset Android phone and stay on the very first Welcome / Hi there screen.
- Tap empty background space on that Welcome screen 6 times rapidly until the QR reader opens.
- Point the phone at the QR code on your computer monitor.
-
Watch the Provisioning Handshake Finish
- Android joins Wi-Fi, downloads
areole-dpc.apkover HTTPS, verifies thePROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM, binds Device Owner with0restrictions, hides bloatware + applies notification/display defaults, and walks cleanly through Accept Device Owner → OEM Privacy & Telemetry → Google Services → Home Screen with zero Setup Wizard crashes.
Friendly Reminder on Screen 1 ("This device isn't private"): Android always displays that standard enterprise disclaimer during Device Owner setup. In this case, YOU are the organization and the IT admin — your phone is being enrolled exclusively into your own self-hosted, privately signed
AreoleDPCcontroller with zero cloud accounts or third-party oversight. AllUserManagerrestrictions are cleared immediately, and you can tap Deprovision & Remove Controller (Keep Personal) anytime to remove management without wiping your personal data. - Android joins Wi-Fi, downloads
-
Already Set Up Without Factory Resetting? (ADB & BYOD Modes)
- Visit
<server_url>/setupon your phone browser to installareole-dpc.apkand create a removable Work Profile, OR plug in USB / pair Wireless Debugging in Tab 3 (USB / Wireless ADB Control) to run one-click user-0 debloating, notification muting, or optional Thingino installation without resetting at all.
- Visit
Fixed in
v1.0.2+(3e59b14): On certain Android 16 retail and carrier builds, olderv1.0.1APKs triggered an "Android setup keeps stopping" loop right after "Registering device" → "Checking for updates" because the bloat preset hid an OEM Setup Wizard extension (com.motorola.setup/SetupWizardExt.apk) hostingres/raw/wizard_script_post_dpm_user_flow_*.xmlforWizardManagerActivity. That package has been removed from the preset andDpcConfig.setPackagesHidden()now refuses to hide setup-wizard packages whileuser_setup_complete == 0(verified 0 crashes across tested compatible Android 16 devices). If you upgraded an existing Docker volume fromv1.0.1, start once withREBUILD_APK=1so the container recompiles the updated APK.
Fallback for older APKs or unusual GMS/carrier builds: If a different OEM/carrier build ever stalls during post-DPM finalization (for example, when Google's Android Device Policy com.google.android.apps.work.clouddpc intercepts ROLE_HOLDER_PROVISION_FINALIZATION), provisioning itself has already succeeded — Device Owner is bound, debloat is applied, and the device checks into your console. Press Back/Close to reach the launcher, then run over USB ADB to clear any stuck OOBE state:
adb shell pm disable-user --user 0 com.google.android.apps.work.clouddpc
adb shell settings put secure user_setup_complete 1
adb shell settings put global device_provisioned 1Then reboot once to refresh launcher icons and verify Role: DEVICE_OWNER in the Enrolled Devices tab. Carrier-bloat package names vary per firmware — hide any stragglers manually from the App Inventory drawer; packages marked non-disable by the OEM (e.g. com.amazon.appmanager or com.motorola.installer on some builds) cannot be removed without root.
Every source file is heavily commented so you can audit and learn the exact Android internals:
| File | Purpose & Key Android Mechanics Taught |
|---|---|
server.py |
Pure Python stdlib HTTP server, dynamic SDK/apksigner/adb resolver, URL-safe unpadded Base64 SHA-256 cert digest builder, do_HEAD() for Android 14–16 ManagedProvisioning, cloudflared HTTPS quick-tunnel runner with 403 admin isolation, SQLite command queue, and ADB controller. |
static/index.html |
Self-contained 3-tab browser console: live QR JSON generator + SVG renderer, Enrolled Devices & App Inventory hide/restore drawer, and Wireless/USB ADB controls. |
build_dpc.sh |
Builds areole-dpc.apk from raw Java & XML without Gradle bloat: aapt2 compile -> aapt2 link -> javac --release 11 -> d8 DEX compiler -> zip + zipalign -> apksigner v1/v2/v3 APK signing with a local auto-generated PKCS12 keystore. |
setup.sh |
Multi-distro host bootstrapper (apt-get, pacman, dnf, zypper, apk, xbps-install, --skip-deps) that installs OS tools, official Google Android SDK android-35 + build-tools;35.0.0 + platform-tools 37.x, builds the APK, and optionally caches cloudflared and SHA-256-verified Thingino v0.6.0. |
Dockerfile |
Multi-stage-clean Ubuntu 24.04 container packaging OpenJDK 21, Python 3, qrencode, iproute2, Android SDK 35 + adb 37+, and cloudflared under non-root UID 10001. |
docker-entrypoint.sh |
First-boot container initializer that prints banner.ans, generates a persistent keystore inside /var/lib/areole, compiles areole-dpc.apk, verifies optional Thingino, and execs server.py. |
compose.yaml |
Ready-to-run Compose stack with network_mode: host, persistent areole_state volume, and documented bridged/USB options. |
android_dpc/AndroidManifest.xml |
Declares the required BIND_DEVICE_ADMIN activities (GET_PROVISIONING_MODE, ADMIN_POLICY_COMPLIANCE) and DeviceAdminReceiver (PROFILE_PROVISIONING_COMPLETE, BOOT_COMPLETED). |
GetProvisioningModeActivity.java |
Step 1 of Setup Wizard handshake: reads PROVISIONING_ADMIN_EXTRAS_BUNDLE from the QR code, persists your server URL and flags, and selects Device Owner or Managed Profile mode. |
PolicyComplianceActivity.java |
Step 2 of Setup Wizard handshake: applies clearUserRestriction(), hides bloatware immediately, fires background server sync, and returns Activity.RESULT_OK so setup completes. |
AreoleDeviceAdminReceiver.java |
Lifecycle broadcast receiver that re-asserts unrestricted flags and offloads provisioning and BOOT_COMPLETED server check-ins to AreoleSyncJobService (JobScheduler) to prevent BroadcastQueue ANR timeouts. |
DpcConfig.java |
Core engine: unrestricted owner profile labeling, setApplicationHidden() debloat engine, Android 13+ POST_NOTIFICATIONS default silencer, PackageInstaller APK streamer for Thingino, app inventory collector, and non-destructive clearDeviceOwnerApp() unenrollment. |
MainActivity.java |
Zero-dependency programmatic Android UI displaying device role, 15-second live command poller, one-tap debloat/notification controls, Thingino installer, and "Deprovision & Remove Controller (Keep Personal)" button. |
banner.ans |
256-color ANSI art desert cacti scene printed by CLI scripts. |
[Factory Reset Phone]
| (6 taps on Welcome screen)
v
[Android ManagedProvisioning] -- scans QR JSON --> { DOWNLOAD_LOCATION, SIGNATURE_CHECKSUM, EXTRAS }
|
|-- HTTP HEAD + GET /apk/areole-dpc.apk (HTTPS Tunnel) --> [server.py]
|
|-- Verifies APK v2/v3 Cert SHA-256 == SIGNATURE_CHECKSUM
|-- Installs AreoleDPC
|-- Launches GetProvisioningModeActivity --> picks DEVICE_OWNER
|-- Launches PolicyComplianceActivity --> clears restrictions, hides bloat, RESULT_OK
'-- Fires AreoleDeviceAdminReceiver --> syncs POST /api/device/checkin
- Signing keystores (
keystore/,*.jks,*.keystore,.storepass), compiled APKs (static/*.apk,static/apps/), runtime SQLite databases (data/), andtunnel_url.txtare all listed in.gitignore. - If you fork or publish your own copy, keep your
keystore/private so nobody else can sign APKs matching your QR certificate checksum. - When exposed with
--tunnel,server.pychecks proxy headers (CF-Connecting-IP,CF-Ray,Host: *.trycloudflare.com) and blocks access to/,/api/qr,/api/status,/api/device/command, and/api/adb/*with HTTP403.
Want AreoleDPC completely gone after your phone is debloated and tuned?
- In the Android app (
Areole Provisioner DPC) or in Tab 2 of the Web UI, choose Deprovision & Remove Controller (Keep Personal). - Under Device Owner,
AreoleDPCdoes two things before callingdpm.clearDeviceOwnerApp("com.areole.dpc"): it clears allUserManagerrestrictions, and it converts every hidden bloat package into a permanent user-0 uninstall (PackageInstaller, identical in effect to the ADB path'spm uninstall -k --user 0). This step exists because Android otherwise restores every app an admin hid withsetApplicationHidden()the moment that admin is removed — silently undoing your debloat. User-0 uninstalls are plain PackageManager state: they survive management removal and reboots, the APKs stay on/system(so OS security updates and a factory reset can always restore them), and your personal apps, accounts, and photos are never touched. Management then ends immediately and you can uninstall the DPC app normally afterwards. - Under a BYOD Work Profile, it cleanly deletes only the Work container while keeping your main personal profile safe.
OTA, Persistence & Anti-Carrier Guide: On compatible Android 16 retail and carrier builds, clearing Device Owner reverts
setApplicationHidden()unless packages are uninstalled for user 0 (pm uninstall --user 0), and a few OEM/carrier stubs are framework-protected asnon-disable. Seedocs/OTA_REBLOAT_FINDINGS.mdfor the real-hardware OTA timeline and Keeping Self-Signed Device Owner Active (Persistence, Reboots & Normal Development Gist) for why keeping your persistent self-signed keystore (~/AREOLE-DPC-HWTF/keystore/) active is safe across laptop reboots and ideal for everyday development.
- @wltechblog (Josh at WLTechBlog) — PR #2: Public Multi-User Mode (
--public/ENABLE_PUBLIC=1), persistent user-0 debloat across deprovisioning,AreoleSyncJobService, the YouTube walkthrough, and hosting the live public instance at dpc.wltechblog.com.
Sponsorship and donations support Shekinah Shine maintenance, sanctuary groundskeeping, 24/7 broadcast infrastructure, and open-source development.
·
PayPal Donate (Shekinah Shine) ·
Cash App ·
Venmo ·
GitHub Sponsors ·
Shekinah Shine Website