mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-10-14 19:27:09 -04:00
Add to the process environment rather than replacing it
Matches the exec path this was ported from; the guest command already starts with env -i, so clearing the host side changed nothing except how far the code sits from a configuration proven on a device.
This commit is contained in:
1 parent
085f663347
commit
814ab2cac0
1 file changed
+4
-1
@@ -37,7 +37,10 @@ public final class ProcessHelper {
|
||||
ProcessBuilder builder = new ProcessBuilder(splitCommand(command));
|
||||
if (workingDir != null) builder.directory(workingDir);
|
||||
if (envp != null) {
|
||||
builder.environment().clear();
|
||||
// Added to the app's own environment rather than replacing it, which is what
|
||||
// Bannerlator does on the path this was taken from. proot needs nothing from the
|
||||
// inherited set, but the guest command starts with `env -i` anyway, so clearing
|
||||
// here buys nothing and only differs from the configuration proven on a device.
|
||||
for (String entry : envp) {
|
||||
int eq = entry.indexOf('=');
|
||||
if (eq > 0) builder.environment().put(entry.substring(0, eq), entry.substring(eq + 1));
|
||||
|
||||
Reference in new issue
Block a user