Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/jules-weekly-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Weekly Codebase Cleanup
on:
schedule:
# Run every Monday at 2 AM UTC
- cron: '0 2 * * 1'
- cron: "0 2 * * 1"
workflow_dispatch: # Allow manual triggers

jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Invoke Jules for Cleanup
uses: BeksOmega/jules-action@v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
python-version: "3.14"
- name: Install core tools
shell: bash
run: |
Expand Down
104 changes: 53 additions & 51 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@

### Target Systems

| **Primary** | **Secondary** | **Tertiary** |
|:------------|:--------------|:-------------|
| Arch Linux | Debian | Termux |
| CachyOS | Raspbian | EndeavourOS |
| Wayland | Raspberry Pi OS | Gentoo |
| **Primary** | **Secondary** | **Tertiary** |
| :---------- | :-------------- | :----------- |
| Arch Linux | Debian | Termux |
| CachyOS | Raspbian | EndeavourOS |
| Wayland | Raspberry Pi OS | Gentoo |

### Repository Structure

Expand Down Expand Up @@ -135,16 +135,16 @@ Always quote variables unless intentional glob/split. Exception: `$*` in printf

## Tool Hierarchy (Fallbacks Required)

| Task | Primary | Fallback Chain |
|:-----|:--------|:---------------|
| Find | `fd` | `fdfind`→`find` |
| Grep | `rg` | `grep -E` (prefer `-F` for literals) |
| View | `bat` | `cat` |
| Edit | `sd` | `sed -E` |
| Nav | `zoxide` | `cd` |
| Web | `aria2c` | `curl`→`wget2`→`wget` |
| JSON | `jaq` | `jq` |
| Parallel | `rust-parallel` | `parallel`→`xargs -r -P$(nproc)` |
| Task | Primary | Fallback Chain |
| :------- | :-------------- | :----------------------------------- |
| Find | `fd` | `fdfind`→`find` |
| Grep | `rg` | `grep -E` (prefer `-F` for literals) |
| View | `bat` | `cat` |
| Edit | `sd` | `sed -E` |
| Nav | `zoxide` | `cd` |
| Web | `aria2c` | `curl`→`wget2`→`wget` |
| JSON | `jaq` | `jq` |
| Parallel | `rust-parallel` | `parallel`→`xargs -r -P$(nproc)` |

---

Expand Down Expand Up @@ -179,14 +179,14 @@ BLD=$'\e[1m' # Bold

### Command Costs (Relative)

| Operation | Cost | Alternative | Cost |
|:----------|:-----|:------------|:-----|
| `$(command)` | 100x | `${var//pattern/}` | 1x |
| `tr` | 50x | `${var,,}` | 1x |
| `basename` | 30x | `${var##*/}` | 1x |
| `dirname` | 30x | `${var%/*}` | 1x |
| `cat file` | 20x | `$(<file)` | 1x |
| `sudo sh -c` | 80x | `printf '...' \| sudo tee /path` | 40x |
| Operation | Cost | Alternative | Cost |
| :----------- | :--- | :------------------------------- | :--- |
| `$(command)` | 100x | `${var//pattern/}` | 1x |
| `tr` | 50x | `${var,,}` | 1x |
| `basename` | 30x | `${var##*/}` | 1x |
| `dirname` | 30x | `${var%/*}` | 1x |
| `cat file` | 20x | `$(<file)` | 1x |
| `sudo sh -c` | 80x | `printf '...' \| sudo tee /path` | 40x |

### Bash Optimization

