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

veez21

Senior Member
Feb 22, 2016
2,172
2,704
183
Guess Where
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:
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.

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.
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
 
Last edited:

Duden17

Member
Dec 20, 2017
32
3
8
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.
 

Didgeridoohan

Forum Moderator / Developer Relations
Staff member
May 31, 2012
10,951
10,720
253
Gothenburg
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.
 

Duden17

Member
Dec 20, 2017
32
3
8
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 :good::good: i will look at to ur magiskhide prop again. Thanks man :D:D
 

fOmey

Recognized Developer
Mar 7, 2009
4,121
5,436
263
Sydney, AUS
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..
 

DanGLES3

Senior Member
Nov 11, 2017
729
709
93
Oh sad

---------- Post added at 05:11 PM ---------- Previous post was at 05:11 PM ----------


Do you know other way
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
 

Ulf3000

Senior Member
Aug 7, 2014
101
10
0
!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:
 
Last edited: