How to edit build prop with magisk?

Search This thread

Logan748

New member
Jul 28, 2017
1
0
Is there a way to use Samsung's my galaxy app on a different phone? Tried all possible options but the app won't work even after editing the build.prop file. Is there any way to know what is tripping the app? Magisk v13 is installed and working smoothly.
 

moralesnery

Senior Member
Aug 27, 2014
632
361
Is there a way to use Samsung's my galaxy app on a different phone? Tried all possible options but the app won't work even after editing the build.prop file. Is there any way to know what is tripping the app? Magisk v13 is installed and working smoothly.

Samsung app environment and usually every OEM's set of pre-installed apps need a "Framework" that's integrated into their stock ROMs.

If someone manages to port that framework to a flashable ZIP then maybe you'll be able to install it and run My Galaxy on your device (this happened with Sony Framework, in example). Until then I'm afraid you're out of luck.
 

3c

Senior Member
Jul 19, 2005
2,742
1,871
www.3c71.com
Create folder in /magisk and create inside a file called auto_mount.

And other called post-fs-data:
Code:
#!/system/bin/sh
cp -f /system/build.prop /magisk/MODULE_NAME/system/build.prop
sed -i "s/PROP_NAME=.*/PROP_NAME=VALUE/" /magisk/MODULE_NAME/system/build.prop

And other file called module.prop:
Code:
id=MODULE_NAME
name=Module name
version=v1
versionCode=1
author=Your name
description=Your description

Replace MODULE_NAME for the name of the folder you created and PROP_NAME & VALUE, for the prop and value you want edit.

And reboot.

Hello, may I join in the thread? Does that actually work?

I'm modifying my app to do something similar, but each time I create a file in /magisk/MODULE_NAME/system/build.prop, the device hangs upon reboot at the Google logo (using Nexus 6P) !? Even if I simply make a copy of the original build.prop!!!

EDIT: The only way I found so far was to create a script /magisk/MODULE_NAME/common/post-fs-data.sh containing only this:

Code:
#!/system/bin/sh
resetprop --file common/system.prop
Now I can simply edit the content of system.prop with any property to be set on boot ;)

Only draw-back is to delete specific properties, it doesn't work or I don't know the syntax to use in the system.prop file. However resetprop can do 'resetprop --delete NAME', but it would require a dedicated script which I'm trying to avoid.
 
Last edited:

Didgeridoohan

Forum Moderator / Developer Relations
Staff member
May 31, 2012
11,486
11,805
Gothenburg
Google Nexus 4
Nexus 6
Hello, may I join in the thread? Does that actually work?

I'm modifying my app to do something similar, but each time I create a file in /magisk/MODULE_NAME/system/build.prop, the device hangs upon reboot at the Google logo (using Nexus 6P) !? Even if I simply make a copy of the original build.prop!!!

EDIT: The only way I found so far was to create a script /magisk/MODULE_NAME/common/post-fs-data.sh containing only this:

Code:
#!/system/bin/sh
resetprop --file common/system.prop
Now I can simply edit the content of system.prop with any property to be set on boot ;)

Only draw-back is to delete specific properties, it doesn't work or I don't know the syntax to use in the system.prop file. However resetprop can do 'resetprop --delete NAME', but it would require a dedicated script which I'm trying to avoid.

Magic Mounting new files or folders to the root of /system is known to cause bootloops on Magisk v14+. This is the first time I see it happen with a file that's already present... I have previously made a simple module that replaces build.prop and from my tests it still works fine (on my devices).

Apart from that you've got the resetprop syntax covered. It's currently not possible to remove props with a file.

Depending on what you want to do, you can avoid making a module and just place your script directly in /magisk/.core/post-fs-data.d as well. FYI...

If you haven't seen it already, the Magisk Documentation on GitHub is a good read.
 
  • Like
Reactions: 3c

3c

Senior Member
Jul 19, 2005
2,742
1,871
www.3c71.com
Magic Mounting new files or folders to the root of /system is known to cause bootloops on Magisk v14+. This is the first time I see it happen with a file that's already present... I have previously made a simple module that replaces build.prop and from my tests it still works fine (on my devices).

Apart from that you've got the resetprop syntax covered. It's currently not possible to remove props with a file.

Depending on what you want to do, you can avoid making a module and just place your script directly in /magisk/.core/post-fs-data.d as well. FYI...

If you haven't seen it already, the Magisk Documentation on GitHub is a good read.

