Tools

resetprop

resetprop is Magisk's tool for system properties. Unlike setprop it can change read-only ro.* properties, delete properties and wait for changes, because it can edit the property area in memory directly. This page covers every flag in v30.7 and v31.1, when changes do and don't trigger Android's property actions, and how to make a change stick.

Last updated 6 sourcesHow we check pages

Common uses

Read, set, delete, wait (as root)
# read one property (prints nothing and exits 1 if unset) #resetprop ro.build.fingerprint # list everything, like getprop: [name]: [value] #resetprop # change a read-only property until the next reboot #resetprop ro.product.model "Example Model" # delete a property #resetprop -d some.property # block until boot has completed (for scripts) #resetprop -w sys.boot_completed 0

You need root: open adb shell, run su (see MagiskSU), then use the commands above. resetprop has three modes. With no flags it reads or writes. -w switches to wait mode. -f, -d and (from v31.0) -c are their own operations, and only one may be used per call.

Every flag and argument

This is the usage text printed by resetprop -h, which is the same in v30.7 and v31.1 apart from -c.

FormModeEffect
(no arguments)ReadPrint all properties as [name]: [value], sorted
NAMEReadPrint one value; exit 1 if it does not exist
NAME VALUEWriteSet or create the property
-f, --file FILEWriteSet every name=value line in FILE (lines starting with # are skipped, spaces around names and values are trimmed)
-d, --delete NAMEWriteDelete the property; exit 1 if nothing was deleted
-w NAMEWaitBlock until NAME exists. The help text says "until property NAME changes", but the code returns as soon as the property exists.
-w NAME OLD_VALUEWaitReturn immediately if NAME is not OLD_VALUE, otherwise block until it changes
-pReadAlso read persist.* properties from storage when they are not in memory
-pWriteAlso write or delete persist.* properties in storage
-PReadRead persist.* properties from storage only
-ZReadPrint the property's SELinux context instead of its value
-nWriteBypass property_service and write memory directly, so no on property: triggers fire
-c, --compact [CONTEXT]GeneralCompact the property storage areas, or only the one for a context label. Added in v31.0; not in v30.7.
-v, --verboseGeneralPrint what it does to stderr (for example whether a write went "by property_service" or "by direct modification")
-h, --helpGeneralShow the usage text

When triggers fire, and when they don't

Android's .rc files can run actions when a property changes (on property:foo=bar). Those only run if the change goes through init's property_service. Which path resetprop takes depends on the name and the flags:

Does a resetprop write fire on property: actions?

Does the name start with ro.?
  • Yes
    Written directly to memory. No triggers fire. Values of 92 characters or more are allowed: the property is deleted and re-added.
  • No
    Did you pass -n?
    • Yes
      Is it a persist.* property?
      • Yes
        Written to memory; also saved to storage only if you add -p. No triggers.
      • No
        Written directly to memory. No triggers fire.
    • No
      Sent to init's property_service, like setprop. Triggers fire, and init saves persist.* itself.
From the set logic in native/src/core/resetprop/cli.rs, identical in v30.7 and v31.1, checked 26 October 2026.

Magisk itself always uses the direct path: module system.prop files and Magisk's own property changes (such as the Zygisk native bridge property) never fire triggers. A side effect for module authors: a persist.* line in system.prop is set in memory but not saved to storage.

persist.* properties

persist.* properties exist twice: in memory, and in /data/property/persistent_properties, from which they are reloaded at boot. resetprop's defaults match getprop and only touch memory. That gives three traps:

  • Reading a stored property that has not been loaded yet returns nothing unless you add -p. resetprop -P lists what is in storage.
  • Deleting without -p removes only the in-memory copy, so the property returns after a reboot. Use resetprop -p -d persist.name.
  • Writing with -n skips init, which is what normally saves persist properties. Add -p as well if the value should survive a reboot.
Working with stored properties
#resetprop -P #resetprop -p persist.sys.usb.config #resetprop -p -d persist.example.flag #resetprop -n -p persist.example.flag 1

Using resetprop in modules and scripts

Fixed values at every boot: use the module's system.prop, in build.prop format. Magisk loads it with resetprop at post-fs-data, before zygote starts, so apps see the new values from their first launch.

system.prop (in the module folder)
# one name=value per line ro.example.feature=1 debug.example.level=2

Values computed at boot: use post-fs-data.sh with resetprop -n if they must be in place before apps start, or service.sh otherwise. To wait for the system to finish booting in service.sh, Magisk's guide uses resetprop -w sys.boot_completed 0.

service.sh
MODDIR=${0%/*} resetprop -w sys.boot_completed 0 # runs once boot has completed resetprop -f "$MODDIR/late.prop"

Device spoofing modules such as the Play Integrity Fix forks rely on these same mechanisms. For the module folder layout and boot stages, see module development and how Magisk works.

Version history

  • v30.2: reduced the traces property modifications leave.
  • v30.5: proper support for Android versions with property overrides.
  • v30.7: all flags on this page except -c.
  • v31.0: added -c/--compact. Nothing else changed in resetprop through v31.1.

Errors and questions

What is the difference between resetprop and setprop?

setprop always asks init's property_service, which refuses to change ro.* properties that are already set and cannot delete anything. resetprop can write the shared property memory directly, so it can change ro.* values, delete properties, read persistent storage and wait for changes. For ordinary properties without -n, resetprop behaves like setprop.

My change is gone after a reboot

Properties live in memory and are rebuilt from the build.prop files at every boot. Only persist.* properties are stored, and only when set through property_service or with -p. To apply other properties at every boot, put them in a module's system.prop, or run resetprop from a module's post-fs-data.sh (with -n) or service.sh. See module development.

The value changed but nothing behaves differently

Many processes read properties once, when they start. Changing a value afterwards only affects processes that read it later. That is why spoofing and tweak modules set properties in system.prop or at post-fs-data, before zygote and the apps start. Also check that you did not need the property actions: ro.* changes and -n writes never fire on property: triggers.

Boot hangs when my post-fs-data script sets a property

Magisk's developer guide warns that setprop deadlocks boot during post-fs-data, because init is waiting for Magisk at that point. A resetprop write that goes through property_service (any non-ro.* property without -n) asks init the same way. Use resetprop -n NAME VALUE there, or move the script to service.sh.

I deleted a persist.* property and it came back

Without -p, delete removes the property from memory only; the copy in /data/property/persistent_properties is restored at the next boot. Use resetprop -p -d persist.name to remove both.

Reading a property prints nothing

The property does not exist in memory, and resetprop exits with code 1. For persist.* properties that are stored but not loaded, add -p (memory, then storage) or -P (storage only). resetprop | grep name lists everything that is set.

resetprop: not found

resetprop is installed by Magisk at boot, next to su, and needs root. Run it from a root shell (su first). If magisk -c also fails, Magisk is not running; see root not working.

Multiple operation mode detected! or Unrecognized argument

resetprop does one thing per call: wait (-w), compact (-c), load a file (-f), delete (-d), or read/set. Combining two of those prints the first error. It also takes at most two plain arguments (NAME and VALUE), so quote values that contain spaces: resetprop my.prop "two words".

Can apps tell that properties were changed?

Sometimes. resetprop changes what a property returns, but writing to the property area can leave traces; Magisk's changelog lists work to reduce them in v30.2. Whether a given app notices is outside Magisk's documentation. For Play Integrity, see the Play Integrity guide.

-c / --compact doesn't work

The compact flag was added in v31.0, so it is in the current v31.1 but not in v30.7 or older. Update Magisk if you need it.

Sources

This page is written from the sources below. If anything here disagrees with them, the upstream source is correct.

Found a mistake or something out of date? Tell us and we will check it against the source and fix the page. Confirmed corrections are listed in the corrections log.

Report a problem with this page