Expand Down Expand Up @@ -298,6 +298,7 @@ process_packages(){
### Local Linting

Run `./lint-format.sh` before committing. Supports:

- `-c` / `--check` for check-only mode (no writes)
- Uses `fd`/`fdfind`/`find` for file discovery
- Runs `shfmt -i 2 -bn -ci -s -ln bash` and `shellcheck --severity=error`
Expand Down Expand Up @@ -559,18 +560,19 @@ IFS=: read -ra parts <<< "$PATH"

### Workflows (.github/workflows/)

| Workflow | Purpose | Trigger |
|:---------|:--------|:--------|
| `lint-format.yml` | ShellCheck, shfmt, Prettier, yamllint, ruff; auto-commits fixes | Push/PR to main/master/claude/** |
| `deps.yml` | Dependabot dependency updates (6 ecosystems) | Scheduled weekly |
| `summary.yml` | Workflow summary generation | Manual trigger |
| `dependabot-automerge.yml` | Auto-merge dependency PRs (minor updates) | Dependabot/Renovate PRs |
| `jules-performance-improver.yml` | Daily performance optimization analysis (Jules agent) | Daily at 4 AM UTC |
| `jules-weekly-cleanup.yml` | Weekly codebase cleanup (dead code, duplication) | Weekly on Monday at 2 AM UTC |
| Workflow | Purpose | Trigger |
| :------------------------------- | :-------------------------------------------------------------- | :--------------------------------- |
| `lint-format.yml` | ShellCheck, shfmt, Prettier, yamllint, ruff; auto-commits fixes | Push/PR to main/master/claude/\*\* |
| `deps.yml` | Dependabot dependency updates (6 ecosystems) | Scheduled weekly |
| `summary.yml` | Workflow summary generation | Manual trigger |
| `dependabot-automerge.yml` | Auto-merge dependency PRs (minor updates) | Dependabot/Renovate PRs |
| `jules-performance-improver.yml` | Daily performance optimization analysis (Jules agent) | Daily at 4 AM UTC |
| `jules-weekly-cleanup.yml` | Weekly codebase cleanup (dead code, duplication) | Weekly on Monday at 2 AM UTC |

### Dependency Management (.github/dependabot.yml)

Monitors 6 package ecosystems with weekly schedule and grouped updates:

- `github-actions`, `gitsubmodule`, `pip`, `uv`, `npm`, `bun`

---
Expand Down Expand Up @@ -783,27 +785,27 @@ parallel_exec(){

### Cachyos/ (Arch/CachyOS)

| Script | Purpose |
|:-------|:--------|
| Cachyos/up.sh | All-in-one update orchestrator (pacman, flatpak, rust, npm, firmware, bootloader) |
| Cachyos/clean.sh | Comprehensive cleanup: package cache, dev tools, system paths, SQLite VACUUM |
| Cachyos/setup.sh | Automated system cfg: repos (Chaotic AUR), packages, VS Code, shells, services |
| Cachyos/debloat.sh | Debloating: remove telemetry (pkgstats), disable services, fwupd P2P |
| Cachyos/rustbuild.sh | Rust PGO/BOLT build orchestrator with mold linker support |
| Cachyos/Scripts/bench.sh | System benchmarking |
| Cachyos/Scripts/Android/ | Termux/Android optimization scripts (6 files) |
| Script | Purpose |
| :----------------------- | :-------------------------------------------------------------------------------- |
| Cachyos/up.sh | All-in-one update orchestrator (pacman, flatpak, rust, npm, firmware, bootloader) |
| Cachyos/clean.sh | Comprehensive cleanup: package cache, dev tools, system paths, SQLite VACUUM |
| Cachyos/setup.sh | Automated system cfg: repos (Chaotic AUR), packages, VS Code, shells, services |
| Cachyos/debloat.sh | Debloating: remove telemetry (pkgstats), disable services, fwupd P2P |
| Cachyos/rustbuild.sh | Rust PGO/BOLT build orchestrator with mold linker support |
| Cachyos/Scripts/bench.sh | System benchmarking |
| Cachyos/Scripts/Android/ | Termux/Android optimization scripts (6 files) |

### RaspberryPi/ (Debian/Pi)

| Script | Purpose |
|:-------|:--------|
| RaspberryPi/raspi-f2fs.sh | F2FS imaging: DietPi detection, partition, clone, fstab/cmdline update |
| RaspberryPi/update.sh | Pi update: apt-fast/nala/apt-get, DietPi, Pi-hole, Pi-Apps, EEPROM |
| RaspberryPi/PiClean.sh | Pi cleanup: APT, cache, trash, crash dumps, journal, Docker prune |
| RaspberryPi/dietpi-chroot.sh | Chroot environment for F2FS conversion & initramfs regeneration |
| RaspberryPi/Scripts/setup.sh | Pi optimization: APT cfg, dpkg nodoc, I/O tuning, SSH, modern tooling |
| RaspberryPi/Scripts/Kbuild.sh | Kernel building: clone source, configure, build, install, reboot |
| RaspberryPi/Scripts/apkg.sh | fzf TUI: fuzzy search APT packages, multi-select, cached previews |
| Script | Purpose |
| :---------------------------- | :--------------------------------------------------------------------- |
| RaspberryPi/raspi-f2fs.sh | F2FS imaging: DietPi detection, partition, clone, fstab/cmdline update |
| RaspberryPi/update.sh | Pi update: apt-fast/nala/apt-get, DietPi, Pi-hole, Pi-Apps, EEPROM |
| RaspberryPi/PiClean.sh | Pi cleanup: APT, cache, trash, crash dumps, journal, Docker prune |
| RaspberryPi/dietpi-chroot.sh | Chroot environment for F2FS conversion & initramfs regeneration |
| RaspberryPi/Scripts/setup.sh | Pi optimization: APT cfg, dpkg nodoc, I/O tuning, SSH, modern tooling |
| RaspberryPi/Scripts/Kbuild.sh | Kernel building: clone source, configure, build, install, reboot |
| RaspberryPi/Scripts/apkg.sh | fzf TUI: fuzzy search APT packages, multi-select, cached previews |

---

Expand Down Expand Up @@ -971,5 +973,5 @@ lower=${str,,} # lowercase

---

*This document is the canonical source for AI assistant guidelines.*
*CLAUDE.md and GEMINI.md are symlinks to this file.*
_This document is the canonical source for AI assistant guidelines._
_CLAUDE.md and GEMINI.md are symlinks to this file._
10 changes: 7 additions & 3 deletions Cachyos/Scripts/Android/BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,30 @@

## Action Items

| Priority | Description | Complexity |
|----------|-------------|------------|
| Medium | Fork and optimize [charwasp/modify](https://github.com/charwasp/modify/) — merge into a single Python script<br>and add GraphicsMagick support | Complex |
| Priority | Description | Complexity |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| Medium | Fork and optimize [charwasp/modify](https://github.com/charwasp/modify/) — merge into a single Python script<br>and add GraphicsMagick support | Complex |

Check notice on line 9 in Cachyos/Scripts/Android/BACKLOG.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

Cachyos/Scripts/Android/BACKLOG.md#L9

Element: br

## Resources to Explore

**Modules & Frameworks:**

- [LSPosed Modules Repository](https://modules.lsposed.org/)
- [VirtualXposed](https://github.com/android-hacker/VirtualXposed)

**UI/Navigation Fixes:**

- [Fullscreen immersive gesture script](https://github.com/trinhnv1205/optimize/blob/main/menu/fullscreen_immersive_getsure.sh) — may fix 3-button navigation bar

**Modified Apps:**

- [SpotifyPlus](https://github.com/LeNerd46/SpotifyPlus)
- [NPatch](https://github.com/7723mod/NPatch)
- [InstaEclipse](https://github.com/ReSo7200/InstaEclipse)
- [NagramX](https://github.com/risin42/NagramX)

**Development Tools:**

- [AntiSplit-M](https://github.com/pumPCin/AntiSplit-M)
- [ADB Toolbox](https://github.com/Nahvine/ADB_Toolbox)
- [ApkPatcher by Th3-R3p4ck3r](https://github.com/Th3-R3p4ck3r/ApkPatcher)
Expand Down
22 changes: 22 additions & 0 deletions Cachyos/Scripts/Android/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ A collection of unified, deduplicated scripts for Android device optimization, A
## 🚀 Main Scripts

### `android-optimize.sh` - Unified Android Optimizer

The primary tool for device optimization with a CLI interface. This script combines multiple optimization workflows into one unified tool.

**Commands:**

```bash
# Full device optimization pipeline
./android-optimize.sh device-all
Expand All @@ -29,6 +31,7 @@ The primary tool for device optimization with a CLI interface. This script combi
```

**What `device-all` does:**

- Device maintenance (fstrim, cleanup, cache trimming)
- Filesystem cleanup (removes temp files, logs, backups)
- ART optimization (dex compilation with speed-profile + speed modes)
Expand All @@ -44,6 +47,7 @@ The primary tool for device optimization with a CLI interface. This script combi
---

### `adb-experimental-tweaks.sh` - Experimental System Tweaks

**⚠️ WARNING: Very aggressive experimental tweaks. Use at your own risk!**

This script contains 1000+ system property and settings changes. It's comprehensive but potentially unstable. Only use if you understand the implications.
Expand All @@ -55,6 +59,7 @@ This script contains 1000+ system property and settings changes. It's comprehens
---

### `optimize_apk.sh` - Comprehensive APK Optimization

Full APK optimization pipeline with resource stripping, bytecode optimization, and repackaging.

**Requirements:** apktool, redex, dex2jar, proguard/R8, zipalign, apksigner, pngcrush, jpegoptim, 7z
Expand All @@ -64,6 +69,7 @@ Full APK optimization pipeline with resource stripping, bytecode optimization, a
```

**Process:**

1. Decode APK with apktool
2. Strip unused resources (extra densities, raw files, assets)
3. Rebuild stripped APK
Expand All @@ -78,13 +84,15 @@ Full APK optimization pipeline with resource stripping, bytecode optimization, a
---

### `termux-butler.sh` - Termux Environment Maintenance

Interactive maintenance tool for Termux environments.

```bash
./termux-butler.sh
```

**Features:**

- Package updates and cache cleaning
- Application cache cleanup (pip, npm, user cache)
- Filesystem hygiene (remove empty files/dirs)
Expand All @@ -96,14 +104,17 @@ Interactive maintenance tool for Termux environments.
## 🔧 Utility Scripts

### `setup.sh` - Quick Shizuku Permission Grant

```bash
./setup.sh
```

Grants WRITE_SECURE_SETTINGS permission to Shizuku API.

---

### `Shizuku-rish.sh` - Shizuku Setup

Sets up Shizuku and Rish (root shell) in Termux.

**Requirements:** nmap, Shizuku app, wireless debugging enabled
Expand All @@ -113,21 +124,25 @@ Sets up Shizuku and Rish (root shell) in Termux.
```

Creates:

- `/data/data/com.termux/files/usr/bin/shizuku` - Shizuku launcher
- `/data/data/com.termux/files/usr/bin/rish` - Root shell command

---

### `mkshrc.sh` - Enhanced Shell Configuration

Shell configuration for mksh (Android's default shell).

**Features:**

- Enhanced keybindings (Ctrl+arrows, history search)
- Useful aliases for package manager, logcat, navigation
- Custom functions (current_activity, myip, man replacement)
- Colorized prompt with exit status indicator

**Usage:**

```bash
# Copy to your shell RC file
cat mkshrc.sh >> ~/.mkshrc
Expand All @@ -139,19 +154,23 @@ source ~/.mkshrc
## 📚 Additional Resources

### Better 'adb shell'

- https://github.com/matan-h/adb-shell
- [mkshrc configuration](mkshrc.sh)
- https://github.com/trinhnv1205/optimize

### WebView & Browser Flags

- [WebView flags](https://github.com/celenityy/configs/blob/pages/android/webview-flags.md)
- [Chromium flags](https://gist.github.com/ibLeDy/1495735312943b9dd646fd9ddf618513)

### Debloating Tools

- [Adbloat](https://github.com/YurinDoctrine/adbloat)
- [UAD-NG](https://github.com/Universal-Debloater-Alliance/universal-android-debloater-next-generation)

### Other Tools

- https://github.com/Parsa307/split_optimizer
- [Termux SSH Setup](https://github.com/tomhiggins/TermuxSSHDsetup)

Expand All @@ -160,6 +179,7 @@ source ~/.mkshrc
## 🎮 Quick Tips

### Game Mode

```bash
# Enable fixed performance mode (game on)
adb shell cmd power set-fixed-performance-mode-enabled true
Expand All @@ -169,11 +189,13 @@ adb shell cmd power set-fixed-performance-mode-enabled false
```

### Write Stats to Disk

```bash
adb shell cmd stats write-to-disk
```

### Remote Install (index guard)

```bash
curl -sSfL https://raw.githubusercontent.com/Ven0m0/Linux-OS/refs/heads/main/Cachyos/Scripts/Android/android-optimize.sh | bash -s index-nomedia
```
Expand Down
6 changes: 3 additions & 3 deletions Cachyos/Scripts/Android/webview-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ adb shell am start -a "com.android.webview.SHOW_DEV_UI"

`GMSCoreEmoji` -> `Disabled`

`AutofillEnableLoyaltyCardsFilling` -> `Disabled` *(This uses Google Wallet)*
`AutofillEnableLoyaltyCardsFilling` -> `Disabled` _(This uses Google Wallet)_

`AutofillUKMExperimentalFields` -> `Disabled`

Expand Down Expand Up @@ -110,9 +110,9 @@ adb shell am start -a "com.android.webview.SHOW_DEV_UI"

`HttpCacheNoVarySearch` -> `Disabled`

`PartitionAllocWithAdvancedChecks` -> `Enabled` *([some info](https://groups.google.com/a/chromium.org/g/ios-reviews/c/BY-Xq_Zeds8)*
`PartitionAllocWithAdvancedChecks` -> `Enabled` _([some info](https://groups.google.com/a/chromium.org/g/ios-reviews/c/BY-Xq_Zeds8)_

`SensitiveContent` -> `Enabled` *([info](https://source.chromium.org/chromium/chromium/src/+/main:components/sensitive_content/))*
`SensitiveContent` -> `Enabled` _([info](https://source.chromium.org/chromium/chromium/src/+/main:components/sensitive_content/))_

`RestrictAbusePortsOnLocalhost` -> `Enabled`

Expand Down
Loading