Finally figured out why adding manually a build.prop under /magisk/<module>/system or /cache/magisk_mount/system was making my device hangs: Creating the magisk module folders manually (without ZIP installer) was creating those with an 'unlabelled' security context (u:eek:bject_r:unlabelled:s0), which was replacing original system_files context and preventing the OS from loading the entire build.prop! Didn't cause any issues for installing an APK under priv-app folder though.

Just had to apply proper context (with a command like 'chcon u:eek:bject_r:system_files:s0 /magisk/<module>') to make it work!

One can check actually security context with 'ls -Z <path>' or 'ls -RZ <path>'. Just in case it helps someone creating a module from an app ;).
 
  • Like
Reactions: Didgeridoohan

AndroMani

Senior Member
Dec 10, 2017
57
6
Cast Screen features now works using this build.prop edit

Put the following two lines in an empty file:
Code:
#!/system/bin/sh
resetprop qemu.hw.mainkeys 0
Name it whatever feels applicable, place it in /magisk/.core/post-fs-data.d and reboot.

Thank you so much.

I exactly followed your steps and added the following two lines of code in a file I named "Wireless Display" to enable screen mirroring in my Moto G2 4G LTE 2014 (running stock Marshmallow 6.0) that was disabled by default in the original build.prop file. After rebooting the system, I am able to successfully cast my android screen to my big screen smart TV. The code I added in an empty file in the following location /Magisk/.core/post-fs-data.d/ is:

#!/system/bin/sh
resetprop persist.sys.wfd.virtual 1
resetprop persist.debug.wfd.enable 1

It is working fine without touching the original build.prop file under the System folder. Super cool!!!

Similarly, can I also add new codes to the build.prop file - as there are many build.prop tweaks available - to make use of those features as well? For example, I want to achieve the following with the given codes below.

ro.config.hw_quickpoweron=true (To Enable Faster Boot)

windowsmgr.support_rotation_270=true (To Force 270-Degree Rotation on All Apps)

wifi.supplicant_scan_interval=XXX (To Increase The Time Between WiFi Network Scans)

debug.performance.tuning=1 (For Improved Overall Performance)

windowsmgr.max_events_per_sec=150
ro.min_pointer_dur=8 ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
(To Improve Scrolling)

What syntax I should add in the script file to achieve this? Can I add these codes to the same file I used for screen mirroring OR I should create separate files for each of these functions? Please guide me. Thank you once again.
 

Didgeridoohan

Forum Moderator / Developer Relations
Staff member
May 31, 2012
11,486
11,805
Gothenburg
Google Nexus 4
Nexus 6
Thank you so much.

I exactly followed your steps and added the following two lines of code in a file I named "Wireless Display" to enable screen mirroring in my Moto G2 4G LTE 2014 (running stock Marshmallow 6.0) that was disabled by default in the original build.prop file. After rebooting the system, I am able to successfully cast my android screen to my big screen smart TV. The code I added in an empty file in the following location /Magisk/.core/post-fs-data.d/ is:

#!/system/bin/sh
resetprop persist.sys.wfd.virtual 1
resetprop persist.debug.wfd.enable 1

It is working fine without touching the original build.prop file under the System folder. Super cool!!!

Similarly, can I also add new codes to the build.prop file - as there are many build.prop tweaks available - to make use of those features as well? For example, I want to achieve the following with the given codes below.

ro.config.hw_quickpoweron=true (To Enable Faster Boot)

windowsmgr.support_rotation_270=true (To Force 270-Degree Rotation on All Apps)

wifi.supplicant_scan_interval=XXX (To Increase The Time Between WiFi Network Scans)

debug.performance.tuning=1 (For Improved Overall Performance)

windowsmgr.max_events_per_sec=150
ro.min_pointer_dur=8 ro.max.fling_velocity=12000
ro.min.fling_velocity=8000
(To Improve Scrolling)

What syntax I should add in the script file to achieve this? Can I add these codes to the same file I used for screen mirroring OR I should create separate files for each of these functions? Please guide me. Thank you once again.

You can find the syntax for the resetprop tool here:
https://github.com/topjohnwu/Magisk/blob/master/docs/applets.md#resetprop

It's real simple though... Just do what you did with the other two props. Here's an example from your list above:
Code:
resetprop windowsmgr.support_rotation_270 true

You can put them all in one script.
 

AndroMani

Senior Member
Dec 10, 2017
57
6
You can find the syntax for the resetprop tool here:
https://github.com/topjohnwu/Magisk/blob/master/docs/applets.md#resetprop

