FORUMS
Remove All Ads from XDA

[DEPRECATED][MODULE TEMPLATE][DEV] System/Less Magisk Module Template

2,160 posts
Thanks Meter: 2,557
 
Post Reply Email Thread
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:
  1. Clone / download this repo
  2. Open config.sh, follow the instructions written at the beginning of the file. You should at least change config.sh and module.prop
  3. Zip your files, the zipped file is a flashable zip for both Magisk Manager and custom recoveries
  4. 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:
Quote:

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:
MAGISKINSTALL - forces magisk installation (might conflict with SYSTEMINSTALL) (values: true or false)
SYSTEMINSTALL - forces system installation (might conflict with MAGISKINSTALL) (values: true or false)
INITPATH - sets path to install scripts (post-fs-data.sh, service.sh) if system install (values: directories)
BUILDPROP - sets properties from system.prop directly to build.prop (values: true or false)
PERMANENTDELETE - PERMANENTLY delete folders in $REPLACE (values: true or false)
ERROREXIT - exits with an error on every failed attempt to install to Magisk (enabled by default) (values: true or false)
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.


For Users:
Quote:

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:
MAGISKINSTALL - forces magisk installation (might conflict with SYSTEMINSTALL) (values: true or false)
SYSTEMINSTALL - forces system installation (might conflict with MAGISKINSTALL) (values: true or false)
INITPATH - sets path to install scripts (post-fs-data.sh, service.sh) if system install (values: directories)
BUILDPROP - sets properties from system.prop directly to build.prop (values: true or false)
PERMANENTDELETE - PERMANENTLY delete folders in $REPLACE (values: true or false)
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.

XDA:DevDB Information
System/Less Module Template for Magisk, Tool/Utility for all devices (see above for details)

Contributors
veez21, topjohnwu
Source Code: https://github.com/veez21/unify-magisk-module-template


Version Information
Status: Beta
Current Beta Version: v0.3
Beta Release Date: 2017-06-11

Created 2017-06-11
Last Updated 2017-06-14
The Following 15 Users Say Thank You to veez21 For This Useful Post: [ View ] Gift veez21 Ad-Free
 
 
11th June 2017, 11:46 AM |#2  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,557
 
Donate to Me
More
Reserved
11th June 2017, 11:46 AM |#3  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,557
 
Donate to Me
More
Reserved
11th June 2017, 03:36 PM |#4  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,557
 
Donate to Me
More
reserved+
13th June 2017, 03:02 PM |#5  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,557
 
Donate to Me
More
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
The Following User Says Thank You to veez21 For This Useful Post: [ View ] Gift veez21 Ad-Free
28th April 2018, 06:24 AM |#6  
Member
Thanks Meter: 2
 
More
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.
28th April 2018, 07:48 AM |#7  
Didgeridoohan's Avatar
Recognized Contributor
Flag Gothenburg
Thanks Meter: 6,711
 
Donate to Me
More
Quote:
Originally Posted by Duden17

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.

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.
29th April 2018, 04:58 PM |#8  
Member
Thanks Meter: 2
 
More
Quote:
Originally Posted by Didgeridoohan

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.

Oke. I use ur module man. Its great for people need to change their cts or selinux. Good job i will look at to ur magiskhide prop again. Thanks man
28th June 2018, 02:18 AM |#9  
Senior Member
Flag Manila
Thanks Meter: 151
 
More
Not sure where to post this as I was looking for guide/s on how to create a magisk module for this feature.
28th June 2018, 10:50 AM |#10  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,557
 
Donate to Me
More
Quote:
Originally Posted by iZLeeP

Not sure where to post this as I was looking for guide/s on how to create a magisk module for this feature.

This isn't. Also this template is abandoned.
You should start here https://github.com/topjohnwu/magisk-module-template
29th June 2018, 04:33 AM |#11  
Senior Member
Flag Manila
Thanks Meter: 151
 
More
Quote:
Originally Posted by veez21

This isn't. Also this template is abandoned.
You should start here https://github.com/topjohnwu/magisk-module-template

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.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes