An open API service indexing awesome lists of open source software.

https://github.com/i-taylo/bash-in-magisk

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.
https://github.com/i-taylo/bash-in-magisk

bash bash-script bash-scripting kernelsu kernelsu-module magisk magisk-manager magisk-module magisk-modules

Last synced: 2 months ago
JSON representation

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.

Awesome Lists containing this project

README

        

### This documentation is intended for developers only.
##### Setting Up Bash Environment in Your Module

***`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.

## Prerequisites
- **System Requirements**:
- Linux, macOS, Termux, or WSL (Windows Subsystem for Linux).

- **Android NDK (only if zygisk module)**: Ensure the `NDK_HOME` variable points to the correct Android NDK path.
`configuration.cfg`-›`line 22`
[**Jump to line 22**](https://github.com/i-taylo/bash-in-magisk/blob/main/configuration.cfg#L22)

### Installation
```bash
git clone https://github.com/i-Taylo/bash-in-magisk.git "my-magisk-module"
cd my-magisk-module
chmod +x gen_module.sh
./gen_module.sh
```

### Zygisk Module
- If you are building a Zygisk module, make sure to set `isZygisk` to `true`.
- * If you want to create a new, fully-structured example Zygisk module template, simply remove the `zygisk` directory (if exist) and then run `gen_module.sh`.

### Explanations
The `bash-in-magisk` directory contains:
- ```gen_module.sh```: A setup script that generates a module template with a complete Bash environment.

You can find the module configurations in (`configuration.cfg`) file which includes:
```properties
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="#"
```
* Customize these variables to reflect your module's information.

***
Explanation of variables below:
```bash
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 `example/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:

```txt
├── 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.
***
## License

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