Skip to content

Commit 45a02b0

Browse files
authored
Merge pull request #1 from HanSoBored/unit-test
Feat: Add documentation, installation and CI
2 parents 3ad15da + bbc6ea0 commit 45a02b0

6 files changed

Lines changed: 258 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [ "main", "unit-test" ]
6+
workflow_dispatch:
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
TARGET: aarch64-unknown-linux-musl
11+
BINARY_NAME: autolinux
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
19+
steps:
20+
- name: Checkout Code
21+
uses: actions/checkout@v4
22+
23+
- name: Install Rust Toolchain
24+
uses: dtolnay/rust-toolchain@stable
25+
with:
26+
targets: ${{ env.TARGET }}
27+
28+
- name: Install Cross
29+
run: cargo install cross
30+
31+
- name: Build Release (Musl Static)
32+
run: cross build --target ${{ env.TARGET }} --release
33+
34+
- name: Prepare Artifact
35+
run: |
36+
mv target/${{ env.TARGET }}/release/${{ env.BINARY_NAME }} ${{ env.BINARY_NAME }}-aarch64
37+
echo "Artifact ready: ${{ env.BINARY_NAME }}-aarch64"
38+
39+
- name: Upload Rolling Release
40+
uses: marvinpinto/action-automatic-releases@latest
41+
with:
42+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
43+
automatic_release_tag: "latest"
44+
prerelease: false
45+
title: "Latest Build (Auto-generated)"
46+
files: |
47+
${{ env.BINARY_NAME }}-aarch64

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# Auto-Linux (Rust Edition)
2+
3+
![Build Status](https://img.shields.io/github/actions/workflow/status/HanSoBored/Auto-Linux/build.yml?branch=main)
4+
![Language](https://img.shields.io/badge/language-Rust-orange)
5+
![Platform](https://img.shields.io/badge/platform-Android%20(Root)-green)
6+
![License](https://img.shields.io/badge/license-MIT-blue)
7+
8+
**Auto-Linux** is a standalone, lightweight, and blazing fast Linux installer/manager for Android, written entirely in **Rust**. It provides a beautiful Terminal User Interface (TUI) to install, configure, and manage Ubuntu chroots without requiring Termux, Busybox, or external dependencies.
9+
10+
> **Built for speed, stability, and ease of use.**
11+
12+
---
13+
14+
## Key Features
15+
16+
* **Native & Standalone:** Compiled as a static binary (`musl`). Zero dependencies. No Termux needed.
17+
* **Beautiful TUI:** Powered by `ratatui`. Keyboard-driven dashboard.
18+
* **Instant Launch:** Switch users and enter Chroot directly from the dashboard.
19+
* **Auto-Configuration:**
20+
* **Network:** Auto-detects DNS and fixes connection issues inside chroot.
21+
* **Users:** Auto-creates User & Password during setup.
22+
* **Sudo:** Auto-configures `sudo` (wheel group) privileges.
23+
* **Mounts:** Handles `/dev`, `/proc`, `/sys`, `/sdcard` binding automatically.
24+
* **Distribution Support:** Ubuntu 20.04 LTS up to 26.04.
25+
* **Root Detection:** Supports Magisk, KernelSU, and APatch natively.
26+
27+
---
28+
29+
## Screenshots
30+
31+
Preview:
32+
![preview 1](https://raw.githubusercontent.com/HanSoBored/Auto-Linux/main/preview/preview1.jpg)
33+
34+
![preview 2](https://raw.githubusercontent.com/HanSoBored/Auto-Linux/main/preview/preview2.jpg)
35+
36+
![preview 3](https://raw.githubusercontent.com/HanSoBored/Auto-Linux/main/preview/preview3.jpg)
37+
38+
39+
---
40+
41+
## Installation
42+
43+
### Option 1: One-Line Install.
44+
Run this command in **Termux**, **ADB Shell**, or any Terminal Emulator:
45+
46+
```bash
47+
curl -sL https://raw.githubusercontent.com/HanSoBored/Auto-Linux/master/install.sh | sh
48+
```
49+
50+
> **Note:** This script automatically detects if you have Termux installed and creates a shortcut. You can then simply type `autolinux` to start.
51+
52+
### Option 2: Manual Install
53+
1. Download the latest binary from [Releases](https://github.com/HanSoBored/Auto-Linux/releases).
54+
2. Push to device: `adb push autolinux-aarch64 /data/local/tmp/autolinux`
55+
3. Permission: `chmod +x /data/local/tmp/autolinux`
56+
4. Run: `/data/local/tmp/autolinux`
57+
58+
---
59+
60+
## Build from Source
61+
62+
You need **Rust** and **Cross** (for cross-compiling to Android/ARM64 Musl).
63+
64+
1. **Install Prerequisites**:
65+
```bash
66+
cargo install cross
67+
```
68+
2. **Build Release**:
69+
```bash
70+
# Static binary (Musl) ensures it runs on any Android version
71+
cross build --target aarch64-unknown-linux-musl --release
72+
```
73+
3. **Locate Binary**:
74+
The binary will be in `target/aarch64-unknown-linux-musl/release/autolinux`.
75+
76+
---
77+
78+
## Contributing
79+
80+
Contributions are welcome!
81+
1. Fork the project
82+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
83+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
84+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
85+
5. Open a Pull Request
86+
87+
---
88+
89+
## Disclaimer
90+
91+
This tool modifies system partitions (mounting) and creates files in `/data`. While safe, **I am not responsible for any bricked devices or data loss.** Always backup your data.
92+
93+
---
94+
95+
## License
96+
97+
Distributed under the MIT License. See `LICENSE` for more information.

install.sh

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#!/system/bin/sh
2+
3+
REPO="HanSoBored/Auto-Linux"
4+
BINARY_NAME="autolinux"
5+
RELEASE_FILE="autolinux-aarch64"
6+
7+
SYSTEM_PATH="/data/local/bin"
8+
USER_PATH="$HOME/.local/bin"
9+
10+
GREEN='\033[0;32m'
11+
YELLOW='\033[0;33m'
12+
RED='\033[0;31m'
13+
NC='\033[0m'
14+
15+
echo -e "${GREEN}=== AutoLinux Installer ===${NC}"
16+
17+
find_temp_dir() {
18+
if [ -n "$TMPDIR" ] && [ -w "$TMPDIR" ]; then
19+
echo "$TMPDIR"
20+
return
21+
fi
22+
23+
if [ -d "/data/data/com.termux/files/usr/tmp" ] && [ -w "/data/data/com.termux/files/usr/tmp" ]; then
24+
echo "/data/data/com.termux/files/usr/tmp"
25+
return
26+
fi
27+
28+
if [ -w "$HOME" ]; then
29+
echo "$HOME"
30+
return
31+
fi
32+
33+
if [ -d "/data/local/tmp" ] && [ -w "/data/local/tmp" ]; then
34+
echo "/data/local/tmp"
35+
return
36+
fi
37+
38+
echo "."
39+
}
40+
41+
TMP_DIR=$(find_temp_dir)
42+
TARGET_TMP="$TMP_DIR/$BINARY_NAME-tmp"
43+
44+
echo "[*] Working directory: $TMP_DIR"
45+
46+
DOWNLOAD_URL="https://github.com/$REPO/releases/latest/download/$RELEASE_FILE"
47+
48+
echo "[*] Downloading binary..."
49+
if [ -x "$(command -v curl)" ]; then
50+
curl -L --fail "$DOWNLOAD_URL" -o "$TARGET_TMP"
51+
elif [ -x "$(command -v wget)" ]; then
52+
wget -O "$TARGET_TMP" "$DOWNLOAD_URL"
53+
else
54+
echo -e "${RED}[!] Error: curl atau wget tidak ditemukan.${NC}"
55+
exit 1
56+
fi
57+
58+
if [ ! -f "$TARGET_TMP" ]; then
59+
echo -e "${RED}[!] Gagal download.${NC}"
60+
exit 1
61+
fi
62+
63+
chmod +x "$TARGET_TMP"
64+
65+
INSTALLED_PATH=""
66+
67+
if [ "$(id -u)" = "0" ]; then
68+
echo "[*] Running as Root. Installing to System Path..."
69+
mkdir -p "$SYSTEM_PATH"
70+
mv "$TARGET_TMP" "$SYSTEM_PATH/$BINARY_NAME"
71+
INSTALLED_PATH="$SYSTEM_PATH/$BINARY_NAME"
72+
73+
elif command -v su >/dev/null 2>&1; then
74+
echo -e "${YELLOW}[?] Root access detected.${NC}"
75+
echo " Attempting to install to system path ($SYSTEM_PATH)..."
76+
echo " (Please grant Root permission on your device prompt)"
77+
78+
if su -c "mkdir -p $SYSTEM_PATH && cp $TARGET_TMP $SYSTEM_PATH/$BINARY_NAME && chmod 755 $SYSTEM_PATH/$BINARY_NAME"; then
79+
echo -e "${GREEN}[OK] Successfully installed as Root!${NC}"
80+
rm "$TARGET_TMP"
81+
INSTALLED_PATH="$SYSTEM_PATH/$BINARY_NAME"
82+
83+
TERMUX_BIN="/data/data/com.termux/files/usr/bin"
84+
if [ -d "$TERMUX_BIN" ]; then
85+
su -c "ln -sf $SYSTEM_PATH/$BINARY_NAME $TERMUX_BIN/$BINARY_NAME"
86+
fi
87+
else
88+
echo -e "${RED}[!] Root permission denied/failed.${NC}"
89+
echo " Falling back to User installation..."
90+
fi
91+
fi
92+
93+
if [ -z "$INSTALLED_PATH" ]; then
94+
echo "[*] Installing to User Path ($USER_PATH)..."
95+
mkdir -p "$USER_PATH"
96+
mv "$TARGET_TMP" "$USER_PATH/$BINARY_NAME"
97+
INSTALLED_PATH="$USER_PATH/$BINARY_NAME"
98+
99+
case ":$PATH:" in
100+
*":$USER_PATH:"*) ;;
101+
*)
102+
echo -e "${YELLOW}[!] Warning: $USER_PATH is not in your PATH.${NC}"
103+
echo " Add this to your .bashrc/.zshrc:"
104+
echo " export PATH=\"\$PATH:$USER_PATH\""
105+
;;
106+
esac
107+
fi
108+
109+
echo ""
110+
echo -e "${GREEN}=== Installation Complete ===${NC}"
111+
echo "Location: $INSTALLED_PATH"
112+
echo "Run using command:"
113+
echo -e "${GREEN} $BINARY_NAME${NC}"
114+
echo ""

preview/preview1.jpg

52.2 KB
Loading

preview/preview2.jpg

48.8 KB
Loading

preview/preview3.jpg

57.9 KB
Loading

0 commit comments

Comments
 (0)