Repository navigation
runcode v1.0.1 — real Telegram bots, no more restart flapping
Everything here came out of testing v1.0.0 on a real phone.
Third-party Python packages
A real bot script used to die on from telegram import Update no matter what, because only
the standard library shipped. pip now resolves packages at build time and they are packaged
into the APK: python-telegram-bot 21.9 and requests.
Verified on device — the library loads, reaches api.telegram.org over the bundled OpenSSL,
and the server answers:
python-telegram-bot version: 21.9
server replied: InvalidToken - The token `1111...:***REDACTED***` was rejected by the server.
(That redaction is the log sanitiser doing its job on a real bot token.)
Add more packages to the pip block in app/build.gradle.kts. pip runs on the build
machine, so building now needs a CPython 3.12 — set RUNCODE_BUILD_PYTHON if it is not on
PATH.
Fixes
- A syntax error made the service flap. The Telegram profile restarts
ON_FAILURE, so
the supervisor retried aSyntaxErrorfour times with backoff even though it fails
identically every time. Scripts that cannot load at all —SyntaxError,
ModuleNotFoundError— are now reported as fatal and never retried. - Battery optimisation state was stale. It was read once at startup, so granting the
exemption in Settings and coming back still showed "OPTIMIZED". Re-read on every resume. - Memory was printed raw —
RAM: 17.93731689453125MB— which also overflowed the Home
card and squeezed its Stop button down to a bare icon. Formatted to one decimal. - Crashes are now readable. Android's dialog says only "Something went wrong" and the
trace is only reachable over adb, which is no use on a phone. An uncaught-exception
handler persists the stack trace and the System screen shows it with a copy button.
Install
Signed with the same 4096-bit RSA key as v1.0.0 (v2 + v3 schemes), so it installs over it.
minSdk 26, ABIs arm64-v8a and x86_64.
Licensed MIT. Third-party notices: THIRD_PARTY_LICENSES.md.