FORUMS
Remove All Ads from XDA

Magisk Module development help

30 posts
Thanks Meter: 0
 
By eris667, Member on 13th January 2020, 04:18 AM
Post Reply Email Thread
This is my first attempt at a Magisk Module (to fix a issue with a few poorly coded legacy apps and not trip safety net) inject or replace a font and set proper permission on the file

My super simple experiment is here (based on the template from Git)

https://drive.google.com/file/d/1PHd...fo4FtqlfoxshOM

Magisk gives me a error when I try to install
I probably did something wrong, hopefully someone can point me in the correct direction (error one, not a valid Magisk Module, error two Magisk is not activated)

I appreciate any insight - please move this post to the correct location if needed
13th January 2020, 05:02 AM |#2  
Didgeridoohan's Avatar
Forum Moderator
Thanks Meter: 8,472
 
Donate to Me
More
If you want someone to look at the module you'll have to enable sharing for the file first...

But, your errors are usually:
1 - the zip has been packaged wrongly (not the proper file/directory structure
2 - using an old template

Take a look in the official docs on how to work with the current module and module installation setup:
https://topjohnwu.github.io/Magisk/guides.html
13th January 2020, 05:04 AM |#3  
OP Member
Thanks Meter: 0
 
More
Let's try this link:
https://drive.google.com/file/d/1PHd...ew?usp=sharing
13th January 2020, 05:30 AM |#4  
OP Member
Thanks Meter: 0
 
More
I started on Git, but I may have inadvertently been in the wrong place / pulled the wrong file -- I will go back through that link you provided tomorrow and see if something jumps out at me
13th January 2020, 07:24 AM |#5  
Didgeridoohan's Avatar
Forum Moderator
Thanks Meter: 8,472
 
Donate to Me
More
Yeah, you have a whole host of mixed issues there...

First, all the module files have to be in the root of the module zip, not in the magisk-module-DroidSansFallback you have them in now (this is the "not a Magisk module").

Second, your update-binary is a webpage... That ain't gonna work very well. When you download the module_installer.sh script, save it from the raw view (there's a button above the code when you open the file on GitHub).

Last (but this is only cosmetical really, since it won't affect anything) you found some really old module to base your work on, because the config.sh file hasn't been used for ages, and the readme file is ancient.

Fix the above and follow the instructions in the docs and you should be good to go.
14th January 2020, 02:53 AM |#6  
OP Member
Thanks Meter: 0
 
More
Is there a current template on Git for the blank files?

I am here:
https://topjohnwu.github.io/Magisk/guides.html

Made the updates, going to try it now - but I would like to get a proper template setup
14th January 2020, 07:38 AM |#7  
Didgeridoohan's Avatar
Forum Moderator
Thanks Meter: 8,472
 
Donate to Me
More
There is no longer an official template provided.

The current module installation setup is so simple that it really doesn't need it. Put whatever files you want to mount in /system, whatever boot script or prop files (as described in the docs) you want to run in the root of the zip, create the module.prop (again, described in the docs) so that you'll have some info about the module in the Manager, zip it up and flash it.

If you want to customise things more you do that with the customize.sh script (described in the docs).

If you really need a template there's always @Zackptg5's MMT-Ext...
The Following User Says Thank You to Didgeridoohan For This Useful Post: [ View ] Gift Didgeridoohan Ad-Free
15th January 2020, 02:20 AM |#8  
OP Member
Thanks Meter: 0
 
More
So I downloaded a current module and looked through the files / structure and then the docs -- and now I have this
https://drive.google.com/file/d/1z4t...ew?usp=sharing

When I go to /system/fonts I now see DroidSansFallback.ttf (it was not present before installing the module)
and no error messages!!

I think I need to read a little more, on Android 5-8 adding this font into /system/fonts (manually) fixed my problem - now I am on Android 9 (OnePlus 6t TMO variant) and I do not see any changes from adding the file (fonts.xml issue?)

I really wanted to try this as a learning experience, and because the old method trips CTSProfile to false
I appreciate your patience - at least now I have a better starting point
15th January 2020, 02:48 AM |#9  
Didgeridoohan's Avatar
Forum Moderator
Thanks Meter: 8,472
 
Donate to Me
More
All you need for the font file to be mounted is the /system/fonts/DroidSansFallback.ttf file in the module society directory. The REPLACE variable you've set in customize.sh is only for replacing directories with empty ones, not files (so you can remove it since it might be causing a conflict). Details in the docs:
https://topjohnwu.github.io/Magisk/g...remove-folders
15th January 2020, 03:20 AM |#10  
OP Member
Thanks Meter: 0
 
More
updated (linked file updated as well) no change.. .. ..
I did double check that the module places the file in the correct location, and when the module is disabled the file is removed
15th January 2020, 04:20 AM |#11  
OP Member
Thanks Meter: 0
 
More
I found this on a random Google search (ASE) from a unrelated topic (Chinese character support)
On Android 9 it's Noto CJK, e. g. "Noto Sans CJK JP" font family (located in /system/fonts/NotoSansCJK-Regular.ttc). There is no DroidSansFallback.ttf anymore.

Could that explain why adding the file did not work?
Post Reply Subscribe to Thread

Tags
magisk, module, noob mistakes

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

Advanced Search
Display Modes