Skip to content

A utility to make a Magisk module that provides full Bash shell capabilities on Android, complete with modern syntax support and essential features. It is designed for developers and power users, enabling a robust Bash environment.

License

Notifications You must be signed in to change notification settings

i-Taylo/bash-in-magisk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation


Setting Up Bash Environment in Your Module


! This documentation is intended for developers only.

QuickInfo
A utility to make a Magisk module that provides full Bash shell capabilities on Android, complete with modern syntax support and essential features. It is designed for developers and power users, enabling a robust Bash environment.

Installation

git clone https://github.com/i-Taylo/bash-in-magisk.git
cd bash-in-magisk
chmod +x gen_module.sh
./gen_module.sh

Explanation

The build directory contains:

  • gen_module.sh: A setup script that generates a module template with a complete Bash environment.

The module configuration code includes:

MODULE_ID="bash_example" 
MODULE_NAME="bash-example-name"
MODULE_VERSION="1.0"
MODULE_VERSION_CODE="1000"
AUTHOR="example@author"
DESCRIPTION="This is a description of an example"
UPDATE_JSON="#<json file link>"

Customize these variables to reflect your module's information.


Explanation of variables below:

LAUNCHER_CODE="template/customize.sh"
INSTALLATION_CODE="template/installer.sh"

LAUNCHER_CODE initializes and prepares the Bash environment automatically; no manual changes are needed as it is generated by gen_module.sh.

INSTALLATION_CODE is the main installation script where your code goes. You can view the sample code in template/example_installer.sh for reference.

The template does not include the following files by default, so you may need to create and configure them if necessary:

├── post-fs-data.sh
├── post-mount.sh
├── service.sh
├── boot-completed.sh
├── uninstall.sh
├── system.prop
├── sepolicy.rule

There is no need to modify gen_module.sh to include these files, as they will be automatically packed during the zipping process.


Environment variables like:

$OUTFD
$ABI
$API
$MAGISKBIN
$NVBASE
$BOOTMODE
$ZIPFILE
etc...

and the others are all allowed. gen_module.sh-›line 79 Jump to line 79


License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

A utility to make a Magisk module that provides full Bash shell capabilities on Android, complete with modern syntax support and essential features. It is designed for developers and power users, enabling a robust Bash environment.

Topics

Resources

License

Stars

Watchers

Forks

Languages