SYSTEM/LESS MODULE TEMPLATE FOR MAGISK
This template is a modified version of the original one.
Its purpose is to make Magisk Modules install in either Magisk (as a module) or directly in /system.
How to use/create a module:
Clone / download this repo
Open config.sh, follow the instructions written at the beginning of the file. You should at least change config.sh and module.prop
Zip your files, the zipped file is a flashable zip for both Magisk Manager and custom recoveries
Please check Notes for precautions
You can make a module from this template almost the same as you can make one in the Original template.
It should be easy to transition from there to here.
ADDITIONAL STUFF
Installation is configurable. It means that you can control on where it installs (system or magisk), and a few other variables that is also important.
For Devs:
Installation is configurable in config.sh. You can control the variables (starting in line 95) that will help you how to configure your module.
Code:
Variables:
[B]MAGISKINSTALL [/B]- forces magisk installation (might conflict with SYSTEMINSTALL) (values: [B]true [/B]or [B]false[/B])
[B]SYSTEMINSTALL [/B]- forces system installation (might conflict with MAGISKINSTALL) (values: [B]true[/B] or [B]false[/B])
[B]INITPATH [/B]- sets path to install scripts (post-fs-data.sh, service.sh) if system install (values: [B]directories[/B])
[B]BUILDPROP [/B]- sets properties from system.prop directly to build.prop (values: [B]true [/B]or [B]false[/B])
[B]PERMANENTDELETE [/B]- PERMANENTLY delete folders in $REPLACE (values: [B]true [/B]or [B]false[/B])
[B]ERROREXIT[/B] - exits with an error on every failed attempt to install to Magisk (enabled by default) (values: [B]true [/B]or [B]false[/B])
set_permissions_system
It behaves like set_permissions, but it sets them on whatever file you want and will be executed in system install only.
System Install
The directories in system folder will correspond to which directory the files will be copied.
Ex. if you put in the zip /system/example.file, it will be copied to /system/example.file.
Click to expand...
Click to collapse
For Users:
If a module is based on this template, you can also configure it's installation.
The variables that is in /dev/.config will overwrite the dev's setting for the module.
Code:
Variables:
[B]MAGISKINSTALL [/B]- forces magisk installation (might conflict with SYSTEMINSTALL) (values: [B]true [/B]or [B]false[/B])
[B]SYSTEMINSTALL [/B]- forces system installation (might conflict with MAGISKINSTALL) (values: [B]true[/B] or [B]false[/B])
[B]INITPATH [/B]- sets path to install scripts (post-fs-data.sh, service.sh) if system install (values: [B]directories[/B])
[B]BUILDPROP [/B]- sets properties from system.prop directly to build.prop (values: [B]true [/B]or [B]false[/B])
[B]PERMANENTDELETE [/B]- PERMANENTLY delete folders in $REPLACE (values: [B]true [/B]or [B]false[/B])
They need to be in /dev/.config to be read by the installer.
To enter them, just create the file and then add.
How to do it on Terminal:
Code:
Example:
echo "SYSTEMINSTALL=TRUE" >> /dev/.config
You can add them in different lines to be valid.
I put it in /dev/.config to make it a temporary file. So whenever a module is flashed, the file will be gone and won't interrupt the installation process of the currently installing module.
Click to expand...
Click to collapse
XDA:DevDB Information
System/Less Module Template for Magisk, Tool/Utility for all devices (see above for details)
Contributors
veez21, topjohnwu
Source Code: [url]https://github.com/veez21/unify-magisk-module-template[/URL]
Version Information
Status: Beta
Current Beta Version: v0.3
Beta Release Date: 2017-06-11
Created 2017-06-11
Last Updated 2017-06-14
Reserved
Reserved
reserved+
UPDATE TO v0.2
commit 3709f37
Changelog:
add more notes
fixed some terms
fix setting PERM
added ERROREXIT variable
added post-fs-data and late_start service scripts notes and better compatibility with system install
Hi veez. I like to know about how to edit default.prop using magisk module. There are somes ro. In default.prop i want to edit. I had seen some module make by others and i look at post-fs-data.sh they edit ro.fingerprint or dpi screen using magisk module it for build.prop. but now i want to edit default.prop . Can u help me how to edit default.prop using magisk module. I search on google some people said that i must to unpack boot.img to edit defaukt.prop thanks before. And I newbie for this magisk module.
Duden17 said:
Hi veez. I like to know about how to edit default.prop using magisk module. There are somes ro. In default.prop i want to edit. I had seen some module make by others and i look at post-fs-data.sh they edit ro.fingerprint or dpi screen using magisk module it for build.prop. but now i want to edit default.prop . Can u help me how to edit default.prop using magisk module. I search on google some people said that i must to unpack boot.img to edit defaukt.prop thanks before. And I newbie for this magisk module.
Click to expand...
Click to collapse
If you just want to set a new value to the prop, it's the same procedure as the modules you've been looking at. Just add the prop and new value to the system.prop file of the module and you're done. Shameless promotion: if you don't want to make a module yourself, my MagiskHide Props Config module can actually set custom props for you.
If you want to edit the default.prop file itself you're going to have to go about the way you found about unpacking the boot image, etc.
Didgeridoohan said:
If you just want to set a new value to the prop, it's the same procedure as the modules you've been looking at. Just add the prop and new value to the system.prop file of the module and you're done. Shameless promotion: if you don't want to make a module yourself, my MagiskHide Props Config module can actually set custom props for you.
If you want to edit the default.prop file itself you're going to have to go about the way you found about unpacking the boot image, etc.
Click to expand...
Click to collapse
Oke. I use ur module man. Its great for people need to change their cts or selinux. Good job :good::good: i will look at to ur magiskhide prop again. Thanks man
Not sure where to post this as I was looking for guide/s on how to create a magisk module for this feature.
iZLeeP said:
Not sure where to post this as I was looking for guide/s on how to create a magisk module for this feature.
Click to expand...
Click to collapse
This isn't. Also this template is abandoned.
You should start here https://github.com/topjohnwu/magisk-module-template
veez21 said:
This isn't. Also this template is abandoned.
You should start here https://github.com/topjohnwu/magisk-module-template
Click to expand...
Click to collapse
That was the first thing I did. I was just looking for additional sources to better understand on how to make a Magisk module as this is the first time I'm doing so. Anyway, thanks for pointing out.
Old topic but this is a great idea, I think a better way of doing this would be automatically detecting if magisk is installed and acting accordingly otherwise install to system..
Hi i want to make auto face unlock module
Could you please help me
and also want to make quick pin unlock module
ntrimurthulu said:
Hi i want to make auto face unlock module
Could you please help me
and also want to make quick pin unlock module
Click to expand...
Click to collapse
Not possible with magisk
Sent from my Moto G 2015 using XDA Labs
DanGLES3 said:
Not possible with magisk
Click to expand...
Click to collapse
Oh sad
---------- Post added at 05:11 PM ---------- Previous post was at 05:11 PM ----------
DanGLES3 said:
Not possible with magisk
Click to expand...
Click to collapse
Do you know other way
ntrimurthulu said:
Oh sad
---------- Post added at 05:11 PM ---------- Previous post was at 05:11 PM ----------
Do you know other way
Click to expand...
Click to collapse
The only way would be a custom ROM or xposed but it only supports up to Oreo and I don't think there's a module for face auto unlock
Sent from my Moto G 2015 using XDA Labs
DanGLES3 said:
The only way would be a custom ROM or xposed but it only supports up to Oreo and I don't think there's a module for face auto unlock
Click to expand...
Click to collapse
Yeah no such module that's why i want to create
BTW thank you
!Magisk is not activated !... abort
! Installation failed
obviously magisk is activated 19.1 ... is this template too old ?
edit: nevermind ... i just edited the zip directly from github so there was a folder in the root of the zip :silly:
Related
AS OF 03/07/2018
Support and development of this module have been discontinued.
A replacement module can be found here : https://forum.xda-developers.com/apps/magisk/module-magisk-selinux-manager-t3760042
This is a very simple module that installs a post-fs-data.sh script which enables SELinux Permissive Mode. This is useful for certain audio mods and removes the need to understand Magisk's file system & boot logic. No need to create your own scripts, just flash and forget.
I have only tested this on my Verizon HTC 10, but this module is so simple and generic that it should work on any Android device with SELinux.
This module has been tested on and is compatible with Magisk v11.6-15.2.
Disclaimer & Recommendations: This module should be used as a last resort only if appropriate SELinux Permissions can not be generated and injected into the SELinux Policy using selinux-inject, supolicy or magiskpolicy. Putting your device into Permissive Mode will essentially disable all of the operating system level security built into Android and allow any app in any context to do whatever it wants. Actions requiring root access will still trigger your SU Manager App, but all apps have elevated privileges due to permissive and may be able to take malicious actions on your device without needing root access. If you find that this module fixes issues you are experiencing with an app I recommend contacting the app developer and trying to work with them to isolate the necessary SELinux Permissions and have them injected into the SELinux Policy at startup.
Here is a discussion of some of concerns to consider when running your device in Permissive Mode : https://forum.xda-developers.com/general/general/discussion-root-selinux-risks-t3607295
Github Repo : https://github.com/Jman420/magisk-permissive-script
Change Log :
v1.0 - Initial Release
v1.1 - Update to Module Template v1400
v1.2 - Update to Module Template v1500
thank you brother!
LeEco LePro 3 Atmos can work finally!
huaiyue said:
thank you brother!
Can you tell me how to install LeEco LePro 3 Atmos ?
I hava supersu systemless.
Click to expand...
Click to collapse
These two things are completely unrelated.
If you want to install something, you install it. There's not much more to that.
huaiyue said:
thank you brother!
Can you tell me how to install LeEco LePro 3 Atmos ?
I hava supersu systemless.
Click to expand...
Click to collapse
In Magisk, go to the Modules section, and select the "+", and select the zip you downloaded.
Jman420 said:
This is a very simple module that installs a post-fs-data.sh script which enables SELinux Permissive Mode. This is useful for certain audio mods and removes the need to understand Magisk's file system & boot logic. No need to create your own scripts, just flash and forget.
I have only tested this on my Verizon HTC 10, but this module is so simple and generic that it should work on any Android device with SELinux.
Github Repo : https://github.com/Jman420/magisk-permissive-script
Click to expand...
Click to collapse
LeEco LePro 3 Atmos can work
however
xposed systemless failed.
---------- Post added at 01:32 ---------- Previous post was at 01:31 ----------
ahrion said:
These two things are completely unrelated.
If you want to install something, you install it. There's not much more to that.
Click to expand...
Click to collapse
http://imgur.com/a/Sbf9p
dolby fc.
---------- Post added at 01:36 ---------- Previous post was at 01:32 ----------
jhedfors said:
In Magisk, go to the Modules section, and select the "+", and select the zip you downloaded.
Click to expand...
Click to collapse
thank you brother!
Thanks a lot
huaiyue said:
thank you brother!
LeEco LePro 3 Atmos can work finally!
Click to expand...
Click to collapse
Regarding your other post mentioning Xposed (which I'm not quoting cause it's a mess). I'm running on Nougat so I can't use Xposed and haven't tested with it. If you give me more details I can try to determine what the issue is. Logs, error messages, symptoms would all be helpful.
Thor™ said:
Thanks a lot
Click to expand...
Click to collapse
I aim to please
I don't understand why this mod is usefull. In the latest version of magisk, there is a semi enforce/permissive linux bypass. The system thinks it's enforced, but in reality is permissive. Or maybe I didn't fully understand it?
its working with s5neo?
I've just flashed this zip. This allows Viper4Android to run in enforcing mode:
https://www.dropbox.com/s/k9cnruw2e1t1d4t/ViPER4Android-supolicy.zip?dl=0
I forgot the source. Maybe Google it
matssa said:
I don't understand why this mod is usefull. In the latest version of magisk, there is a semi enforce/permissive linux bypass. The system thinks it's enforced, but in reality is permissive. Or maybe I didn't fully understand it?
Click to expand...
Click to collapse
I agree that Magisk hides the actual SELinux Mode in such a way that if Magisk Hide is enabled the 'getenforce' command always returns 'Enforcing'. But if you do not run the 'setenforce 0' command the SELinux mode will still be set to 'Enforcing' rather than 'Permissive'. This script puts the SELinux mode into 'Permissive' at startup. Magisk Hide will still hide the fact that you are in Permissive Mode, which I believe is the 'pseudo permissive' mode that Magisk describes. But I can not find any settings or commands within Magisk that enable Permissive Mode.
htr5 said:
I've just flashed this zip. This allows Viper4Android to run in enforcing mode:
https://www.dropbox.com/s/k9cnruw2e1t1d4t/ViPER4Android-supolicy.zip?dl=0
I forgot the source. Maybe Google it
Click to expand...
Click to collapse
It's just a shell script, the source is in the zip file. This is really helpful and is the direction I want to take this project. Permissive Mode is great in that it gets the Apps/Mods that we want to run to work, but I consider it the equivalent of using a sledgehammer to hammer in a finishing nail. I would much rather be able to grant the specific permissions that each App needs rather than enable all permissions for all apps (which is what permissive mode does).
I plan on trying to develop an App which will assist in managing and generating a script which uses 'supolicy' to inject individual SELinux Policy Permissions. I had planned on using the Dolby Atmos LePro3 build as a guinea pig to try to isolate which permissions it needs and put together the supolicy command for them. I've hit a bit of a roadblock in verifying my supolicy command due to the format that the SELinux Policy is stored in on the device. I've found a project called sedump (https://ge0n0sis.github.io/posts/2015/12/exploring-androids-selinux-kernel-policy/) which claims to deserialize the Binary SELinux Policy to a readable format, but I can't seem to get it to work... the process seems to complete, but it generates an empty file... If anyone has experience with SELinux I'd really appreciate any feedback.
cosmin691 said:
its working with s5neo?
Click to expand...
Click to collapse
Dunno, I've only got an HTC 10 for testing. Give it a shot, if it doesn't work just uninstall the Magisk Package. Remember to disable Magisk Hide if you are testing to make sure it actually put your phone into Permissive Mode by using the 'getenforce' command.
It works for oneplus 3t on freedom OS rom.
Jman420 said:
This is a very simple module that installs a post-fs-data.sh script which enables SELinux Permissive Mode. This is useful for certain audio mods and removes the need to understand Magisk's file system & boot logic. No need to create your own scripts, just flash and forget.
I have only tested this on my Verizon HTC 10, but this module is so simple and generic that it should work on any Android device with SELinux.
Github Repo : https://github.com/Jman420/magisk-permissive-script
Click to expand...
Click to collapse
this zip must be flashed using twrp rite ? or stock recovery also will do fine ? because i tried many times to flash recovery for samsung e5 5.1.1 but ended up with boot loop. now running all stock !!
X_GOD said:
this zip must be flashed using twrp rite ? or stock recovery also will do fine ? because i tried many times to flash recovery for samsung e5 5.1.1 but ended up with boot loop. now running all stock !!
Click to expand...
Click to collapse
Should be able to install it through Magisk Manager or TWRP. Let me know if you have problems.
matssa said:
I don't understand why this mod is usefull. In the latest version of magisk, there is a semi enforce/permissive linux bypass. The system thinks it's enforced, but in reality is permissive. Or maybe I didn't fully understand it?
Click to expand...
Click to collapse
Now, I have magisk 11.6 on EMUI marshmallows V4A driver was abnormal because Enforcing selinux. Same happened with SuperSU 2.79. When I changed to permissive mode using terminal emulato/kernerl aduitor init.d script emulator/su.d SuperSU script, V4A driver was normal and it was processing. I like Magisk a lot because of its xposed like modules. Now using jman420's permissive magisk module.
Thor™ said:
Now, I have magisk 11.6 on EMUI marshmallows V4A driver was abnormal because Enforcing selinux. Same happened with SuperSU 2.79. When I changed to permissive mode using terminal emulato/kernerl aduitor init.d script emulator/su.d SuperSU script, V4A driver was normal and it was processing. I like Magisk a lot because of its xposed like modules. Now using jman420's permissive magisk module.
Click to expand...
Click to collapse
Without this module, ARISE is working fine, processing in 48000 on my side, so for V4A I don't think this is necessary, at least on my side.
Sent from my OnePlus3 using XDA Labs
matssa said:
Without this module, ARISE is working fine, processing in 48000 on my side, so for V4A I don't think this is necessary, at least on my side.
Click to expand...
Click to collapse
For ARISE I used to flash permissive script by osm0sis. Otherwise no luck with V4A, AM3D and Dolby.
Thor™ said:
For ARISE I used to flash permissive script by osm0sis. Otherwise no luck with V4A, AM3D and Dolby.
Click to expand...
Click to collapse
Strange... Did you enable magisk hide? If not, that is the reason.
Sent from my OnePlus3 using XDA Labs
matssa said:
Strange... Did you enable magisk hide? If not, that is the reason.
Click to expand...
Click to collapse
No, I was using SuperSU 2.79. Same happened with MagiskSU.
Note: This module won't work with v10-v11.6 since some syntax err in the mounting scripts. More info here. https://github.com/topjohnwu/Magisk/commit/624b7616d082feced71bff0474c64c1b4afd5cc0
If you're using a beta one newer than v11.6. Try this module.
Init.d Link (Magisk)
Intro
The module solves the situation when /system/etc/init.d doesn't exist, some app, let's say Kernel Auditor Beta, doesn't recognize the *.d folder provided by MagiskSU and tries to create the init.d folder by itself. So we'd better symlink one from an available *.d — post-fs-data.d, service.d or su.d.
- The module symlinks a *.d folder as init.d,
- or simply create one systemlessly.
- Init.d scripts will be run by an existing superuser — MagiskSU, phh's superuser or SuperSU — or the kernel,
- but NOT by the module itself, in case of collision with the func of kernel.
Symlink Priority:
1. /magisk/.core/service.d (Magisk v12)
2. /magisk/.core/post-fs-data.d (Magisk v11)
3. /magisk/phh/su.d
4. /su/su.d
5. /magisk/.core/post-fs-data.d (Magisk v12)
6. /magisk/.core/service.d (Magisk v11)
The last resort will be the creation of a systemless init.d folder.
NOTE: init.d will be symlinked only if available *.d foler exists.
Installation
Flash it in RECOVERY ONLY.
Credit
https://github.com/laggardkernel/init.d-link by laggardkernel
Changelog
v1.3
- Fix mount of su.img
v1.2
- Update to module template v3
- Add link target info into module.prop.
- Reorder init.d link priority for Magisk v12:
1. /magisk/.core/service.d (Magisk v12)
2. /magisk/.core/post-fs-data.d (Magisk v11)
3. /magisk/phh/su.d
4. /su/su.d
5. /magisk/.core/post-fs-data.d (Magisk v12)
6. /magisk/.core/service.d (Magisk v11)
- There is also a post-fs-data branch keep post-fs-data.d at high priority by force.
Reserved.
How to use this module?
ngtung84 said:
How to use this module?
Click to expand...
Click to collapse
Just download the zip and flash it in your recovery. Then the module will create a /system/etc/init.d link directing to /magisk/.core/post-fs-data.d SYSTEMLESS. This will solve the pain that some apps, like Kernel Manager beta, don't recognize Magisk's post-fs-data.d and create a init.d itself to put their init scripts.
laggardkernel said:
Just download the zip and flash it in your recovery. Then the module will create a /system/etc/init.d link directing to /magisk/.core/post-fs-data.d SYSTEMLESS. This will solve the pain that some apps, like Kernel Manager beta, don't recognize Magisk's post-fs-data.d and create a init.d itself to put their init scripts.
Click to expand...
Click to collapse
I have some scripts. Can I put them into /system/etc/init.d created by this module?
You make some really nice little modules. I really believe you should submit them to the repo... It's gonna need some updating to the latest template and maybe also some updates for v12 though. From the v12 release notes:
It is recommended to run most scripts in the service mode (service.d/service.sh), except a. mounting files; b. patching system props; c. time critical operations
Click to expand...
Click to collapse
Didgeridoohan said:
You make some really nice little modules. I really believe you should submit them to the repo... It's gonna need some updating to the latest template and maybe also some updates for v12 though. From the v12 release notes:
Click to expand...
Click to collapse
Gotta disagree with you here. This module is ALL OVER THE PLACE. The code in the startup scripts is doing TONS of unadvertised stuff:
There is code related to @ahrion Dolby Atmos (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L108) that will potentially put your device into Permissive Mode without telling you.
No idea what this code is doing, but certainly doesn't relate to init.d symlinks (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L93).
Appears to attempt to install a non-existent APK called '*.apk' with package name '*.*.*' (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L68).
And that's all on every startup.
I would be careful with this module...
Jman420 said:
Gotta disagree with you here. This module is ALL OVER THE PLACE. The code in the startup scripts is doing TONS of unadvertised stuff:
There is code related to @ahrion Dolby Atmos (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L108) that will potentially put your device into Permissive Mode without telling you.
No idea what this code is doing, but certainly doesn't relate to init.d symlinks (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L93).
Appears to attempt to install a non-existent APK called '*.apk' with package name '*.*.*' (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L68).
And that's all on every startup.
I would be careful with this module...
Click to expand...
Click to collapse
Hm... Thank's for pointing that out. I'm not at all fluent enough in scripting to have caught that without some serious scrutiny, and I've not had the time for that today.
Perhaps we'll get an explanation from @laggardkernel about what's going on.
Didgeridoohan said:
Hm... Thank's for pointing that out. I'm not at all fluent enough in scripting to have caught that without some serious scrutiny, and I've not had the time for that today.
Perhaps we'll get an explanation from @laggardkernel about what's going on.
Click to expand...
Click to collapse
Best guess i can come up with is that stuff is left over from other experiments. He seems to be using the same repo for multiple projects and separating them with branches. That seems to have caused some cross contamination in his branches.
As a general development rule you should have one project/solution per repo. Your branches usually represent new features for the project.
Jman420 said:
Best guess i can come up with is that stuff is left over from other experiments. He seems to be using the same repo for multiple projects and separating them with branches. That seems to have caused some cross contamination in his branches.
As a general development rule you should have one project/solution per repo. Your branches usually represent new features for the project.
Click to expand...
Click to collapse
If you look in config.sh you'll see that the module isn't even using post-fs-data.sh (POSTFSDATA=false). And the files on GitHub doesn't match the files in the module zip. Look at update-binary in the zip and then on GitHub. In the zip you'll find the symlinking, but not on GitHub...
So yeah, I guess we're talking about a bunch of code left over from previous experiments.
Jman420 said:
Gotta disagree with you here. This module is ALL OVER THE PLACE. The code in the startup scripts is doing TONS of unadvertised stuff:
There is code related to @ahrion Dolby Atmos (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L108) that will potentially put your device into Permissive Mode without telling you.
No idea what this code is doing, but certainly doesn't relate to init.d symlinks (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L93).
Appears to attempt to install a non-existent APK called '*.apk' with package name '*.*.*' (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L68).
And that's all on every startup.
I would be careful with this module...
Click to expand...
Click to collapse
I took all of that setenforce stuff out of my script. And in my release notes it clearly stated when I release v1.2 that I added the script to AudModLib. However I removed it because I found a workaround in v1.3.
With Audmodlib we have only audio server media server, and system prop contextd permissible for ONLY system and priv apps. Which is what I had to replace with the setenforce stuff.
He's not doing anything shady when looking at the code, it looks like he was following my example. I would submit a git issue to tell him to update the mod.
Hope this clears things up man.
Jman420 said:
Gotta disagree with you here. This module is ALL OVER THE PLACE. The code in the startup scripts is doing TONS of unadvertised stuff:
There is code related to @ahrion Dolby Atmos (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L108) that will potentially put your device into Permissive Mode without telling you.
No idea what this code is doing, but certainly doesn't relate to init.d symlinks (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L93).
Appears to attempt to install a non-existent APK called '*.apk' with package name '*.*.*' (https://github.com/laggardkernel/magisk-module-template/blob/init.d/common/post-fs-data.sh#L68).
And that's all on every startup.
I would be careful with this module...
Click to expand...
Click to collapse
1. Look into the config.sh;
2. Post-fs-data.sh, service.sh are NOT enabled;
3. Post-fs-data.sh, service.sh will NOT be copied to your device.
4. I use a template with some additional features myself. Maybe I'm too laggard to clean up unused codes. But I'm sure I commented out, disabled all unnecessary parts.
laggardkernel said:
Maybe I'm too laggard to clean up unused codes.
Click to expand...
Click to collapse
Ha ha!
But yeah, like it shows, you're gonna scare some people leaving it in there.
True, you'll only get scared if you don't look at the entire thing, but still...
laggardkernel said:
Maybe I'm too laggard to clean up unused codes.
Click to expand...
Click to collapse
hehehe, i see what you did there.
laggardkernel said:
1. Look into the config.sh;
2. Post-fs-data.sh, service.sh are NOT enabled;
3. Post-fs-data.sh, service.sh will NOT be copied to your device.
4. I use a template with some additional features myself. Maybe I'm too laggard to clean up unused codes. But I'm sure I commented out, disabled all unnecessary parts.
Click to expand...
Click to collapse
Yeah, deeper review does show that those scripts aren't installed or used. But leaving them there makes reviewing the module much harder since you have to go looking for that 1 flag which indicates they aren't used. As a developer if I see code in a script I expect that it's meant to be executed and a reviewer won't necessarily know which piece is correct (the flag disabling the script or the script itself).
The module is definitely benign, but on a quick surface review the dead code seems strange in the context of the module itself. Just a suggestion, but cleaning up that dead code would make the module easier to review and avoid having that code get executed accidentally or misinterpreted.
Didgeridoohan said:
But yeah, like it shows, you're gonna scare some people leaving it in there.
True, you'll only get scared if you don't look at the entire thing, but still...
Click to expand...
Click to collapse
Even a full review would raise some concerns with me. Mainly which is correct; having the script disabled or enabled. That concern can only be addressed through a discussion like this. A full review would make me feel a bit more secure since the script isn't executed, but would make me question whether the full functionality of the module is actually in place.
@laggardkernel This is all good work, so I hope you don't take any of this the wrong way. I just happen to do development (more accurately software engineering) as a career and see this kind of stuff all over the place in enterprise software and it makes my eyes bleed every time I see it. Now that I've gotten into a cyber security role I'm even more sensitive to this stuff since they end up constituting security holes (either maliciously or accidentally, usually the latter).
Flash it from recovery, it say Error... because there is already has init.D folder ?
So i have to delete the folder first ?
Vuska said:
Flash it from recovery, it say Error... because there is already has init.D folder ?
So i have to delete the folder first ?
Click to expand...
Click to collapse
If you already have init.d support you don't need this module.
And if you want proper help, where's your recovery log?
Does this module already support Magisk 13.1?
Magisker said:
Does this module already support Magisk 13.1?
Click to expand...
Click to collapse
Not yet. I haven't migrated to v13+ and I'm still waiting for the update of the all-in-one wiki.
laggardkernel said:
Not yet. I haven't migrated to v13+ and I'm still waiting for the update of the all-in-one wiki.
Click to expand...
Click to collapse
The template v4 is already there tho
https://github.com/topjohnwu/magisk-module-template
magisk 14 does not mount magisk.img. It creates a different set up. There is no magisk folder at root containing post-fs-data.d and service.d folders. If they are not there in magisk 14, where are the scripts to be placed for running at boot. Anybody could help on this.
As title says i want to edit build prop, any modules or something?
@topjohnwu is currently implementing this into Magisk Manager. As for now you can use:
Code:
/data/magisk/resetprop build.prop.item value
loserskater said:
@topjohnwu is currently implementing this into Magisk Manager. As for now you can use:
Code:
/data/magisk/resetprop build.prop.item value
Click to expand...
Click to collapse
Ok im lost not sure how to do that? I need to make a module?
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.
Didgeridoohan said:
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.
Click to expand...
Click to collapse
Thanks, if i use magisk hide it will hide this too right?
Cheers
I added this:
/data/magisk/resetprop ro.product.model "Pixel XL"
/data/magisk/resetprop ro.opa.eligible_device true
/data/magisk/resetprop ro.product.brand "google"
/data/magisk/resetprop ro.product.manufacturer "Google"
In the post fs data of another module so i basically hacked in the build prop, but magisk hide fails (doesn't fail when i don't mess with the build prop)
metrize said:
I added this:
/data/magisk/resetprop ro.product.model "Pixel XL"
/data/magisk/resetprop ro.opa.eligible_device true
/data/magisk/resetprop ro.product.brand "google"
/data/magisk/resetprop ro.product.manufacturer "Google"
In the post fs data of another module so i basically hacked in the build prop, but magisk hide fails (doesn't fail when i don't mess with the build prop)
Click to expand...
Click to collapse
There's a module for activating Google assistant in the repo already. Have you tried that?
Didgeridoohan said:
There's a module for activating Google assistant in the repo already. Have you tried that?
Click to expand...
Click to collapse
I'm more interested in changing the device so that it thinks it's a pixel. It fails safetynet even with magisk hide when i do this though
metrize said:
I'm more interested in changing the device so that it thinks it's a pixel. It fails safetynet even with magisk hide when i do this though
Click to expand...
Click to collapse
Why?
I'm not sure about the details, but if your device doesn't match a profile Google have on their servers you won't get a CTS profile match. That might be why...
Can you pass basic integrity with the mods you made?
Didgeridoohan said:
Why?
I'm not sure about the details, but if your device doesn't match a profile Google have on their servers you won't get a CTS profile match. That might be why...
Can you pass basic integrity with the mods you made?
Click to expand...
Click to collapse
it's for google photos unlimited original backup (only on pixels)
Without the mods i did above I can pass safetynet and everything fine
With the mods nothing psses not even basic integrity.
Can build.prop be reset with magisk hide or is that functionality not possible on android?
If it could reset build.prop to the original build.prop then I would pass safetynet, but I'm not sure if magisk can do this? @topjohnwu maybe might know?
metrize said:
it's for google photos unlimited original backup (only on pixels)
Without the mods i did above I can pass safetynet and everything fine
With the mods nothing psses not even basic integrity.
Can build.prop be reset with magisk hide or is that functionality not possible on android?
If it could reset build.prop to the original build.prop then I would pass safetynet, but I'm not sure if magisk can do this? @topjohnwu maybe might know?
Click to expand...
Click to collapse
It's possible... You can edit the enable and disable files in /magisk/.core/magiskhide/ to do what you want.
Didgeridoohan said:
There's a module for activating Google assistant in the repo already. Have you tried that?
Click to expand...
Click to collapse
Didgeridoohan said:
It's possible... You can edit the enable and disable files in /magisk/.core/magiskhide/ to do what you want.
Click to expand...
Click to collapse
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
metrize said:
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
Click to expand...
Click to collapse
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.
Didgeridoohan said:
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.
Click to expand...
Click to collapse
Am I right in assuming when magisk hide is disabled the build prop will be changed back to the pixel one?
thanks
ok it's working just going to do the disable one
Okay, when I did the enable magiskhide and changed it, it passes safetynet but then when I changed the dsiable magiskhide file it fails safetynet now even when i enable magiskhide.. weird
core only works though with changes to both enable and disable so now im muffed
Dammit... Now you piqued my curiosity.
I'm heading to bed (shoulda done that 3 hours ago), but if you post your enable and disable files I'm sure someone can take a look at it. If not, I'm around again after a few hours of z and some breakfast.
Attached enable and disable.
(Renamed it to txt file otherwise wouldn't let it upload)
For the module it's just a system.prop module with the following lines;
# This file will be read by resetprop
# Example: Change dpi
# ro.sf.lcd_density=320
ro.product.model=Pixel
ro.product.brand=google
ro.product.manufacturer=Google
When I go core only mode, enable magisk hide then disable (to get the build prop change) then enable magisk hide again it works though. So I think it's something with the module that makes it fail
metrize said:
When I go core only mode, enable magisk hide then disable (to get the build prop change) then enable magisk hide again it works though. So I think it's something with the module that makes it fail
Click to expand...
Click to collapse
How about without the module installed and Core only mode disable?
Since you seem to have a working setup with the enable/disable scripts I'd consider just using those. You could even set up automation with Tasker or a similar app. Use the following code in a Run Shell action:
Code:
sh /magisk/.core/magiskhide/enable
And the same for the disable script.
Dear Members iam not a developer so i am looking for someone who can convert attached file into Magisk Module.. This TWRP zip contain vendor files for Sharp Aquos S3 (HH6) and iam using it to run Android One which is for device HH1..
If it is possible for anyone please.
I downloaded this file from 4PDA so i can not request them to convert as i don't know russian to communicate
You don't need to be a developer to create a Magisk module. You've got the module template right here: https://github.com/topjohnwu/magisk-module-installer
Simply take the vendor directory from the original zip and place it in the system directory of the module template. Then you can update the info in module.prop to something descriptive (so you know which module it is in the modules list later), zip up the template and flash it.
Great Thanks alot i will do it right away
Didgeridoohan said:
You don't need to be a developer to create a Magisk module. You've got the module template right here: https://github.com/topjohnwu/magisk-module-installer
Simply take the vendor directory from the original zip and place it in the system directory of the module template. Then you can update the info in module.prop to something descriptive (so you know which module it is in the modules list later), zip up the template and flash it.
Click to expand...
Click to collapse
Iam getting an error as below
Copying zip to temp_directory
Installing module.zip
Installation failed
Where I can see what is wrong, i simply copied vendor folder from original TWRP zip folder and pasted into system folder of module template as instructed
There are no logs in Magisk Manager > Logs
Didgeridoohan said:
You don't need to be a developer to create a Magisk module. You've got the module template right here: https://github.com/topjohnwu/magisk-module-installer
Simply take the vendor directory from the original zip and place it in the system directory of the module template. Then you can update the info in module.prop to something descriptive (so you know which module it is in the modules list later), zip up the template and flash it.
Click to expand...
Click to collapse
jameelmemon said:
Iam getting an error as below
Copying zip to temp_directory
Installing module.zip
Installation failed
Where I can see what is wrong, i simply copied vendor folder from original TWRP zip folder and pasted into system folder of module template as instructed
There are no logs in Magisk Manager > Logs
Click to expand...
Click to collapse
I'm gonna guess you didn't replace the dummy update-binary with the proper installation script. It's detailed in the documentation but I could probably have mentioned it... Here's the relevant part of the docs: https://topjohnwu.github.io/Magisk/guides.html#magisk-module-installer
Didgeridoohan said:
I'm gonna guess you didn't replace the dummy update-binary with the proper installation script. It's detailed in the documentation but I could probably have mentioned it... Here's the relevant part of the docs: https://topjohnwu.github.io/Magisk/guides.html#magisk-module-installer
Click to expand...
Click to collapse
After Following all instructions, module gets installed but it is not effective
After analyzing files that this module loads I think they doesn't work as they do not execute as they should, I maybe wrong here, but i think these scripts need to be split and placed / executed in different way.
here is code from vendor/etc/init/hw/init.sku.rc
on fs
setprop persist.radio.skt_iot 1
setprop persist.vendor.ims.no_stapa 1
setprop ro.product.first_api_level 27
setprop ro.product.vendor.brand SHARP
setprop ro.product.vendor.model FS8032
setprop ro.product.vendor.name FS8032_00A0
setprop ro.product.vendor.device HH6_sprout
setprop ro.product.vendor.manufacturer SHARP
on post-fs
setprop persist.sys.security_enable false
setprop persist.radio.multisim.config dsds
on fs
setprop ro.vendor.build.fingerprint SHARP/FS8032_00A0/HH6_sprout:9/PPR1.180610.011/FS8032S0314P:user/release-keys
there are 2 files init.fingerprint.gxfp5288_sd1.rc and init.fingerprint.gxfp3258_sd1.rc containing on post-fs-data which should be placed in common/post-fs-data.sh file, but i don't know about on fs or other parts.
whereas vendor/etc/init/hw/init.HH1.target.rc imports some existing scripts from vendor folder and executes code on boot, on pre-boot and on init
from prename of each file i guess they can be executed as init.d script if so how i can use a module to convert them as init.d scripts and load effectively
All the props (the setprop commands) can be placed in the module system.prop file (don't forget to also activate it in install.sh). The rest of the commands would have to be converted to the post-fs-data.sh and service.sh module scripts, depending on when they're needed (again, don't forget to activate them in install.sh). The service.sh script runs later in the boot process.
I can unfortunately not help you there though. Time is a way too valuable commodity...
Setprop i can do but can you please have a look into the files and explain to me how i would rewrite the script or point me to a tutorial would be great help
Didgeridoohan said:
All the props (the setprop commands) can be placed in the module system.prop file (don't forget to also activate it in install.sh). The rest of the commands would have to be converted to the post-fs-data.sh and service.sh module scripts, depending on when they're needed (again, don't forget to activate them in install.sh). The service.sh script runs later in the boot process.
I can unfortunately not help you there though. Time is a way too valuable commodity...
Click to expand...
Click to collapse
Hello,
I need to tinker my build.prop file to test out a few things.
I read about resetprop, so i have a few questions.
1. What should the filename of the text file be?
2. Where do i need to paste that file for magisk to load it upon startup everytime to alter build.prop systemlessly?
Hey @Didgeridoohan please help!
Thanks.
Short answer: use MagiskHide Props Config.
Long answer when I get an opportunity.
Didgeridoohan said:
Short answer: use MagiskHide Props Config.
Long answer when I get an opportunity.
Click to expand...
Click to collapse
I tried that.
But the boot process is ridiculously slow. It takes over a minute for every boot.
I just need to change a couple of variables systemlessly.
I am reading the documentation since the last 2 days. I read about the magisk boot process from the Magisk Documentation and documentation on "Magisk Hide Props" too, but still had these doubts.
I just need to know that where should i place "resetprop" with relevant flags and options, for magisk to make changes to the fingerprint automatically on boot.
Even a brief help would suffice!
That's interesting... If you wouldn't mind, could you install the module again, set it up and then provide me with the module and Magisk logs? It should not cause that kind of boot delay...
Anyway, just like I write in the introduction of MagiskHide Props Config in the documentation, the module is just a way to make a Magisk boot script to set props using resetprop.
All you need to do to spoof a device fingerprint is to use a boot script in service.d. I've described it in the Magisk guide already, right here:
https://didgeridoohan.com/magisk/MagiskHide#hn_Spoofing_device_fingerprint
i don't know about the context, but it looks to me like it's as simple as creating a magisk module
Developer Guides
The Magic Mask for Android
topjohnwu.github.io
you'll need to place property entries in system.prop