mirror of
https://github.com/D-Modem/app.git
synced 2026-11-29 01:48:05 -08:00
- proot (Termux's, external/proot) and its loader built with the NDK for each ABI by native-proot/build.sh (talloc fetched and checked by SHA-256, built as one file), run by Gradle before each build and packaged as libproot.so and libproot-loader.so: extracted on install, in the native library directory, the one place Android 10 on lets an app run its own programs - LinuxSystem: Alpine's minimal root file system for the phone's ABI, found in Alpine's release list, downloaded with its SHA-256 checked, unpacked (Tar: ustar, pax and GNU names, links and modes, nothing written outside it, removed without following links), set up (the phone's name servers, a prompt) and run as root with proot: the device's /dev, /proc and /sys, made-up /proc files for those Android hides, hard links as proot's link2symlink, and the phone's shared storage at /sdcard when the app has "all files access" - Settings, Linux: install (it goes on while the user moves about the app), size, open a shell, remove; the storage permission; the terminal's menu offers "New Linux shell (Alpine)", installing first when it isn't there - Hang-up sent again shortly after the first, for a job the shell was forking as it went (found by the tests) - Tests on the host: proot built by the same script, Alpine downloaded: a root shell, the storage both ways, the window's size, hard links, apk installing a package and running it, removal leaving the storage; the tar reader against GNU and pax tars and ones made to escape; the app installing it from Settings and opening its shell. CI installs gawk and mksh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs
35 lines
1.0 KiB
C
35 lines
1.0 KiB
C
/* SPDX-License-Identifier: LGPL-3.0-or-later (as talloc) -- the little of Samba's lib/replace that talloc.c uses */
|
|
#ifndef DMODEM_TALLOC_REPLACE_H
|
|
#define DMODEM_TALLOC_REPLACE_H
|
|
#include <stdarg.h>
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <limits.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <errno.h>
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#define _PUBLIC_ __attribute__((visibility("default")))
|
|
#ifndef likely
|
|
#define likely(x) __builtin_expect(!!(x), 1)
|
|
#define unlikely(x) __builtin_expect(!!(x), 0)
|
|
#endif
|
|
#ifndef discard_const_p
|
|
#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
|
|
#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
|
|
#endif
|
|
#ifndef MIN
|
|
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
|
#endif
|
|
#define HAVE_VA_COPY 1
|
|
#define HAVE_INTPTR_T 1
|
|
#define HAVE_CONSTRUCTOR_ATTRIBUTE 1
|
|
#define HAVE_DESTRUCTOR_ATTRIBUTE 1
|
|
#define TALLOC_BUILD_VERSION_MAJOR 2
|
|
#define TALLOC_BUILD_VERSION_MINOR 4
|
|
#define TALLOC_BUILD_VERSION_RELEASE 2
|
|
#endif
|