v2.2.4: Bundle proot as native library - bypasses SELinux execute restriction
This commit is contained in:
@@ -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