Skip to content

veez21/mod-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Terminal Emulator Magisk Module Template

This template is for Making a script with visual elements which can be executed in a Terminal app in Android, as a Magisk Module.
This provides you with useful functions that might help you easily accomplish stuff for the functions that you're making in you script.

Magisk Modules that uses this template (you can refer to how things are used by these modules)

Stuff included

  • Root checking (if the script is running as root)
  • Debugging functions (to help you fix errors and bugs in your script)
  • Determine if the device has A/B partitioning scheme
  • Sets Busybox applets (Magisk, osm0sis') for you to not anymore call busybox to use them
  • Imports Magisk's util_functions.sh so that you can use the stuff in it
  • Gets the Device Info (Brand, Model, etc) for you to use if needed
  • Provides basic ANSI color codes for you to use
  • Useful functions and variables

How to include in a Magisk Module (If you're not using SKIPUNZIP)

  1. Place script (rename to anything you want) in /system/bin or xbin or anywhere you want
  2. Add mod-util.sh in root folder of the Magisk module
  3. Set the ID of the script to the id from your module.prop

Functions in mod-util.sh

Function How to use Example Output
title_div title_div [-c] [character no] <message> title_div Example Outputs a bar with a message: Example ==========
set_file_prop set_file_prop <property> <value> <file.prop> set_file_prop ro.example true /cache/example.prop none
ProgressBar ProgressBar <progress> <total threshold> ProgressBar 4 10 Outputs a progress bar that's animated: Progress: [==== ]
Spinner Spinner <message> Spinner Example Outputs spinner loading animation Example: [/] (this is spinning btw)
e_spinner cmd & e_spinner <message> cmd & e_spinner Example Outputs spinner loading animation until the process of cmd is finished Example: [/] (this is spinning btw)
test_connection test_connection test_connection Tells you if internet's ok or not
upload_logs upload_logs upload_logs Generates termbin.com link of the logs uploaded
mod_head mod_head mod_head Outputs heading you can use in your script based on your module's name id version versionCode author, and also the Busybox used
prandom prandom [-c] [chances] [target] <message> prandom -c 10 7 "Hello" Prints message at random times (default chances=2; target=2)
pcenter pcenter <message> pcenter "Hello" Prints message at center alignment in terminal (work in progress)

Contact me in Telegram if needed

About

Usefull stuff for magisk stuff

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages