How to edit build prop with magisk?

Search This thread

Didgeridoohan

Senior Moderator / Developer Relations
Staff member
May 31, 2012
11,541
11,997
Gothenburg
Google Nexus 4
Nexus 6
I've just read the whole topic and wonder: why are you using post-fs-data scripts rather creating a simple module with proper system.prop value?
Anyway - I tried to do it - and it doesn't work on MIUI 9 (Android 7.1.2) with Magisk 16.0. Also the module "Extend WiFi channels" by Thomasvt als fails because it uses the same way.
Resetprop doesn't work?

Magisk uses the resetprop tool to set any props you've added to the system.prop file, so using a module or a boot script is basically the same thing...
 

AlbertDude

Member
Nov 28, 2013
33
11
My attempts to set a prop value with a script file in /magisk/.core/post-fs-data.d were unsuccessful.
I ended up using the MagiskHide Props Config module which worked without any problems.

This on a Moto Z Play running Oreo 8.0 and Magisk 16.0
 
  • Like
Reactions: Didgeridoohan

jaager

Senior Member
Apr 18, 2017
56
12
I'm running LineageOS 15.1 and Magisk 17.1 with my new Redmi Note 5. I tried to change HAL3 but I didn't work.
I created a file under "/sbin/.core/img/.core/post-fs-data.d" with the following entry:

Code:
#!/system/bin/sh
resetprop persist.camera.HAL3.enabled 1

I checked the settings with a terminal and getprop, and persist.camera.HAL3.enabled ist set to 1 there. Unfortunately my GCAM is still not working. After that I installed the App Camera2 probe and Level_3 support is not listed there. How could that be with getprop seeing the value?
After that I tried to set the value with MagiskHide Props Config module but still the same issue. Can someone help me?
 

LeMoise

Senior Member
Oct 24, 2017
140
26
Toronto
There is an app on the Google Play Store called BuildProp Editor. It lets you easily back up, restore and configure your build.prop. I've used it in the past to emulate different phones.
 

Didgeridoohan

Senior Moderator / Developer Relations
Staff member
May 31, 2012
11,541
11,997
Gothenburg
Google Nexus 4
Nexus 6
How does it prevent the system partition being marked as changed, if build.prop really gets modified? (avoiding this is the point of this thread)

It doesn't. Editing prop values systemlessly means you'll have to use the Magisk resetprop tool somehow. Either with a boot script (relatively simple), a Magisk module (might be a bit overkill), or use one of the modules already available that do what you're looking for. If there aren't any module available that sets the props you want, the MagiskHide Props Config module (shameless advertising :D) can set the prop for you.

I created the custom prop function in that module to make it easy for the average user to change prop values systemlessly. Unfortunately it's been kind of overlooked with the popularity of other functions of the module (changing the build fingerprint to pass the ctsProfile check, which in itself is just a systemlessly changing of a prop value)...

As it seems from @jaager's report though, doing it systemlessly might not always be enough...
 

abuttino

Senior Member
Sep 12, 2006
2,222
411
I'm using a Pixel 2.. It appears that all the magisk directories are gone. Where would I edit build.props now?

Sent from my Pixel 2 XL using Tapatalk
 

exocetdj

Senior Member
Dec 2, 2011
6,566
4,107
Jah's making me crazy
It doesn't. Editing prop values systemlessly means you'll have to use the Magisk resetprop tool somehow. Either with a boot script (relatively simple), a Magisk module (might be a bit overkill), or use one of the modules already available that do what you're looking for. If there aren't any module available that sets the props you want, the MagiskHide Props Config module (shameless advertising :D) can set the prop for you.

I created the custom prop function in that module to make it easy for the average user to change prop values systemlessly. Unfortunately it's been kind of overlooked with the popularity of other functions of the module (changing the build fingerprint to pass the ctsProfile check, which in itself is just a systemlessly changing of a prop value)...

As it seems from @jaager's report though, doing it systemlessly might not always be enough...

im in the process of porting my rom over to the MNT extended template.

I have got everthing over and working but want to change the ro.build.display.id on the build prop

i have read that we need to add a file in .core/img/.core/service.d or post-fs-data.d

how can we get this to show when the module is installed?
 

Didgeridoohan

Senior Moderator / Developer Relations
Staff member
May 31, 2012
11,541
11,997
Gothenburg
Google Nexus 4
Nexus 6
im in the process of porting my rom over to the MNT extended template.

I have got everthing over and working but want to change the ro.build.display.id on the build prop

i have read that we need to add a file in .core/img/.core/service.d or post-fs-data.d

how can we get this to show when the module is installed?

Your info is out of date. The paths you want are:
/data/adb/post-fs-data.d
/data/adb/service.d

If you're not using a module that is, since then you'd use the post-fd-data.sh and service.sh files in the module. But if you're using a module you should be using the system.prop file to make prop changes anyway...
 
  • Like
Reactions: exocetdj

exocetdj

Senior Member
Dec 2, 2011
6,566
4,107
Jah's making me crazy
Your info is out of date. The paths you want are:
/data/adb/post-fs-data.d
/data/adb/service.d

If you're not using a module that is, since then you'd use the post-fd-data.sh and service.sh files in the module. But if you're using a module you should be using the system.prop file to make prop changes anyway...

Actually the first way worked lol! Although if it's dated I'll stick to the new path under data/adb, I can see these folders there.

So yes the changes I am making are via a module. I tried adding a system.prop with

ro.build.display.id=420rom-MAGISK

