fix(native): droiddeckctl native prepares the rootfs with the setting off

This commit is contained in:
Kurt Himebauch committed 2026-11-09 16:09:58 -05:00
1 parent 6bc9723b0c
commit 5987478a0b
2 files changed
+3 -7

No files matched your search

@@ -14,6 +14,8 @@ object AgentNative {
fun run(context: Context, request: JSONObject, timeoutMs: Long): JSONObject {
val root = LinuxRuntime.rootDir(context)
com.droiddeck.launcher.session.SessionFiles.stage(context, root)
// with the setting off, staging leaves the rootfs as proot wants it
if (!com.droiddeck.launcher.session.SessionPrefs.nativeUserland(context)) NativeGuest.prepare(context, root)
if (!NativeGuest.available(root)) throw AgentException("NATIVE_UNAVAILABLE", "The rootfs has no native hook or glibc loader yet; start a session once")
val argvJson = request.optJSONArray("argv") ?: throw AgentException("INVALID_REQUEST", "argv is required")
val argv = (0 until argvJson.length()).map { argvJson.getString(it) }
@@ -258,13 +258,7 @@ object SessionFiles {
preload.append("/usr/local/lib/libfakeinput.so\n")
}
val nativeUserland = SessionPrefs.nativeUserland(context)
if (nativeUserland) {
val relinked = com.droiddeck.launcher.runtime.NativeGuest.relinkAbsoluteSymlinks(context, root)
if (relinked > 0) Log.i(TAG, "native userland: $relinked absolute symlinks made relative")
val patched = com.droiddeck.launcher.runtime.NativeGuest.patchForSeccomp(root)
if (patched > 0) Log.i(TAG, "native userland: $patched system call sites in ld.so and libc answer Android's blocked calls")
com.droiddeck.launcher.runtime.NativeGuest.syncLibraryDirs(root)
}
if (nativeUserland) com.droiddeck.launcher.runtime.NativeGuest.prepare(context, root)
if (ProotFastPath.enabled(context)) {
val library = com.droiddeck.launcher.agent.AgentEnv.fastPathLibrary(context)
preload.append(library + "\n")