fix(config): restore AUTO mode resolution for bare target entries

v6.0 changed bare target.txt entries from AUTO to GENERATE, breaking
apps like BHIM that need TEE-backed attestation keys. Restore AUTO as
default and resolve it at config level (PATCH if TEE works, GENERATE
if not) to bypass the non-deterministic raceTeePatch path.
This commit is contained in:
Enginex0
2026-03-31 18:53:18 +01:00
parent 54c12a9fd5
commit 1b7800345d
@@ -7,6 +7,7 @@ import android.os.IBinder
import android.os.ServiceManager
import java.io.File
import java.util.concurrent.ConcurrentHashMap
import org.matrix.TEESimulator.attestation.DeviceAttestationService
import org.matrix.TEESimulator.logging.SystemLogger
import org.matrix.TEESimulator.pki.KeyBoxManager
@@ -102,7 +103,7 @@ object ConfigurationManager {
when (packageModes[pkg]) {
Mode.GENERATE -> return Mode.GENERATE
Mode.PATCH -> return Mode.PATCH
Mode.AUTO -> return Mode.AUTO
Mode.AUTO -> return if (DeviceAttestationService.isTeeFunctional) Mode.PATCH else Mode.GENERATE
null -> continue
}
}
@@ -165,7 +166,7 @@ object ConfigurationManager {
newKeyboxes[pkg] = currentKeybox
}
else -> {
newModes[trimmedLine] = Mode.GENERATE
newModes[trimmedLine] = Mode.AUTO
newKeyboxes[trimmedLine] = currentKeybox
}
}