It's real simple though... Just do what you did with the other two props. Here's an example from your list above:
Code:
resetprop windowsmgr.support_rotation_270 true

You can put them all in one script.

Thank you for the quick reply. I will try them and update the thread if there are any issues.

By the way, SafetyNet check failed for me, that is, if I do not enable the "core only" mode in Magisk Manager settings. I tried flashing a universal SafetyNet check fix zip file from another XDA thread. But it failed and I later realized that it was meant for Xiaomi and other devices. So, I uninstalled it. I need the SafetyNet work for me so I can use one of my Live streaming TV apps that failed when I disabled the "core only" mode.

Is there a fix for my device - Moto G2 4G LTE 2014 - until @topjohnwu provides this feature for most devices in his next stable release of magisk manager?

Thanks again.
 

Didgeridoohan

Forum Moderator / Developer Relations
Staff member
May 31, 2012
11,486
11,805
Gothenburg
Google Nexus 4
Nexus 6
Thank you for the quick reply. I will try them and update the thread if there are any issues.

By the way, SafetyNet check failed for me, that is, if I do not enable the "core only" mode in Magisk Manager settings. I tried flashing a universal SafetyNet check fix zip file from another XDA thread. But it failed and I later realized that it was meant for Xiaomi and other devices. So, I uninstalled it. I need the SafetyNet work for me so I can use one of my Live streaming TV apps that failed when I disabled the "core only" mode.

Is there a fix for my device - Moto G2 4G LTE 2014 - until @topjohnwu provides this feature for most devices in his next stable release of magisk manager?

Thanks again.

Upload a Magisk log.

Edit: from when SN fails, that is...
 

AndroMani

Senior Member
Dec 10, 2017
57
6
Thanks for your reply and here is the contents of the log file after the SafetyNet failed (that is, after uninstalling the universal safetynet fix zip file I flashed before)

P.S. I do not see the attach button in my xda editor, so could not send the Magisk log as attachment. I have pasted the contents from it here.

--------- beginning of main
05-26 02:10:12.238 241 241 I Magisk : Magisk v14.0(1400) daemon started
05-26 02:10:12.241 241 243 I Magisk : ** post-fs mode running
--------- beginning of system
05-26 07:40:12.610 241 263 I Magisk : ** post-fs-data mode running
05-26 07:40:12.613 241 263 I Magisk : * Mounting mirrors
05-26 07:40:12.614 241 263 I Magisk : mount: /dev/block/platform/msm_sdcc.1/by-name/system -> /dev/magisk/mirror/system
05-26 07:40:12.614 241 263 I Magisk : link: /dev/magisk/mirror/system/vendor -> /dev/magisk/mirror/vendor
05-26 07:40:12.615 241 263 I Magisk : bind_mount: /dev/magisk/mirror/bin
05-26 07:40:12.655 241 263 I Magisk : * Mounting /data/magisk.img
05-26 07:40:12.827 241 263 I Magisk : Resize /data/magisk.img to 64M
05-26 07:40:12.934 241 263 I Magisk : * Running post-fs-data.d scripts
05-26 07:40:12.934 241 263 I Magisk : post-fs-data.d: exec [Wireless Display]
05-26 07:40:13.586 241 263 I Magisk : * Running module post-fs-data scripts
05-26 07:40:13.586 241 263 I Magisk : xposed_23: exec [post-fs-data.sh]
05-26 07:40:13.616 241 263 I Magisk : * Loading modules
05-26 07:40:13.617 241 263 I Magisk : xposed_23: constructing magic mount structure
05-26 07:40:13.623 241 263 I Magisk : bind_mount: /system/framework
05-26 07:40:13.623 241 263 I Magisk : bind_mount: /system/framework/XposedBridge.jar
05-26 07:40:13.623 241 263 I Magisk : bind_mount: /system/framework/am.jar
05-26 07:40:13.623 241 263 I Magisk : bind_mount: /system/framework/android.test.runner.jar
05-26 07:40:13.623 241 263 I Magisk : bind_mount: /system/framework/appops.jar
05-26 07:40:13.624 241 263 I Magisk : bind_mount: /system/framework/apache-xml.jar
05-26 07:40:13.624 241 263 I Magisk : bind_mount: /system/framework/appwidget.jar
05-26 07:40:13.624 241 263 I Magisk : bind_mount: /system/framework/bmgr.jar
05-26 07:40:13.624 241 263 I Magisk : bind_mount: /system/framework/arm
05-26 07:40:13.624 241 263 I Magisk : bind_mount: /system/framework/bu.jar
05-26 07:40:13.624 241 263 I Magisk : bind_mount: /system/framework/bouncycastle.jar
05-26 07:40:13.624 241 263 I Magisk : bind_mount: /system/framework/dpm.jar
05-26 07:40:13.625 241 263 I Magisk : bind_mount: /system/framework/cneapiclient.jar
05-26 07:40:13.625 241 263 I Magisk : bind_mount: /system/framework/com.android.future.usb.accessory.jar
05-26 07:40:13.625 241 263 I Magisk : bind_mount:

