v2.2.4: Bundle proot as native library - bypasses SELinux execute restriction
This commit is contained in:
@@ -327,13 +327,24 @@
|
||||
</div>
|
||||
<div class="settings-section">
|
||||
<h3>About</h3>
|
||||
<p class="about-text">Z.AI Chat v2.2.3</p>
|
||||
<p class="about-text">Z.AI Chat v2.2.4</p>
|
||||
<p class="about-text">Built with Z.AI SDK & GLM-5.1</p>
|
||||
<p class="about-text">Compatible with Android 15/16</p>
|
||||
</div>
|
||||
<div class="settings-section">
|
||||
<h3>Changelog</h3>
|
||||
<ul class="changelog-list">
|
||||
<li>
|
||||
<span class="changelog-version">v2.2.4</span>
|
||||
<span class="changelog-date">2026-05-19</span>
|
||||
<ul>
|
||||
<li><strong>Bundled PRoot</strong> — proot binary included in APK as native library (executable SELinux label)</li>
|
||||
<li><strong>Auto-Proot Install</strong> — copies proot + loader from APK to Termux prefix on first shell use</li>
|
||||
<li><strong>Auto-Proot Wrapping</strong> — pkg/apt/dpkg commands automatically wrapped with proot</li>
|
||||
<li><strong>PROOT_LOADER env</strong> — loader path set correctly for proot execution</li>
|
||||
<li>Supports arm64-v8a, armeabi-v7a, x86_64, x86 architectures</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<span class="changelog-version">v2.2.3</span>
|
||||
<span class="changelog-date">2026-05-19</span>
|
||||
|
||||
@@ -1990,22 +1990,26 @@
|
||||
}
|
||||
|
||||
async function tryProotInstall(prefixUsr, pkgBin, aptBin) {
|
||||
try {
|
||||
termPrint('[*] Downloading PRoot from Termux repo...', 'info');
|
||||
var prootResult = await Bootstrap.installProot();
|
||||
if (!prootResult || !prootResult.path) {
|
||||
termPrint('[!] PRoot download failed', 'err');
|
||||
return false;
|
||||
var prootCmd = termState.prootPath;
|
||||
if (!prootCmd) {
|
||||
try {
|
||||
var prootResult = await Bootstrap.installProot();
|
||||
if (prootResult && prootResult.path) {
|
||||
prootCmd = prootResult.path;
|
||||
termState.prootPath = prootCmd;
|
||||
termState.hasProot = true;
|
||||
}
|
||||
} catch(e) {
|
||||
termPrint('[!] PRoot download failed: ' + e.message, 'err');
|
||||
}
|
||||
termPrint('[OK] PRoot downloaded: ' + prootResult.path, 'success');
|
||||
termState.hasProot = true;
|
||||
termState.prootPath = prootResult.path;
|
||||
} catch(e) {
|
||||
termPrint('[!] PRoot download failed: ' + e.message, 'err');
|
||||
}
|
||||
|
||||
if (!prootCmd) {
|
||||
termPrint('[!] No PRoot available', 'err');
|
||||
return false;
|
||||
}
|
||||
|
||||
var prootCmd = termState.prootPath;
|
||||
termPrint('[OK] PRoot available: ' + prootCmd, 'success');
|
||||
var pkgCmd = 'sh "' + pkgBin + '" update -y 2>&1 && sh "' + pkgBin + '" install -y aapt2 ecj dx apksigner 2>&1';
|
||||
var wrappedCmd = prootCmd + ' -0 -b /dev -b /proc -b /sys -r ' + prefixUsr + ' /bin/sh -c \'' + pkgCmd.replace(/'/g, "'\\''") + '\'';
|
||||
|
||||
@@ -2024,6 +2028,8 @@
|
||||
termState.devToolsInstalled = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
termPrint('[!] PRoot execution result: exit code ' + result.exitCode, 'err');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user