admin_panel_settings

Root Mode Guide

Last updated: January 2025

Use Root Mode for system-level ad blocking with minimal overhead. This guide explains how it works, how to enable it, and what to watch out for.

What is Root Mode?

Root Mode modifies the system hosts file with root privileges to block ads and trackers before they leave your device. It is faster than VPN Mode but requires a rooted environment.

How Root Mode works

  1. Pandefy requests superuser access from your root manager (Magisk/SuperSU).
  2. A merged hosts file is generated with all selected blocklists.
  3. The system hosts file is replaced with the merged version.
  4. When a blocked domain is queried, it resolves to 0.0.0.0 and the connection fails silently.

Root Mode vs. VPN Mode

Advantages of Root Mode

  • No VPN icon or notification; works at kernel level.
  • Lower battery usage because traffic is not proxied.
  • Compatible with per-app VPNs and private DNS.

Advantages of VPN Mode

  • Works on any device without root access.
  • Offers App Control (per-app filtering) and statistics.
  • Simpler to switch on/off; fewer compatibility risks.

Requirements

  • checkAndroid device with working root access (Magisk or compatible SU binary).
  • checkPandefy installed in internal storage (not on SD card).
  • checkSystemless hosts module enabled if your ROM requires it (Magisk → Settings → Systemless hosts).
  • checkAt least 50 MB free space for temporary host files.

Setup Steps

1

Grant root access

Allow Pandefy to run privileged commands.

  1. Open Pandefy → Settings → Protection Mode.
  2. Select “Root protection”.
  3. When Magisk/SuperSU prompts, tap “Grant”.
  4. Confirm the success toast inside Pandefy.
2

Create the merged hosts file

Your blocklists will be compiled into a single hosts file.

  1. Go to Settings → Hosts configuration.
  2. Select the blocklists you want to include.
  3. Tap “Apply changes”.
  4. Pandefy generates the file and installs it system-wide.
3

Verify protection

Ensure ads are being blocked and the system hosts file is active.

  1. Open Dashboard → Protection status (should show Root protection).
  2. Test a known ad-heavy website or app.
  3. Optional: check the hosts file via adb shell `cat /system/etc/hosts`.

Key Features

Enhanced Response System (ERS)

  • Automatically repairs the hosts file if another app modifies it.
  • Monitors the file hash and re-applies protection when needed.

Smart Space Recovery

  • Frees space in the system partition after switching lists.
  • Keeps only the active hosts file to reduce waste.

Security certificate mode

  • Optional certificate installation for HTTPS inspection by third-party filters.
  • Disabled by default; only enable if you understand the implications.

Warnings & Considerations

Root reliability

  • If root access is lost or Magisk is disabled, protection stops.
  • ROM updates and custom kernels can sometimes break root temporarily.

System modifications

  • Some banking or DRM apps detect host file changes and may refuse to run.
  • Always keep a backup of your original hosts file (Pandefy does this automatically).

Android version support

  • Root Mode is not recommended on Android 14+ because system partitions are often read-only.
  • If the system hosts file cannot be replaced, use VPN Mode instead.

Troubleshooting

Root prompt never appears

  • Open Magisk and ensure Pandefy is listed under granted apps.
  • Clear Magisk’s deny list / enforce mode if enabled.
  • Reboot the device and try to enable Root Mode again.

Ads still showing after enabling

  • Tap Settings → Root tools → Reapply hosts file.
  • Disable conflicting ad blockers that may overwrite the hosts file.
  • Make sure your blocklists contain the domains you expect.

Bootloop or boot issues

  • Boot into recovery and restore the backup hosts file from `/sdcard/Pandefy/backup/hosts.bak`.
  • Disable Root Mode from recovery by deleting `/data/adb/service.d/pandefy_hosts.sh` if present.
  • Report the issue in support with details about your ROM and root setup.

Frequently Asked Questions

Does Root Mode work on Android 14 or newer?

Only if your ROM keeps writable system partitions. Many modern builds block modifications, so VPN Mode is safer on Android 14+.

Can I use Root Mode and VPN Mode together?

You can only enable one protection mode at a time. Switch to the one that best suits your use case.

Will Root Mode break SafetyNet or Play Integrity?

Modifying the hosts file alone does not usually trip SafetyNet, but each ROM behaves differently. Use Magisk’s hide features if needed.

How do I revert to the stock hosts file?

Disable Root Mode in Pandefy; the app restores the original hosts file automatically.

Quick Reference

Enable Root Mode

Settings → Protection mode → Root protection

Reapply hosts file

Settings → Root tools → Reapply

Switch back to VPN Mode

Settings → Protection mode → VPN protection

Check protection status

Dashboard → Protection status

explore

Related Guides