In the common folder but that didn't make any changes and I'm unsure what else I need to change in the module to call this from the system.prop.
 

Didgeridoohan

Senior Moderator / Developer Relations
Staff member
May 31, 2012
11,541
11,997
Gothenburg
Google Nexus 4
Nexus 6
Actually the first way worked lol! Although if it's dated I'll stick to the new path under data/adb, I can see these folders there.

So yes the changes I am making are via a module. I tried adding a system.prop with

ro.build.display.id=420rom-MAGISK

In the common folder but that didn't make any changes and I'm unsure what else I need to change in the module to call this from the system.prop.

The paths you used are old and current Magisk releases have them symlinked (for backwards compatibility), but they will be dropped in the next release.

The system.prop file needs to be in the root of the module directory. Take a look in the Magisk docs for details on how modules work:
https://topjohnwu.github.io/Magisk/guides.html
 
  • Like
Reactions: exocetdj

exocetdj

Senior Member
Dec 2, 2011
6,566
4,107
Jah's making me crazy
The paths you used are old and current Magisk releases have them symlinked (for backwards compatibility), but they will be dropped in the next release.

The system.prop file needs to be in the root of the module directory. Take a look in the Magisk docs for details on how modules work:
https://topjohnwu.github.io/Magisk/guides.html

Ok that's a bit clearer, apologies, having ADHD means that anything that isn't clear, leads to massive overthinking and going on random tangents with working :laugh:

I can see that the file I placed is in that newer folder too so that makes sense

So looking at that guide, the changes in system.prop are loaded by resetprop as system values.

I came across some files, resetprop.cpp and a couple of other .cpp files which iv stored in my working folder but it lacked instruction on use for these.
 

Didgeridoohan

Senior Moderator / Developer Relations
Staff member
May 31, 2012
11,541
11,997
Gothenburg
Google Nexus 4
Nexus 6
Ok that's a bit clearer, apologies, having ADHD means that anything that isn't clear, leads to massive overthinking and going on random tangents with working :laugh:

I can see that the file I placed is in that newer folder too so that makes sense

So looking at that guide, the changes in system.prop are loaded by resetprop as system values.

I came across some files, resetprop.cpp and a couple of other .cpp files which iv stored in my working folder but it lacked instruction on use for these.

Yes, Magisk will run resetprop during boot an load the system.prop file.

The .cpp files are part of the code and used when building the tools. The actual tool is an applet of the Magisk binary, although I believe you can build the resetprop tool separately (outside my skillset).
 
  • Like
Reactions: exocetdj

exocetdj

Senior Member
Dec 2, 2011
6,566
4,107
Jah's making me crazy
Yes, Magisk will run resetprop during boot an load the system.prop file.

The .cpp files are part of the code and used when building the tools. The actual tool is an applet of the Magisk binary, although I believe you can build the resetprop tool separately (outside my skillset).

Excellent so really it's as simple as placing that system.prop on the root of the module zip with whatever prop edits and magisk does the rest!?

I'll leave those cpp files if I don't need them as that will create confusion lol.
 

exocetdj

Senior Member
Dec 2, 2011
6,566
4,107
Jah's making me crazy
Affirmative on both.

Respect to you mate

Thank you!?

---------- Post added at 10:40 AM ---------- Previous post was at 10:27 AM ----------

It is easiest to just start with a fresh template and make a module. The template does most the work for a prop change, you just have to add the values you want and it will work.

I butchered my first zip template with my overthinking.

I'll start again, this time with system.prop on root of module zip with prop tweaks in
 

wangdaning

Senior Member
Sep 17, 2012
1,372
570
Wuxi
Respect to you mate

Thank you!?

---------- Post added at 10:40 AM ---------- Previous post was at 10:27 AM ----------



I butchered my first zip template with my overthinking.

I'll start again, this time with system.prop on root of module zip with prop tweaks in

You literally just have to add what you want to the /common/system.prop file and set the tag in install.sh for propfile=true. Re-read the documentation, a simple file change is easy.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    What is it that doesn't work on 11 (I don't have any 11 devices, so if there's something that isn't working it would be great to know)?

    If you mean the SafetyNet CTS check, it's no use updating the fingerprint just yet. If it doesn't work now, it's not gonna work until Google certifies the build.
    well after playing with your Module!!! Between 2 pixel 2 xl devices 1 on 10 and second on 11 beta 3 i was using Solid Explorer and went into files and added fingerprint info manually and wifi calling props, and tethering prop. everything is working. Thanks for Your FAST Answers.
    Sometimes it just takes playing with things to understand them !!!! (I mean my Dumd azz!!!) LOL
    2
    Thanks this seems promising, however i don't understand the syntax. If you have time could you tell me what to add with the build prop changes i wanted earlier in the thread. Thanks a lot for all the help

    Look at how ro.debuggable, ro.secure and the other ro props are handled in the enable file. Match what you want to do to those and then add similar code with your other desired changes in the disable file.

    It should be as simple as copying, pasting and changing variable names and props to match your desired setup.
    2
    It is easiest to just start with a fresh template and make a module. The template does most the work for a prop change, you just have to add the values you want and it will work.
    1
    @topjohnwu is currently implementing this into Magisk Manager. As for now you can use:
    Code:
    /data/magisk/resetprop build.prop.item value
    1
    You can either make a module or a script that you put in /magisk/.core/post-fs-data.d. More details in the All-In-One wiki (stickied thread).

    And as stated above, in upcoming versions you'll be able to change prop values in a GUI in the Magisk Manager. It's on the to-do list, but of course there's no ETA.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone