https://github.com/hyugogirubato/mkshrc
Enhances the Android shell with aliases, BusyBox, Frida support, and easy ADB configuration for both rooted and non-rooted devices.
https://github.com/hyugogirubato/mkshrc
adb android busybox enhancement frida mkshrc
Last synced: 2 months ago
JSON representation
Enhances the Android shell with aliases, BusyBox, Frida support, and easy ADB configuration for both rooted and non-rooted devices.
- Host: GitHub
- URL: https://github.com/hyugogirubato/mkshrc
- Owner: hyugogirubato
- License: mit
- Created: 2024-12-25T16:31:39.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-12-27T18:02:42.000Z (9 months ago)
- Last Synced: 2025-07-19T10:59:17.629Z (3 months ago)
- Topics: adb, android, busybox, enhancement, frida, mkshrc
- Language: Shell
- Homepage:
- Size: 22.7 MB
- Stars: 7
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mkshrc: Advanced Shell Environment for Android Devices
Project mkshrc provides a feature-rich shell environment for Android devices, enhancing usability and productivity by offering convenience aliases, support for essential tools like BusyBox and Frida server, and a streamlined deployment process. It supports both rooted and non-rooted devices, with easy configuration using ADB.
---
## Features and Improvements
### Key Features:
1. **Enhanced Shell Environment**:
- **Aliases** for common commands with colorized output for better readability (`ls`, `grep`, `logcat`, etc.).
- Convenient shortcuts (`ll`, `la`, `l`, etc.) for streamlined navigation and operations.
- Auto-detection of essential environment variables (`USER`, `HOSTNAME`, `TMPDIR`, etc.).2. **BusyBox Integration**:
- Automatically deploys BusyBox and creates symlinks for its utilities.
- Ensures availability of essential Unix commands on the Android shell.3. **Frida Server Management**:
- Simplifies the process of starting, stopping, and monitoring the Frida server.
- Automatic SELinux permissive mode adjustment for compatibility.4. **Custom Commands**:
- **`man`**: Simulates manual page functionality using `--help` outputs.
- **`sudo`**: Adds `sudo`-like functionality for non-root users, enabling command execution via `su`.5. **Cross-Compatible**:
- Works seamlessly on rooted and non-rooted Android devices.
- Usable after every ADB session by sourcing the `mkshrc` script.---
### Deployment Enhancements:
- **Deployment Scripts**:
- Automated deployment using `deploy.bat` (Windows) or `deploy.sh` (Linux).
- Pushes required binaries (`frida-server`, `busybox`) and configuration files (`mkshrc`) to the device.- **Manual Loading**:
- Load `mkshrc` manually:
```sh
adb shell
source /data/local/tmp/mkshrc
```### Improvements:
- Integrated support for SELinux adjustments for Frida server operations.
- Automatic BusyBox utility linking, reducing manual setup.
- Supports deployment with minimal prerequisites, ensuring a consistent environment across devices.---
## Prerequisites
1. **Tools**:
- ADB installed on your computer.
- For rooted devices, ensure you have `su` access.
- Compatible binaries for your Android architecture (links provided below).2. **Binaries**:
- [Frida Server](https://github.com/frida/frida/releases/download/16.5.9/frida-server-16.5.9-android-arm64.xz):
- Download and extract `frida-server-16.5.9-android-arm64.xz` to obtain the `frida-server` binary.
- [BusyBox](https://github.com/topjohnwu/magisk-files/releases/download/files/busybox-1.36.1.1.zip):
- Extract and use the `busybox-1.36.1.1-arm64-v8a.so` binary, renamed as `busybox`.---
## Deployment Instructions
### Automated Deployment:
1. **Run Deployment Scripts**:
- **Windows**:
```cmd
deploy.bat [serial]
```
- **Linux**:
```sh
./deploy.sh [serial]
```
If multiple devices are connected, specify the serial ID.2. **Deployment Summary**:
- The script pushes:
- `mkshrc` to `/data/local/tmp/`.
- Binaries (`frida-server`, `busybox`) to `/data/local/tmp/bin/`.
- Sets proper ownership and permissions for all files.---
### Manual Deployment:
1. **Prepare Directories**:
- Create a directory for binaries:
```sh
adb shell mkdir -p /data/local/tmp/bin
```2. **Push Files**:
- Transfer required binaries and configuration files:
```sh
adb push busybox /data/local/tmp/bin/
adb push frida-server /data/local/tmp/bin/
adb push mkshrc /data/local/tmp/
```3. **Set Permissions**:
- Ensure binaries are executable:
```sh
adb shell chmod +x /data/local/tmp/bin/*
```---
## Usage
### Loading the Environment:
1. Connect to your device using ADB:
```sh
adb shell
```2. Source the `mkshrc` file to initialize:
```sh
source /data/local/tmp/mkshrc
```### Commands Overview:
- **BusyBox Utilities**:
Access all BusyBox commands directly after deployment.
```sh
ls | grep busybox
```- **Frida Server Management**:
- Start Frida:
```sh
frida start
```
- Check status:
```sh
frida status
```
- Stop Frida:
```sh
frida stop
```- **Aliases and Utilities**:
- Example:
```sh
ll # List files with detailed information.
grep 'pattern' file.txt
```- **Custom Commands**:
- Manual pages:
```sh
man ls
```
- Sudo (non-root):
```sh
sudo ls /data/data
```---
## Notes
- Always decompress any compressed binaries (e.g., `xz -d frida-server.xz`) before deployment.
- For rooted devices, gain `su` access for enhanced functionality.
- Ensure `mkshrc` is sourced after every ADB session to enable its environment.## Licensing
This software is licensed under the terms of [MIT License](https://github.com/hyugogirubato/mkshrc/blob/main/LICENSE).
You can find a copy of the license in the LICENSE file in the root folder.---
© hyugogirubato 2024