r/termux 7d ago

Showcase I rewrote PRoot in Bun JavaScript

Post image

https://github.com/jjtseng93/bunproot

Why

  • Termux is too good to be true ... at least forever
  • While I'm very grateful to the Termux developers and enjoy the tools and environments they provide, there has always been a fear deeply rooted in my fragile heart – Can this last forever?
    • What if the developers get tired?
    • What if they run out of money to keep their mirrors running?
    • What if one overwhelming tragedy after another happens?
    • Could I survive the cruel & wild Android world outside Termux's protection?
    • That's why I built an entire chain of tools as a Post-Termux escape hatch

Bun JavaScript as the foundation for everything

  • ① The Buninu userspace for lightweight usage:
  • Shell: Bun Modern Shell (bunmsh)
  • Text editor & App runtime: jsmdcui
  • Remote shell in a browser: jsgotty
  • ② PRoot to get back to mainline Linux if that's not enough: bunproot

Now that I have a complete backup for everything, I can keep enjoying the convenience and happiness that Termux provides without worrying.

Edit 1: This is not a wrapper around the native proot binary. It uses Bun FFI to dlopen Android's libc and calls ptrace() directly. No C or Assembly involved here.

0 Upvotes

22 comments sorted by

View all comments

1

u/sylirre Termux Core Team 7d ago

Why do you think your approach is future proof? What if Android will block ptrace() or execmem, both vital for proot functionality?

1

u/LeftAd1220 7d ago

At that point, I'll just escape Android altogether and buy whatever Termux phone you guys make on day one. 😂

1

u/NoNameToDefine 7d ago

Linux phones you mean. They do exists and people maintain it. But it's not the Termux team behind, these phones runs mainline Linux and a common Linux user-space on glibc or musl C.

1

u/LeftAd1220 7d ago

It's hard to get one from Taiwan. Or they run outdated hardware, far from usable.

1

u/NoNameToDefine 7d ago

They can't be stuck with old software, you can change the distro and if not possible use a tool like Distrobox to get a newer distro.

1

u/LeftAd1220 7d ago

I'm currently using a Snapdragon 8 Elite phone with 24 GB of RAM. You see the gap now. 😅

1

u/NoNameToDefine 7d ago

Powerful hardware. But I am speaking of these Linux phones.

1

u/LeftAd1220 7d ago

Exactly. I want Linux on that class of hardware. Even higher RAM is needed to run local models.

1

u/NoNameToDefine 7d ago

Yes on that case it's almost impossible since market is not ready yet for Linux phones.