05-26 07:40:13.683 241 263 I Magisk : bind_mount: /system/lib/modules
05-26 07:40:13.683 241 263 I Magisk : bind_mount: /system/lib/soundfx
05-26 07:40:13.683 241 263 I Magisk : bind_mount: /system/lib/libprotobuf-cpp-lite.so
05-26 07:40:13.684 241 263 I Magisk : bind_mount: /system/lib/libradioservice.so
05-26 07:40:13.684 241 263 I Magisk : bind_mount: /system/lib/libresourcemanagerservice.so
05-26 07:40:13.684 241 263 I Magisk : bind_mount: /system/lib/libserviceutility.so
05-26 07:40:13.684 241 263 I Magisk : bind_mount: /system/lib/libsoftkeymasterdevice.so
05-26 07:40:13.684 241 263 I Magisk : bind_mount: /system/lib/libsonic.so
05-26 07:40:13.684 241 263 I Magisk : bind_mount: /system/lib/libstagefright_soft_avcdec.so
05-26 07:40:13.685 241 263 I Magisk : bind_mount: /system/lib/libstagefright_soft_avcenc.so
05-26 07:40:13.685 241 263 I Magisk : bind_mount: /system/lib/libstagefright_soft_mpeg2dec.so
05-26 07:40:13.685 241 263 I Magisk : bind_mount: /system/bin/patchoat
05-26 07:40:13.685 241 263 I Magisk : bind_mount: /system/bin/oatdump
05-26 07:40:13.685 241 263 I Magisk : bind_mount: /system/bin/dex2oat
05-26 07:40:13.685 241 263 I Magisk : bind_mount: /system/bin/app_process32
12-17 18:25:35.372 241 688 I Magisk : ** late_start service mode running
12-17 18:25:35.372 241 688 I Magisk : * Running service.d scripts
12-17 18:25:35.372 241 688 I Magisk : * Running module service scripts

Hope this helps in figuring out what could be causing the SN check failure.
 

Didgeridoohan

Forum Moderator / Developer Relations
Staff member
May 31, 2012
11,486
11,805
Gothenburg
Google Nexus 4
Nexus 6
@AndroMani

I suspected it'd be this:
Code:
Magisk : xposed_23: constructing magic mount structure

No can do passing SafetyNet with Xposed active... It can't be hidden. The best you can achieve is passing cts with a Xposed module that I can't remember the name of right now. It'll still fail basic integrity...

You can also disable the Xposed module in the Manager and reboot whenever you need to pass SafetyNet.
 

AndroMani

Senior Member
Dec 10, 2017
57
6
@AndroMani

I suspected it'd be this:
Code:
Magisk : xposed_23: constructing magic mount structure

No can do passing SafetyNet with Xposed active... It can't be hidden. The best you can achieve is passing cts with a Xposed module that I can't remember the name of right now. It'll still fail basic integrity...

You can also disable the Xposed module in the Manager and reboot whenever you need to pass SafetyNet.


Thank you for clarifying what could have caused the SN failure.

Infact, before checking your response, I disabled the Xposed module also as part of uninstalling the Viper4Android magisk module that was not working for me. (Still its not working after trying all available options within Magisk and checking other XDA threads. I think I need to dig more deep into it and get the right zip file for my phone to make it work. Though I know this is not the place for it, any suggestion in that front is welcome too). And to my surprise, I found that the system passed the SN check after reboot. Then, I realized the same that the Xposed module was causing the SN failure.

I was under the assumption that since Magisk provides a systemless Xposed framework for download, all modules
of Xposed will also work in a systemless manner just like the Magisk modules themselves. But I realized actually they are not.

That makes me to raise the following question: Why include Xposed framework within the Magisk manager in the first place when its modules will not work systemlessly? I also guessed the following answers for the same.

1. Provide the Xposed framework and its modules to be compatible with the Magisk manager users also so its features (those not available in stock rom or some useful customizations) can be used by those who have migrated from SuperSU way of rooting or using only the Magisk Manager for their rooting needs.

2. Those who need not bother about passing SafetyNet and finally,

3. Using the Magisk manager, those who needs to pass SafetyNet can simply turn it off (by disabling the Xposed framework), that way one can have the best of both worlds. The only hassle with this option is, the reboot time of the system after both enable/disable of Xposed is anywhere close to 30 minutes - the optimizing apps part - for me and I think that is too much. If it can be within 5 minutes or so, one can use it without any reservations. Not sure if it is related to the no. of apps I have OR the hardware specs I have.

(But ideally, I wish if the Xposed framework and all of its modules are developed the same way as Magisk Manager, we need not worry about passing SN even with Xposed installed. OR if Magisk hide can take care of hiding the Xposed framework also just like it currently hides the Xposed installer App. In that case, the System folder will not be touched at all and no hassle of losing the Xposed features after reboot. I am sure the XDA developers would have thought about this too and we might get a solution some time in future. Ofcourse, no ETAs in mind).

Your comments on the above answers to my question are welcome and thank you once again for all your support.
 

Didgeridoohan

Forum Moderator / Developer Relations
Staff member
May 31, 2012
11,486
11,805
Gothenburg
Google Nexus 4
Nexus 6
@AndroMani

The reason you find Xposed as a Magisk module is to make Xposed systemless. And it is just that, completely systemless. That's why you can disable it and reboot to pass SafetyNet again.

The issue is that Xposed is more than just the framework files. Those can easily be hidden by MagiskHide. Unfortunately, SafetyNet also checks the running zygote process and that can't be hidden...
 
  • Like
Reactions: AndroMani

AndroMani

Senior Member
Dec 10, 2017
57
6
@AndroMani

The reason you find Xposed as a Magisk module is to make Xposed systemless. And it is just that, completely systemless. That's why you can disable it and reboot to pass SafetyNet again.

The issue is that Xposed is more than just the framework files. Those can easily be hidden by MagiskHide. Unfortunately, SafetyNet also checks the running zygote process and that can't be hidden...

Thank you for your response. Now I got it and like I said before if only the reboot time after enable/disable of the Xposed module in Magisk is improved somehow, it will make users doubly happy - already it made life easier a lot easier though...
 

AndroMani

Senior Member
Dec 10, 2017
57
6
"No Device Check": http://repo.xposed.info/module/com.pyler.nodevicecheck
It works on Nougat! :laugh:

Thanks for the excellent Info!!!

Does it return "True" for both SafetyNet checks - that is, ctsProfrile & basicIntergrity? And how can we install that APK? -- Is it included as one of the Xposed installer modules OR it should be run separately with Xposed enabled in Magisk?

Correction: @Didgeridoohan has said that it still fails basicIntegrity check. So, only ctsProfile will pass.
 
Last edited:

manos78

Senior Member
Jan 17, 2014
808
304
Does it return "True" for both SafetyNet checks - that is, ctsProfrile & basicIntergrity?.
No. Sorry! It only returns TRUE for ctsProfile.
At time, it's impossible (as we know) to pass full SafetyNet checks with Xposed enabled.

And how can we install that APK? -- Is it included as one of the Xposed installer modules OR it should be run separately with Xposed enabled in Magisk?
It's in the Xposed official repository.
And regarding Xposed for Magisk, yes you need to use it, as you need to use this module plus the MagiskHide.
 

AndroMani

Senior Member
Dec 10, 2017
57
6
No. Sorry! It only returns TRUE for ctsProfile.
At time, it's impossible (as we know) to pass full SafetyNet checks with Xposed enabled.


It's in the Xposed official repository.
And regarding Xposed for Magisk, yes you need to use it, as you need to use this module plus the MagiskHide.

Thank you for the information. I will try it with Xposed enabled in Magisk and see what happens.
 

rufk

Member
Mar 31, 2018
8
2
Failed SafetyNet

Hey @Didgeridoohan
I have a Vodafone Smart Ultra 6, running LineageOS 14.1 (Equivalent Android M 7.1.4), and have Magisk v16 running, with root access and Magisk Hide masking that from most apps.
However, despite having no traces of SuperSU or the like, and not having Xposed installed, my phone passes the 'basicIntegrity' test but not the 'ctsProfileMatch'
I believe this is due to SafetyNet recognizing that the custom ROM isn't stock.
I have installed your prop editor Magisk module, and hopefully this should trick the SafetyNet so that it will pass.
What actual prop values do I need to change for this to work?
Thanks in advance :)
 

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