mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 04:55:44 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fe089148c |
No files matched your search
@@ -73,8 +73,6 @@ jobs:
|
||||
set -euo pipefail
|
||||
git fetch --no-tags origin main
|
||||
echo "base-sha=$(git rev-parse origin/main)" >> "$GITHUB_OUTPUT"
|
||||
- name: Verify checked-in binary provenance
|
||||
run: python3 tools/provenance/check.py
|
||||
- name: Record pinned source tree
|
||||
id: source
|
||||
run: echo "tree-sha=$(git rev-parse 'HEAD^{tree}')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
@@ -53,13 +53,6 @@ object AppUiPrefs {
|
||||
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putBoolean("hide-home-from-recents", hidden).apply()
|
||||
}
|
||||
|
||||
fun pageSwipe(context: Context): Boolean =
|
||||
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).getBoolean("page-swipe", true)
|
||||
|
||||
fun setPageSwipe(context: Context, on: Boolean) {
|
||||
context.getSharedPreferences("app-ui", Context.MODE_PRIVATE).edit().putBoolean("page-swipe", on).apply()
|
||||
}
|
||||
|
||||
internal fun normalizeScale(percent: Int): Int = percent.takeIf { it in scales } ?: DEFAULT_SCALE
|
||||
|
||||
fun scale(context: Context): Int = normalizeScale(
|
||||
|
||||
@@ -267,11 +267,12 @@ class DroidDeckHudHost(context: Context) {
|
||||
val h = if (strip) maxOf(v.height.toFloat(), STRIP_PULL_OFF_DP * density) else v.height.toFloat()
|
||||
val x = v.x + dx
|
||||
val y = v.y + dy
|
||||
val b = HudBounds.of(p, v.width.toFloat(), v.height.toFloat())
|
||||
return mapOf(
|
||||
DroidDeckHudDock.LEFT to -x / w,
|
||||
DroidDeckHudDock.RIGHT to (x + v.width - p.width) / w,
|
||||
DroidDeckHudDock.TOP to -y / h,
|
||||
DroidDeckHudDock.BOTTOM to (y + v.height - p.height) / h,
|
||||
DroidDeckHudDock.LEFT to (b.left - x) / w,
|
||||
DroidDeckHudDock.RIGHT to (x + v.width - b.right) / w,
|
||||
DroidDeckHudDock.TOP to (b.top - y) / h,
|
||||
DroidDeckHudDock.BOTTOM to (y + v.height - b.bottom) / h,
|
||||
).maxByOrNull { it.value }
|
||||
}
|
||||
|
||||
@@ -279,19 +280,19 @@ class DroidDeckHudHost(context: Context) {
|
||||
val p = hud.parent as? View ?: return
|
||||
stopMotion(hud)
|
||||
snapping = false
|
||||
hud.x = x.coerceIn(0f, (p.width - hud.width).toFloat().coerceAtLeast(0f))
|
||||
hud.y = y.coerceIn(0f, (p.height - hud.height).toFloat().coerceAtLeast(0f))
|
||||
val b = HudBounds.of(p, hud.width.toFloat(), hud.height.toFloat())
|
||||
hud.x = x.coerceIn(b.left, b.maxX)
|
||||
hud.y = y.coerceIn(b.top, b.maxY)
|
||||
}
|
||||
|
||||
private fun dropTab(hud: DroidDeckHudView) {
|
||||
val p = hud.parent as? View ?: return
|
||||
val maxX = (p.width - hud.width).toFloat().coerceAtLeast(0f)
|
||||
val maxY = (p.height - hud.height).toFloat().coerceAtLeast(0f)
|
||||
val b = HudBounds.of(p, hud.width.toFloat(), hud.height.toFloat())
|
||||
val pulled = when (hud.dock) {
|
||||
DroidDeckHudDock.LEFT -> hud.x / hud.width
|
||||
DroidDeckHudDock.RIGHT -> (maxX - hud.x) / hud.width
|
||||
DroidDeckHudDock.TOP -> hud.y / hud.height
|
||||
DroidDeckHudDock.BOTTOM -> (maxY - hud.y) / hud.height
|
||||
DroidDeckHudDock.LEFT -> (hud.x - b.left) / hud.width
|
||||
DroidDeckHudDock.RIGHT -> (b.maxX - hud.x) / hud.width
|
||||
DroidDeckHudDock.TOP -> (hud.y - b.top) / hud.height
|
||||
DroidDeckHudDock.BOTTOM -> (b.maxY - hud.y) / hud.height
|
||||
DroidDeckHudDock.NONE, DroidDeckHudDock.FLOAT -> 0f
|
||||
}
|
||||
if (pulled >= 1f) { setDock(hud, DroidDeckHudDock.NONE); return }
|
||||
@@ -339,12 +340,11 @@ class DroidDeckHudHost(context: Context) {
|
||||
/** Sends the HUD to a side the way a chat head goes: by where the throw would carry it, springing on from its speed. */
|
||||
private fun snapToAnchor(hud: DroidDeckHudView, vx: Float, vy: Float) {
|
||||
val p = hud.parent as? View ?: return
|
||||
val maxX = (p.width - hud.width).toFloat().coerceAtLeast(0f)
|
||||
val maxY = (p.height - hud.height).toFloat().coerceAtLeast(0f)
|
||||
val right = com.droiddeck.launcher.ui.EdgeFling.toRight(hud.x + hud.width / 2f, p.width.toFloat(), vx, context.resources.displayMetrics.density)
|
||||
val b = HudBounds.of(p, hud.width.toFloat(), hud.height.toFloat())
|
||||
val right = com.droiddeck.launcher.ui.EdgeFling.toRight(hud.x - b.left + hud.width / 2f, b.right - b.left, vx, context.resources.displayMetrics.density)
|
||||
anchorX = if (right) 1f else 0f
|
||||
wantX = anchorX * maxX
|
||||
wantY = com.droiddeck.launcher.ui.EdgeFling.restY(hud.y, vy, 0f, maxY)
|
||||
wantX = b.anchoredX(anchorX)
|
||||
wantY = com.droiddeck.launcher.ui.EdgeFling.restY(hud.y, vy, b.top, b.maxY)
|
||||
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
|
||||
stopMotion(hud)
|
||||
hud.scaleX = 1f; hud.scaleY = 1f
|
||||
@@ -387,7 +387,8 @@ class DroidDeckHudHost(context: Context) {
|
||||
val at = IntArray(2).also { p.getLocationOnScreen(it) }
|
||||
val x = rawX - at[0]
|
||||
val y = rawY - at[1]
|
||||
val edge = if (snaps) nearestEdge(x, y, p.width.toFloat(), p.height.toFloat()) else DroidDeckHudDock.FLOAT
|
||||
val b = HudBounds.of(p, 0f, 0f)
|
||||
val edge = if (snaps) nearestEdge(x - b.left, y - b.top, b.right - b.left, b.bottom - b.top) else DroidDeckHudDock.FLOAT
|
||||
setDock(hud, edge, Pair(x, y))
|
||||
}
|
||||
|
||||
@@ -404,8 +405,9 @@ class DroidDeckHudHost(context: Context) {
|
||||
if (edge != DroidDeckHudDock.NONE) {
|
||||
val p = hud.parent as? View
|
||||
if (p != null) {
|
||||
wantX = wantX.coerceIn(0f, p.width.toFloat())
|
||||
wantY = wantY.coerceIn(0f, p.height.toFloat())
|
||||
val b = HudBounds.of(p, 0f, 0f)
|
||||
wantX = wantX.coerceIn(b.left, b.right)
|
||||
wantY = wantY.coerceIn(b.top, b.bottom)
|
||||
}
|
||||
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
|
||||
}
|
||||
@@ -417,12 +419,11 @@ class DroidDeckHudHost(context: Context) {
|
||||
}
|
||||
|
||||
private fun settleOutOfTab(hud: DroidDeckHudView, tabX: Float, tabY: Float) {
|
||||
val p = hud.parent as? View
|
||||
val maxX = if (p == null) Float.MAX_VALUE else (p.width - hud.contentWidth).coerceAtLeast(0f)
|
||||
val maxY = if (p == null) Float.MAX_VALUE else (p.height - hud.contentHeight).coerceAtLeast(0f)
|
||||
wantX = tabX.coerceIn(0f, maxX); wantY = tabY.coerceIn(0f, maxY)
|
||||
anchorX = if (snaps && !hud.isStrip && p != null) (if (wantX < maxX / 2f) 0f else 1f) else Float.NaN
|
||||
if (!anchorX.isNaN()) wantX = anchorX * maxX
|
||||
val b = (hud.parent as? View)?.let { HudBounds.of(it, hud.contentWidth, hud.contentHeight) }
|
||||
wantX = if (b == null) tabX.coerceAtLeast(0f) else tabX.coerceIn(b.left, b.maxX)
|
||||
wantY = if (b == null) tabY.coerceAtLeast(0f) else tabY.coerceIn(b.top, b.maxY)
|
||||
anchorX = if (snaps && !hud.isStrip && b != null) b.anchorFor(wantX) else Float.NaN
|
||||
if (b != null && !anchorX.isNaN()) wantX = b.anchoredX(anchorX)
|
||||
SessionPrefs.setDroidDeckHudPosition(context, wantX, wantY)
|
||||
}
|
||||
|
||||
@@ -493,13 +494,13 @@ class DroidDeckHudHost(context: Context) {
|
||||
if (scale > 0.999f) from else (to - from * scale) / (1f - scale)
|
||||
|
||||
private fun settled(p: View, dock: DroidDeckHudDock, w: Float, h: Float): Pair<Float, Float> {
|
||||
val maxX = (p.width - w).coerceAtLeast(0f); val maxY = (p.height - h).coerceAtLeast(0f)
|
||||
var x = wantX.coerceIn(0f, maxX); var y = wantY.coerceIn(0f, maxY)
|
||||
val b = HudBounds.of(p, w, h)
|
||||
var x = wantX.coerceIn(b.left, b.maxX); var y = wantY.coerceIn(b.top, b.maxY)
|
||||
when (dock) {
|
||||
DroidDeckHudDock.LEFT -> x = 0f
|
||||
DroidDeckHudDock.RIGHT -> x = maxX
|
||||
DroidDeckHudDock.TOP -> y = 0f
|
||||
DroidDeckHudDock.BOTTOM -> y = maxY
|
||||
DroidDeckHudDock.LEFT -> x = b.left
|
||||
DroidDeckHudDock.RIGHT -> x = b.maxX
|
||||
DroidDeckHudDock.TOP -> y = b.top
|
||||
DroidDeckHudDock.BOTTOM -> y = b.maxY
|
||||
DroidDeckHudDock.NONE, DroidDeckHudDock.FLOAT -> {}
|
||||
}
|
||||
return Pair(x, y)
|
||||
@@ -510,21 +511,18 @@ class DroidDeckHudHost(context: Context) {
|
||||
val p = v.parent as? View ?: return
|
||||
if (p.width <= 0 || p.height <= 0 || v.width <= 0 || v.height <= 0) return
|
||||
if (wantX.isNaN()) { wantX = v.x; wantY = v.y }
|
||||
val maxX = (p.width - v.width).toFloat().coerceAtLeast(0f)
|
||||
val maxY = (p.height - v.height).toFloat().coerceAtLeast(0f)
|
||||
val b = HudBounds.of(p, v.width.toFloat(), v.height.toFloat())
|
||||
val anchored = (v as? DroidDeckHudView)?.let { it.dock == DroidDeckHudDock.NONE && !it.isStrip } == true
|
||||
if (snaps && anchored && anchorX.isNaN()) {
|
||||
anchorX = if (wantX.coerceIn(0f, maxX) < maxX / 2f) 0f else 1f
|
||||
}
|
||||
if (snaps && anchored && !anchorX.isNaN()) wantX = anchorX * maxX
|
||||
var x = wantX.coerceIn(0f, maxX)
|
||||
var y = wantY.coerceIn(0f, maxY)
|
||||
if ((v as? DroidDeckHudView)?.isStrip == true) y = if (y + v.height / 2f < p.height / 2f) 0f else maxY
|
||||
if (snaps && anchored && anchorX.isNaN()) anchorX = b.anchorFor(wantX)
|
||||
if (snaps && anchored && !anchorX.isNaN()) wantX = b.anchoredX(anchorX)
|
||||
var x = wantX.coerceIn(b.left, b.maxX)
|
||||
var y = wantY.coerceIn(b.top, b.maxY)
|
||||
if ((v as? DroidDeckHudView)?.isStrip == true) y = if (y + v.height / 2f < (b.top + b.bottom) / 2f) b.top else b.maxY
|
||||
when (v.let { it as? DroidDeckHudView }?.dock) {
|
||||
DroidDeckHudDock.LEFT -> x = 0f
|
||||
DroidDeckHudDock.RIGHT -> x = maxX
|
||||
DroidDeckHudDock.TOP -> y = 0f
|
||||
DroidDeckHudDock.BOTTOM -> y = maxY
|
||||
DroidDeckHudDock.LEFT -> x = b.left
|
||||
DroidDeckHudDock.RIGHT -> x = b.maxX
|
||||
DroidDeckHudDock.TOP -> y = b.top
|
||||
DroidDeckHudDock.BOTTOM -> y = b.maxY
|
||||
else -> {}
|
||||
}
|
||||
if (v.x != x) v.x = x
|
||||
@@ -551,3 +549,25 @@ class DroidDeckHudHost(context: Context) {
|
||||
}.getOrNull()?.takeIf { it.isNotBlank() }
|
||||
}
|
||||
}
|
||||
|
||||
internal class HudBounds(val left: Float, val top: Float, val right: Float, val bottom: Float, w: Float, h: Float) {
|
||||
val maxX = (right - w).coerceAtLeast(left)
|
||||
val maxY = (bottom - h).coerceAtLeast(top)
|
||||
|
||||
fun anchorFor(x: Float): Float = if (x.coerceIn(left, maxX) - left < (maxX - left) / 2f) 0f else 1f
|
||||
|
||||
fun anchoredX(anchor: Float): Float = left + anchor * (maxX - left)
|
||||
|
||||
companion object {
|
||||
fun of(p: View, w: Float, h: Float): HudBounds {
|
||||
val left = p.paddingLeft.toFloat()
|
||||
val top = p.paddingTop.toFloat()
|
||||
return HudBounds(
|
||||
left, top,
|
||||
(p.width - p.paddingRight).toFloat().coerceAtLeast(left),
|
||||
(p.height - p.paddingBottom).toFloat().coerceAtLeast(top),
|
||||
w, h,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -934,7 +934,7 @@ class DroidDeckHudView(context: Context) : View(context) {
|
||||
val rowPx = sp(11.5f); val unitPx = rowPx * 0.8f; val fpsPx = sp(15f)
|
||||
val padX = sp(10f); val groupGap = sp(13f)
|
||||
val h = sp(26f)
|
||||
val w = ((parent as? View)?.width?.takeIf { it > 0 } ?: resources.displayMetrics.widthPixels).toFloat()
|
||||
val w = ((parent as? View)?.let { it.width - it.paddingLeft - it.paddingRight }?.takeIf { it > 0 } ?: resources.displayMetrics.widthPixels).toFloat()
|
||||
val mid = h / 2f
|
||||
val baseline = mid + capHeight(fpsPx) / 2f
|
||||
|
||||
|
||||
@@ -762,8 +762,6 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
onRailSelect(key)
|
||||
}, a)
|
||||
CompositionLocalProvider(LocalShowSection provides { key -> selected = key }) {
|
||||
val swipeContext = androidx.compose.ui.platform.LocalContext.current
|
||||
remember { com.droiddeck.launcher.core.AppUiPrefs.pageSwipe(swipeContext).also { PageSwipe.on = it } }
|
||||
val agentKeyboardOpen = openTab == "agent" && WindowInsets.ime.getBottom(androidx.compose.ui.platform.LocalDensity.current) > 0
|
||||
LauncherLayout(
|
||||
bottomNavigation && !s.dualScreen, pal.line,
|
||||
@@ -789,7 +787,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
) {
|
||||
Pane(
|
||||
s, selected, a, page,
|
||||
Modifier.fillMaxSize().then(paneFocus).pageSwipe({ !processSettingsPageVisible && appToChooseDisplay == null }, edgeGuard = { !bottomNavigation }) { dir ->
|
||||
Modifier.fillMaxSize().then(paneFocus).pageSwipe({ !processSettingsPageVisible && appToChooseDisplay == null }) { dir ->
|
||||
val keys = navigationKeys(s)
|
||||
val at = keys.indexOf(railSelectionNow.value)
|
||||
if (at >= 0) keys.getOrNull(at + dir)?.let { key ->
|
||||
|
||||
@@ -516,13 +516,6 @@ internal fun SetupPanel(
|
||||
if (s.launcherFullscreen) stringResource(R.string.setup_fullscreen_on) else stringResource(R.string.setup_fullscreen_off),
|
||||
s.launcherFullscreen,
|
||||
) { a.onLauncherFullscreen(it) }
|
||||
ToggleRow(
|
||||
host, "page-swipe", stringResource(R.string.setup_page_swipe),
|
||||
stringResource(R.string.setup_page_swipe_hint), PageSwipe.on,
|
||||
) { on ->
|
||||
PageSwipe.on = on
|
||||
com.droiddeck.launcher.core.AppUiPrefs.setPageSwipe(ctx, on)
|
||||
}
|
||||
ToggleRow(
|
||||
host, "controller-haptics", stringResource(R.string.setup_controller_haptics),
|
||||
stringResource(R.string.setup_controller_haptics_hint),
|
||||
|
||||
@@ -6,8 +6,6 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.geometry.Offset
|
||||
@@ -15,40 +13,26 @@ import androidx.compose.ui.input.pointer.PointerEventPass
|
||||
import androidx.compose.ui.input.pointer.pointerInput
|
||||
import androidx.compose.ui.input.pointer.util.VelocityTracker
|
||||
import androidx.compose.ui.input.pointer.util.addPointerInputChange
|
||||
import androidx.compose.ui.layout.LayoutCoordinates
|
||||
import androidx.compose.ui.layout.findRootCoordinates
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
import androidx.compose.ui.unit.dp
|
||||
import kotlin.math.abs
|
||||
|
||||
internal object PageSwipe {
|
||||
var locks by mutableIntStateOf(0)
|
||||
var direction by mutableIntStateOf(0)
|
||||
var on by mutableStateOf(true)
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun Modifier.pageSwipe(enabled: () -> Boolean, edgeGuard: () -> Boolean = { false }, onSwipe: (Int) -> Unit): Modifier {
|
||||
internal fun Modifier.pageSwipe(enabled: () -> Boolean, onSwipe: (Int) -> Unit): Modifier {
|
||||
val enabledNow by rememberUpdatedState(enabled)
|
||||
val edgeGuardNow by rememberUpdatedState(edgeGuard)
|
||||
val onSwipeNow by rememberUpdatedState(onSwipe)
|
||||
val placed = remember { arrayOfNulls<LayoutCoordinates>(1) }
|
||||
return onGloballyPositioned { placed[0] = it }.pointerInput(Unit) {
|
||||
return pointerInput(Unit) {
|
||||
val distance = 72.dp.toPx()
|
||||
val flingDistance = 32.dp.toPx()
|
||||
val flingVelocity = 900.dp.toPx()
|
||||
val slop = viewConfiguration.touchSlop
|
||||
val edge = 32.dp.toPx()
|
||||
awaitEachGesture {
|
||||
val down = awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Final)
|
||||
if (!PageSwipe.on || !enabledNow() || PageSwipe.locks > 0) return@awaitEachGesture
|
||||
// A swipe in from the screen's edge brings back hidden system bars; it should not also turn the page.
|
||||
if (edgeGuardNow()) {
|
||||
val at = placed[0]?.takeIf { it.isAttached }
|
||||
val x = at?.localToRoot(down.position)?.x ?: down.position.x
|
||||
val width = at?.findRootCoordinates()?.size?.width?.toFloat() ?: size.width.toFloat()
|
||||
if (x < edge || x > width - edge) return@awaitEachGesture
|
||||
}
|
||||
if (!enabledNow() || PageSwipe.locks > 0) return@awaitEachGesture
|
||||
val tracker = VelocityTracker()
|
||||
tracker.addPointerInputChange(down)
|
||||
var total = Offset.Zero
|
||||
@@ -64,7 +48,7 @@ internal fun Modifier.pageSwipe(enabled: () -> Boolean, edgeGuard: () -> Boolean
|
||||
if (!mine && abs(total.x) > slop && abs(total.x) > abs(total.y) * 2f) mine = true
|
||||
if (mine) change.consume()
|
||||
}
|
||||
if (!mine || !PageSwipe.on || PageSwipe.locks > 0) return@awaitEachGesture
|
||||
if (!mine || PageSwipe.locks > 0) return@awaitEachGesture
|
||||
val vx = tracker.calculateVelocity().x
|
||||
val horizontal = abs(total.x) > abs(total.y) * 1.5f
|
||||
val far = abs(total.x) > distance
|
||||
|
||||
@@ -108,7 +108,6 @@ internal object SettingsIndex {
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_launcher_orientation, "rotate", "portrait"),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_session_orientation, "rotate", "portrait"),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_fullscreen),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_page_swipe, "gesture"),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_controller_haptics, "vibration", "rumble"),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_dual_screen_launcher, "thor", "second screen", "bottom screen"),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_low_storage_warning),
|
||||
|
||||
@@ -971,8 +971,6 @@
|
||||
<string name="setup_fullscreen">ملء الشاشة</string>
|
||||
<string name="setup_fullscreen_on">يخفي شريطي الحالة والتنقّل في Android</string>
|
||||
<string name="setup_fullscreen_off">يعرض شريطي الحالة والتنقّل في Android</string>
|
||||
<string name="setup_page_swipe">التمرير بين الصفحات</string>
|
||||
<string name="setup_page_swipe_hint">اسحب عبر الصفحة لتغيير علامة التبويب.</string>
|
||||
<string name="setup_dual_screen_launcher">المشغّل على شاشتين</string>
|
||||
<string name="setup_dual_screen_launcher_hint">يضع الوضع «تلقائي» أقسام المشغّل (Steam والمكتبة والمتاجر وغيرها) على الشاشة الثانية في الأجهزة المحمولة المزوّدة بشاشة ثانية مدمجة. ويستخدم الوضع «تشغيل» أي شاشة ثانية. أما الوضع «إيقاف» فيُبقي المشغّل على شاشة واحدة.</string>
|
||||
<string name="setup_dual_screen_sessions">الجلسات على شاشتين</string>
|
||||
|
||||
@@ -989,8 +989,6 @@
|
||||
<string name="setup_fullscreen">Pantalla completa</string>
|
||||
<string name="setup_fullscreen_on">Oculta las barras de estado y navegación de Android</string>
|
||||
<string name="setup_fullscreen_off">Muestra las barras de estado y navegación de Android</string>
|
||||
<string name="setup_page_swipe">Deslizar entre páginas</string>
|
||||
<string name="setup_page_swipe_hint">Desliza sobre una página para cambiar de pestaña.</string>
|
||||
<string name="setup_dual_screen_launcher">Lanzador de doble pantalla</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automático coloca las secciones del lanzador (Steam, Biblioteca, Tiendas y las demás) en la segunda pantalla integrada de las consolas portátiles que la tienen. Activado usa cualquier segunda pantalla. Desactivado mantiene el lanzador en una sola pantalla.</string>
|
||||
<string name="setup_dual_screen_sessions">Sesiones de doble pantalla</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Цял екран</string>
|
||||
<string name="setup_fullscreen_on">Скрива лентите за състояние и навигация на Android</string>
|
||||
<string name="setup_fullscreen_off">Показва лентите за състояние и навигация на Android</string>
|
||||
<string name="setup_page_swipe">Плъзгане между страниците</string>
|
||||
<string name="setup_page_swipe_hint">Плъзнете по страница, за да смените раздела.</string>
|
||||
<string name="setup_dual_screen_launcher">Лаунчер с два екрана</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Автоматично: секциите на лаунчера (Steam, Библиотека, Магазини и останалите) се показват на втория екран при преносими устройства с вграден такъв. Включено: използва се всеки втори дисплей. Изключено: лаунчерът остава на един екран.</string>
|
||||
<string name="setup_dual_screen_sessions">Сесии с два екрана</string>
|
||||
|
||||
@@ -965,8 +965,6 @@
|
||||
<string name="setup_fullscreen">Celá obrazovka</string>
|
||||
<string name="setup_fullscreen_on">Skryje stavový a navigační panel Androidu</string>
|
||||
<string name="setup_fullscreen_off">Zobrazí stavový a navigační panel Androidu</string>
|
||||
<string name="setup_page_swipe">Přejíždění mezi stránkami</string>
|
||||
<string name="setup_page_swipe_hint">Přejetím přes stránku přepnete kartu.</string>
|
||||
<string name="setup_dual_screen_launcher">Spouštěč na dvou obrazovkách</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automaticky přesune sekce spouštěče (Steam, Knihovna, Obchody a ostatní) na druhou obrazovku handheldů, které ji mají vestavěnou. Zapnuto použije libovolný druhý displej. Vypnuto ponechá spouštěč na jedné obrazovce.</string>
|
||||
<string name="setup_dual_screen_sessions">Relace na dvou obrazovkách</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Fuldskærm</string>
|
||||
<string name="setup_fullscreen_on">Skjuler Androids status- og navigationsbjælker</string>
|
||||
<string name="setup_fullscreen_off">Viser Androids status- og navigationsbjælker</string>
|
||||
<string name="setup_page_swipe">Stryg mellem sider</string>
|
||||
<string name="setup_page_swipe_hint">Stryg hen over en side for at skifte fane.</string>
|
||||
<string name="setup_dual_screen_launcher">Launcher til to skærme</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatisk placerer launcherens sektioner (Steam, Bibliotek, Butikker og resten) på den anden skærm på håndholdte enheder med en indbygget anden skærm. Til bruger enhver ekstra skærm. Fra holder launcheren på én skærm.</string>
|
||||
<string name="setup_dual_screen_sessions">Sessioner på to skærme</string>
|
||||
|
||||
@@ -951,8 +951,6 @@
|
||||
<string name="setup_fullscreen">Vollbild</string>
|
||||
<string name="setup_fullscreen_on">Blendet die Status- und Navigationsleiste von Android aus</string>
|
||||
<string name="setup_fullscreen_off">Zeigt die Status- und Navigationsleiste von Android an</string>
|
||||
<string name="setup_page_swipe">Zwischen Seiten wischen</string>
|
||||
<string name="setup_page_swipe_hint">Über eine Seite wischen, um den Tab zu wechseln.</string>
|
||||
<string name="setup_dual_screen_launcher">Dual-Screen-Launcher</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Bei Automatisch liegen die Launcher-Bereiche (Steam, Bibliothek, Shops und die übrigen) auf dem zweiten Bildschirm von Handhelds mit integriertem zweitem Bildschirm. Ein nutzt einen beliebigen zweiten Bildschirm. Aus belässt den Launcher auf einem Bildschirm.</string>
|
||||
<string name="setup_dual_screen_sessions">Dual-Screen-Sitzungen</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Πλήρης οθόνη</string>
|
||||
<string name="setup_fullscreen_on">Αποκρύπτει τις γραμμές κατάστασης και πλοήγησης του Android</string>
|
||||
<string name="setup_fullscreen_off">Εμφανίζει τις γραμμές κατάστασης και πλοήγησης του Android</string>
|
||||
<string name="setup_page_swipe">Σάρωση μεταξύ σελίδων</string>
|
||||
<string name="setup_page_swipe_hint">Σαρώστε κατά μήκος μιας σελίδας για να αλλάξετε καρτέλα.</string>
|
||||
<string name="setup_dual_screen_launcher">Εκκινητής διπλής οθόνης</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Η επιλογή Αυτόματα τοποθετεί τις ενότητες του εκκινητή (Steam, Βιβλιοθήκη, Καταστήματα και τις υπόλοιπες) στη δεύτερη οθόνη των φορητών κονσολών με ενσωματωμένη δεύτερη οθόνη. Η επιλογή Ενεργό χρησιμοποιεί οποιαδήποτε δεύτερη οθόνη. Η επιλογή Ανενεργό κρατά τον εκκινητή σε μία οθόνη.</string>
|
||||
<string name="setup_dual_screen_sessions">Συνεδρίες διπλής οθόνης</string>
|
||||
|
||||
@@ -962,8 +962,6 @@
|
||||
<string name="setup_fullscreen">Pantalla completa</string>
|
||||
<string name="setup_fullscreen_on">Oculta las barras de estado y navegación de Android</string>
|
||||
<string name="setup_fullscreen_off">Muestra las barras de estado y navegación de Android</string>
|
||||
<string name="setup_page_swipe">Deslizar entre páginas</string>
|
||||
<string name="setup_page_swipe_hint">Desliza sobre una página para cambiar de pestaña.</string>
|
||||
<string name="setup_dual_screen_launcher">Lanzador de doble pantalla</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automático coloca las secciones del lanzador (Steam, Biblioteca, Tiendas y el resto) en la segunda pantalla de las consolas portátiles que la llevan integrada. Activado usa cualquier segunda pantalla. Desactivado mantiene el lanzador en una sola pantalla.</string>
|
||||
<string name="setup_dual_screen_sessions">Sesiones de doble pantalla</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Koko näyttö</string>
|
||||
<string name="setup_fullscreen_on">Piilottaa Androidin tila- ja navigointipalkit</string>
|
||||
<string name="setup_fullscreen_off">Näyttää Androidin tila- ja navigointipalkit</string>
|
||||
<string name="setup_page_swipe">Pyyhkäise sivujen välillä</string>
|
||||
<string name="setup_page_swipe_hint">Vaihda välilehteä pyyhkäisemällä sivun poikki.</string>
|
||||
<string name="setup_dual_screen_launcher">Kahden näytön käynnistin</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automaattinen siirtää käynnistimen osiot (Steam, Kirjasto, Kaupat ja muut) käsikonsolin sisäänrakennetulle toiselle näytölle. Päällä käyttää mitä tahansa toista näyttöä. Pois päältä pitää käynnistimen yhdellä näytöllä.</string>
|
||||
<string name="setup_dual_screen_sessions">Kahden näytön istunnot</string>
|
||||
|
||||
@@ -962,8 +962,6 @@
|
||||
<string name="setup_fullscreen">Plein écran</string>
|
||||
<string name="setup_fullscreen_on">Masquer la barre d\'état et la barre de navigation Android</string>
|
||||
<string name="setup_fullscreen_off">Afficher la barre d\'état et la barre de navigation Android</string>
|
||||
<string name="setup_page_swipe">Balayer entre les pages</string>
|
||||
<string name="setup_page_swipe_hint">Balayez une page pour changer d\'onglet.</string>
|
||||
<string name="setup_dual_screen_launcher">Lanceur double écran</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatique place les sections du lanceur (Steam, Bibliothèque, Boutiques et les autres) sur le second écran intégré des consoles portables qui en sont équipées. Activé utilise n\'importe quel écran secondaire. Désactivé conserve le lanceur sur un seul écran.</string>
|
||||
<string name="setup_dual_screen_sessions">Sessions double écran</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">फ़ुलस्क्रीन</string>
|
||||
<string name="setup_fullscreen_on">Android स्टेटस और नेविगेशन बार छिपाता है</string>
|
||||
<string name="setup_fullscreen_off">Android स्टेटस और नेविगेशन बार दिखाता है</string>
|
||||
<string name="setup_page_swipe">पेजों के बीच स्वाइप करें</string>
|
||||
<string name="setup_page_swipe_hint">टैब बदलने के लिए किसी पेज पर स्वाइप करें।</string>
|
||||
<string name="setup_dual_screen_launcher">डुअल स्क्रीन लॉन्चर</string>
|
||||
<string name="setup_dual_screen_launcher_hint">स्वचालित पर, बिल्ट-इन दूसरी स्क्रीन वाले हैंडहेल्ड में लॉन्चर के सेक्शन (Steam, लाइब्रेरी, स्टोर्स और बाकी) दूसरी स्क्रीन पर चले जाते हैं। चालू पर कोई भी दूसरी डिस्प्ले इस्तेमाल होती है। बंद पर लॉन्चर एक ही स्क्रीन पर रहता है।</string>
|
||||
<string name="setup_dual_screen_sessions">डुअल स्क्रीन सत्र</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Teljes képernyő</string>
|
||||
<string name="setup_fullscreen_on">Elrejti az Android állapot- és navigációs sávokat</string>
|
||||
<string name="setup_fullscreen_off">Megjeleníti az Android állapot- és navigációs sávokat</string>
|
||||
<string name="setup_page_swipe">Lapozás csúsztatással</string>
|
||||
<string name="setup_page_swipe_hint">Csúsztasson végig egy oldalon a lapváltáshoz.</string>
|
||||
<string name="setup_dual_screen_launcher">Kétképernyős indító</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Az Automatikus mód a beépített második képernyővel rendelkező kézi eszközökön a második képernyőre helyezi az indító szakaszait (Steam, Könyvtár, Áruházak és a többi). A Be mód bármely második kijelzőt használ. A Ki mód egy képernyőn tartja az indítót.</string>
|
||||
<string name="setup_dual_screen_sessions">Kétképernyős munkamenetek</string>
|
||||
|
||||
@@ -956,8 +956,6 @@
|
||||
<string name="setup_fullscreen">Layar penuh</string>
|
||||
<string name="setup_fullscreen_on">Menyembunyikan bilah status dan navigasi Android</string>
|
||||
<string name="setup_fullscreen_off">Menampilkan bilah status dan navigasi Android</string>
|
||||
<string name="setup_page_swipe">Geser antarhalaman</string>
|
||||
<string name="setup_page_swipe_hint">Geser melintasi halaman untuk berganti tab.</string>
|
||||
<string name="setup_dual_screen_launcher">Peluncur layar ganda</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Otomatis menempatkan bagian peluncur (Steam, Pustaka, Toko, dan bagian lainnya) pada layar kedua bawaan perangkat genggam. Aktif memakai layar kedua mana pun. Nonaktif membuat peluncur tetap di satu layar saja.</string>
|
||||
<string name="setup_dual_screen_sessions">Sesi layar ganda</string>
|
||||
|
||||
@@ -954,8 +954,6 @@
|
||||
<string name="setup_fullscreen">Schermo intero</string>
|
||||
<string name="setup_fullscreen_on">Nasconde la barra di stato e la barra di navigazione di Android</string>
|
||||
<string name="setup_fullscreen_off">Mostra la barra di stato e la barra di navigazione di Android</string>
|
||||
<string name="setup_page_swipe">Scorri tra le pagine</string>
|
||||
<string name="setup_page_swipe_hint">Scorri su una pagina per cambiare scheda.</string>
|
||||
<string name="setup_dual_screen_launcher">Launcher a doppio schermo</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatico colloca le sezioni del launcher (Steam, Libreria, Store e le altre) sullo schermo secondario integrato delle console portatili che ne hanno uno. Con Attivo si usa qualsiasi display secondario. Con Disattivo il launcher resta su un solo schermo.</string>
|
||||
<string name="setup_dual_screen_sessions">Sessioni a doppio schermo</string>
|
||||
|
||||
@@ -956,8 +956,6 @@
|
||||
<string name="setup_fullscreen">全画面</string>
|
||||
<string name="setup_fullscreen_on">Androidのステータスバーとナビゲーションバーを非表示</string>
|
||||
<string name="setup_fullscreen_off">Androidのステータスバーとナビゲーションバーを表示</string>
|
||||
<string name="setup_page_swipe">スワイプでページを切り替え</string>
|
||||
<string name="setup_page_swipe_hint">ページを横切るようにスワイプすると、タブを切り替えます。</string>
|
||||
<string name="setup_dual_screen_launcher">デュアルスクリーンランチャー</string>
|
||||
<string name="setup_dual_screen_launcher_hint">自動では、内蔵セカンドスクリーンを搭載した携帯ゲーム機で、ランチャーの各セクション(Steam、ライブラリ、ストアなど)を2画面目に表示します。オンでは任意のセカンドディスプレイを使用します。オフではランチャーを1画面に留めます。</string>
|
||||
<string name="setup_dual_screen_sessions">デュアルスクリーンセッション</string>
|
||||
|
||||
@@ -956,8 +956,6 @@
|
||||
<string name="setup_fullscreen">전체 화면</string>
|
||||
<string name="setup_fullscreen_on">Android 상태 표시줄 및 탐색 표시줄 숨기기</string>
|
||||
<string name="setup_fullscreen_off">Android 상태 표시줄 및 탐색 표시줄 표시</string>
|
||||
<string name="setup_page_swipe">스와이프로 페이지 전환</string>
|
||||
<string name="setup_page_swipe_hint">페이지를 가로질러 스와이프하면 탭이 바뀝니다.</string>
|
||||
<string name="setup_dual_screen_launcher">듀얼 화면 런처</string>
|
||||
<string name="setup_dual_screen_launcher_hint">자동은 내장 두 번째 화면이 있는 휴대용 기기에서 런처 섹션(Steam, 라이브러리, 스토어 등)을 두 번째 화면에 표시합니다. 켜기는 어떤 두 번째 디스플레이든 사용합니다. 끄기는 런처를 한 화면에 유지합니다.</string>
|
||||
<string name="setup_dual_screen_sessions">듀얼 화면 세션</string>
|
||||
|
||||
@@ -956,8 +956,6 @@
|
||||
<string name="setup_fullscreen">Skrin penuh</string>
|
||||
<string name="setup_fullscreen_on">Menyembunyikan bar status dan navigasi Android</string>
|
||||
<string name="setup_fullscreen_off">Memaparkan bar status dan navigasi Android</string>
|
||||
<string name="setup_page_swipe">Leret antara halaman</string>
|
||||
<string name="setup_page_swipe_hint">Leret merentasi halaman untuk menukar tab.</string>
|
||||
<string name="setup_dual_screen_launcher">Pelancar dwi skrin</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatik meletakkan bahagian pelancar (Steam, Pustaka, Kedai dan selebihnya) pada skrin kedua terbina dalam peranti genggam. Hidup menggunakan sebarang paparan kedua. Mati mengekalkan pelancar pada satu skrin.</string>
|
||||
<string name="setup_dual_screen_sessions">Sesi dwi skrin</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Fullskjerm</string>
|
||||
<string name="setup_fullscreen_on">Skjuler Androids status- og navigasjonslinjer</string>
|
||||
<string name="setup_fullscreen_off">Viser Androids status- og navigasjonslinjer</string>
|
||||
<string name="setup_page_swipe">Sveip mellom sider</string>
|
||||
<string name="setup_page_swipe_hint">Sveip over en side for å bytte fane.</string>
|
||||
<string name="setup_dual_screen_launcher">Startprogram på to skjermer</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatisk plasserer startprogrammets deler (Steam, Bibliotek, Butikker og resten) på den andre skjermen på håndholdte enheter med innebygd sekundærskjerm. På bruker en hvilken som helst annen skjerm. Av holder startprogrammet på én skjerm.</string>
|
||||
<string name="setup_dual_screen_sessions">Økter på to skjermer</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Volledig scherm</string>
|
||||
<string name="setup_fullscreen_on">Verbergt de statusbalk en navigatiebalk van Android</string>
|
||||
<string name="setup_fullscreen_off">Toont de statusbalk en navigatiebalk van Android</string>
|
||||
<string name="setup_page_swipe">Vegen tussen pagina\'s</string>
|
||||
<string name="setup_page_swipe_hint">Veeg over een pagina om van tabblad te wisselen.</string>
|
||||
<string name="setup_dual_screen_launcher">Launcher op twee schermen</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatisch zet de launchersecties (Steam, Bibliotheek, Winkels en de rest) op het tweede scherm van handhelds met een ingebouwd exemplaar. Aan gebruikt elk tweede scherm. Uit houdt de launcher op één scherm.</string>
|
||||
<string name="setup_dual_screen_sessions">Sessies op twee schermen</string>
|
||||
|
||||
@@ -965,8 +965,6 @@
|
||||
<string name="setup_fullscreen">Pełny ekran</string>
|
||||
<string name="setup_fullscreen_on">Ukrywa systemowe paski stanu i nawigacji</string>
|
||||
<string name="setup_fullscreen_off">Pokazuje systemowe paski stanu i nawigacji</string>
|
||||
<string name="setup_page_swipe">Przesuwanie między stronami</string>
|
||||
<string name="setup_page_swipe_hint">Przesuń palcem po stronie, aby zmienić kartę.</string>
|
||||
<string name="setup_dual_screen_launcher">Launcher na dwóch ekranach</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatycznie umieszcza sekcje launchera (Steam, Biblioteka, Sklepy i pozostałe) na wbudowanym drugim ekranie konsol przenośnych. Włączone używa dowolnego drugiego wyświetlacza. Wyłączone pozostawia launcher na jednym ekranie.</string>
|
||||
<string name="setup_dual_screen_sessions">Sesje na dwóch ekranach</string>
|
||||
|
||||
@@ -954,8 +954,6 @@
|
||||
<string name="setup_fullscreen">Ecrã inteiro</string>
|
||||
<string name="setup_fullscreen_on">Oculta as barras de estado e de navegação do Android</string>
|
||||
<string name="setup_fullscreen_off">Mostra as barras de estado e de navegação do Android</string>
|
||||
<string name="setup_page_swipe">Deslizar entre páginas</string>
|
||||
<string name="setup_page_swipe_hint">Deslize sobre uma página para mudar de separador.</string>
|
||||
<string name="setup_dual_screen_launcher">Iniciador de ecrã duplo</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automático coloca as secções do iniciador (Steam, Biblioteca, Lojas e as restantes) no segundo ecrã das consolas portáteis com um segundo ecrã integrado. Ativado utiliza qualquer segundo ecrã. Desativado mantém o iniciador num único ecrã.</string>
|
||||
<string name="setup_dual_screen_sessions">Sessões de ecrã duplo</string>
|
||||
|
||||
@@ -961,8 +961,6 @@
|
||||
<string name="setup_fullscreen">Tela cheia</string>
|
||||
<string name="setup_fullscreen_on">Oculta as barras de status e de navegação do Android</string>
|
||||
<string name="setup_fullscreen_off">Mostra as barras de status e de navegação do Android</string>
|
||||
<string name="setup_page_swipe">Deslizar entre páginas</string>
|
||||
<string name="setup_page_swipe_hint">Deslize sobre uma página para mudar de aba.</string>
|
||||
<string name="setup_dual_screen_launcher">Iniciador em duas telas</string>
|
||||
<string name="setup_dual_screen_launcher_hint">O modo automático coloca as seções do iniciador (Steam, Biblioteca, Lojas e as demais) na segunda tela de consoles portáteis com uma tela secundária integrada. Ativado usa qualquer tela secundária. Desativado mantém o iniciador em uma única tela.</string>
|
||||
<string name="setup_dual_screen_sessions">Sessões em duas telas</string>
|
||||
|
||||
@@ -962,8 +962,6 @@
|
||||
<string name="setup_fullscreen">Ecran complet</string>
|
||||
<string name="setup_fullscreen_on">Ascunde barele de stare și de navigare Android</string>
|
||||
<string name="setup_fullscreen_off">Arată barele de stare și de navigare Android</string>
|
||||
<string name="setup_page_swipe">Glisare între pagini</string>
|
||||
<string name="setup_page_swipe_hint">Glisați peste o pagină pentru a schimba fila.</string>
|
||||
<string name="setup_dual_screen_launcher">Lansator pe două ecrane</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automat plasează secțiunile lansatorului (Steam, Bibliotecă, Magazine și celelalte) pe ecranul secundar al consolelor portabile cu unul integrat. Activat folosește orice ecran secundar. Dezactivat păstrează lansatorul pe un singur ecran.</string>
|
||||
<string name="setup_dual_screen_sessions">Sesiuni pe două ecrane</string>
|
||||
|
||||
@@ -965,8 +965,6 @@
|
||||
<string name="setup_fullscreen">Полноэкранный режим</string>
|
||||
<string name="setup_fullscreen_on">Скрывает строку состояния и панель навигации Android</string>
|
||||
<string name="setup_fullscreen_off">Показывает строку состояния и панель навигации Android</string>
|
||||
<string name="setup_page_swipe">Перелистывание страниц свайпом</string>
|
||||
<string name="setup_page_swipe_hint">Проведите по странице, чтобы сменить вкладку.</string>
|
||||
<string name="setup_dual_screen_launcher">Лаунчер на двух экранах</string>
|
||||
<string name="setup_dual_screen_launcher_hint">«Автоматически» переносит разделы лаунчера (Steam, Библиотека, Магазины и остальные) на второй экран портативных устройств со встроенным вторым экраном. «Вкл.» использует любой второй дисплей. «Выкл.» оставляет лаунчер на одном экране.</string>
|
||||
<string name="setup_dual_screen_sessions">Сессии на двух экранах</string>
|
||||
|
||||
@@ -959,8 +959,6 @@
|
||||
<string name="setup_fullscreen">Helskärm</string>
|
||||
<string name="setup_fullscreen_on">Döljer Androids statusfält och navigeringsfält</string>
|
||||
<string name="setup_fullscreen_off">Visar Androids statusfält och navigeringsfält</string>
|
||||
<string name="setup_page_swipe">Svep mellan sidor</string>
|
||||
<string name="setup_page_swipe_hint">Svep över en sida för att byta flik.</string>
|
||||
<string name="setup_dual_screen_launcher">Startprogram för två skärmar</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Automatiskt: placerar startprogrammets avsnitt (Steam, Bibliotek, Butiker med flera) på den inbyggda andra skärmen på handhållna enheter som har en. På: använder vilken andra bildskärm som helst. Av: behåller startprogrammet på en skärm.</string>
|
||||
<string name="setup_dual_screen_sessions">Sessioner med två skärmar</string>
|
||||
|
||||
@@ -956,8 +956,6 @@
|
||||
<string name="setup_fullscreen">เต็มจอ</string>
|
||||
<string name="setup_fullscreen_on">ซ่อนแถบสถานะและแถบนำทางของ Android</string>
|
||||
<string name="setup_fullscreen_off">แสดงแถบสถานะและแถบนำทางของ Android</string>
|
||||
<string name="setup_page_swipe">ปัดเพื่อเปลี่ยนหน้า</string>
|
||||
<string name="setup_page_swipe_hint">ปัดผ่านหน้าเพื่อเปลี่ยนแท็บ</string>
|
||||
<string name="setup_dual_screen_launcher">ลอนเชอร์แบบสองจอ</string>
|
||||
<string name="setup_dual_screen_launcher_hint">โหมดอัตโนมัติจะแสดงส่วนต่างๆ ของลอนเชอร์ (Steam, คลังเกม, ร้านค้า และส่วนอื่นๆ) บนจอที่สองของเครื่องเล่นพกพาที่มีจอที่สองในตัว โหมดเปิดใช้จอที่สองใดก็ได้ โหมดปิดจะแสดงลอนเชอร์บนจอเดียว</string>
|
||||
<string name="setup_dual_screen_sessions">เซสชันแบบสองจอ</string>
|
||||
|
||||
@@ -951,8 +951,6 @@
|
||||
<string name="setup_fullscreen">Tam ekran</string>
|
||||
<string name="setup_fullscreen_on">Android durum ve gezinme çubuklarını gizler</string>
|
||||
<string name="setup_fullscreen_off">Android durum ve gezinme çubuklarını gösterir</string>
|
||||
<string name="setup_page_swipe">Sayfalar arasında kaydır</string>
|
||||
<string name="setup_page_swipe_hint">Sekme değiştirmek için sayfa boyunca kaydırın.</string>
|
||||
<string name="setup_dual_screen_launcher">Çift ekranlı başlatıcı</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Otomatik, yerleşik ikinci ekranı olan el konsollarında başlatıcı bölümlerini (Steam, Kitaplık, Mağazalar ve diğerleri) ikinci ekrana yerleştirir. Açık, herhangi bir ikinci ekranı kullanır. Kapalı, başlatıcıyı tek ekranda tutar.</string>
|
||||
<string name="setup_dual_screen_sessions">Çift ekranlı oturumlar</string>
|
||||
|
||||
@@ -965,8 +965,6 @@
|
||||
<string name="setup_fullscreen">Повний екран</string>
|
||||
<string name="setup_fullscreen_on">Приховує рядок стану та панель навігації Android</string>
|
||||
<string name="setup_fullscreen_off">Показує рядок стану та панель навігації Android</string>
|
||||
<string name="setup_page_swipe">Гортання сторінок свайпом</string>
|
||||
<string name="setup_page_swipe_hint">Проведіть по сторінці, щоб змінити вкладку.</string>
|
||||
<string name="setup_dual_screen_launcher">Лаунчер для двох екранів</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Автоматичний режим розміщує розділи лаунчера (Steam, Бібліотека, Магазини тощо) на вбудованому другому екрані портативних пристроїв. У режимі «Увімкнено» використовується будь-який другий дисплей. У режимі «Вимкнено» лаунчер залишається на одному екрані.</string>
|
||||
<string name="setup_dual_screen_sessions">Сеанси для двох екранів</string>
|
||||
|
||||
@@ -956,8 +956,6 @@
|
||||
<string name="setup_fullscreen">Toàn màn hình</string>
|
||||
<string name="setup_fullscreen_on">Ẩn thanh trạng thái và thanh điều hướng của Android</string>
|
||||
<string name="setup_fullscreen_off">Hiện thanh trạng thái và thanh điều hướng của Android</string>
|
||||
<string name="setup_page_swipe">Vuốt để chuyển trang</string>
|
||||
<string name="setup_page_swipe_hint">Vuốt ngang trang để đổi thẻ.</string>
|
||||
<string name="setup_dual_screen_launcher">Trình khởi chạy hai màn hình</string>
|
||||
<string name="setup_dual_screen_launcher_hint">Tự động đưa các phần của trình khởi chạy (Steam, Thư viện, Cửa hàng và phần còn lại) lên màn hình thứ hai tích hợp của máy cầm tay. Bật dùng bất kỳ màn hình thứ hai nào. Tắt giữ trình khởi chạy trên một màn hình.</string>
|
||||
<string name="setup_dual_screen_sessions">Phiên chơi hai màn hình</string>
|
||||
|
||||
@@ -956,8 +956,6 @@
|
||||
<string name="setup_fullscreen">全屏</string>
|
||||
<string name="setup_fullscreen_on">隐藏 Android 状态栏和导航栏</string>
|
||||
<string name="setup_fullscreen_off">显示 Android 状态栏和导航栏</string>
|
||||
<string name="setup_page_swipe">滑动切换页面</string>
|
||||
<string name="setup_page_swipe_hint">在页面上滑动即可切换标签。</string>
|
||||
<string name="setup_dual_screen_launcher">双屏启动器</string>
|
||||
<string name="setup_dual_screen_launcher_hint">自动会把启动器的各个板块(Steam、库、商店等)放到带内置副屏的掌机的第二块屏幕上。开启使用任意第二块显示屏。关闭则让启动器只显示在一块屏幕上。</string>
|
||||
<string name="setup_dual_screen_sessions">双屏会话</string>
|
||||
|
||||
@@ -955,8 +955,6 @@
|
||||
<string name="setup_fullscreen">全螢幕</string>
|
||||
<string name="setup_fullscreen_on">隱藏 Android 狀態列和導覽列</string>
|
||||
<string name="setup_fullscreen_off">顯示 Android 狀態列和導覽列</string>
|
||||
<string name="setup_page_swipe">滑動切換頁面</string>
|
||||
<string name="setup_page_swipe_hint">在頁面上滑動即可切換標籤。</string>
|
||||
<string name="setup_dual_screen_launcher">雙螢幕啟動器</string>
|
||||
<string name="setup_dual_screen_launcher_hint">自動會把啟動器各部分(Steam、收藏庫、商店及其他部分)放到內建雙螢幕手持裝置的第二螢幕。開啟會使用任何第二顯示器。關閉會將啟動器保持在單一螢幕。</string>
|
||||
<string name="setup_dual_screen_sessions">雙螢幕工作階段</string>
|
||||
|
||||
@@ -955,8 +955,6 @@
|
||||
<string name="setup_fullscreen">全螢幕</string>
|
||||
<string name="setup_fullscreen_on">隱藏 Android 狀態列和導覽列</string>
|
||||
<string name="setup_fullscreen_off">顯示 Android 狀態列和導覽列</string>
|
||||
<string name="setup_page_swipe">滑動切換頁面</string>
|
||||
<string name="setup_page_swipe_hint">在頁面上滑動即可切換分頁。</string>
|
||||
<string name="setup_dual_screen_launcher">雙螢幕啟動器</string>
|
||||
<string name="setup_dual_screen_launcher_hint">自動:在內建第二螢幕的掌機上,將啟動器區塊(Steam、收藏庫、商店等)放到第二螢幕。開啟:使用任一第二螢幕。關閉:啟動器維持在單一螢幕。</string>
|
||||
<string name="setup_dual_screen_sessions">雙螢幕工作階段</string>
|
||||
|
||||
@@ -1035,8 +1035,6 @@
|
||||
<string name="setup_fullscreen">Fullscreen</string>
|
||||
<string name="setup_fullscreen_on">Hides the Android status and navigation bars</string>
|
||||
<string name="setup_fullscreen_off">Shows the Android status and navigation bars</string>
|
||||
<string name="setup_page_swipe">Swipe between pages</string>
|
||||
<string name="setup_page_swipe_hint">Swipe across a page to change tabs.</string>
|
||||
<string name="setup_controller_haptics">Controller haptics</string>
|
||||
<string name="setup_controller_haptics_hint">A light tick when the D-pad, A or the shoulder buttons move or select in the launcher. Touch stays silent</string>
|
||||
<string name="setup_dual_screen_launcher">Dual screen launcher</string>
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.droiddeck.launcher.hud
|
||||
|
||||
import android.os.Looper
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import com.droiddeck.launcher.ui.Motion
|
||||
import org.junit.After
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
import org.robolectric.annotation.Config
|
||||
import org.robolectric.annotation.GraphicsMode
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [33], qualifiers = "xhdpi")
|
||||
@GraphicsMode(GraphicsMode.Mode.NATIVE)
|
||||
class DroidDeckHudHostInsetTest {
|
||||
private fun animate(scale: Float) {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
Settings.Global.putFloat(app.contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, scale)
|
||||
Motion.refresh(app)
|
||||
}
|
||||
|
||||
@Before fun noAnimation() = animate(0f)
|
||||
|
||||
@After fun restoreAnimation() = animate(1f)
|
||||
|
||||
private fun show(size: String, x: Float, y: Float, padLeft: Int, padRight: Int): DroidDeckHudView {
|
||||
val app = RuntimeEnvironment.getApplication()
|
||||
SessionPrefs.setDroidDeckHudConfig(app, DroidDeckHudConfig.encode(DroidDeckHudConfig.DEFAULTS + ("hudSnap" to "1") + ("hudSize" to size)))
|
||||
SessionPrefs.setDroidDeckHudPosition(app, x, y)
|
||||
val root = FrameLayout(app)
|
||||
root.setPadding(padLeft, 0, padRight, 0)
|
||||
DroidDeckHudHost(app).attach(root, 0)
|
||||
val hud = root.getChildAt(0) as DroidDeckHudView
|
||||
hud.visibility = View.VISIBLE
|
||||
val exactly = { s: Int -> View.MeasureSpec.makeMeasureSpec(s, View.MeasureSpec.EXACTLY) }
|
||||
root.measure(exactly(2000), exactly(1000))
|
||||
root.layout(0, 0, 2000, 1000)
|
||||
hud.showForTest(DroidDeckHudPanelTest.SNAPSHOT, "DXVK", 0L)
|
||||
hud.requestLayout()
|
||||
root.measure(exactly(2000), exactly(1000))
|
||||
root.layout(0, 0, 2000, 1000)
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
return hud
|
||||
}
|
||||
|
||||
@Test fun theStripSpansOnlyTheAreaInsideTheNotchPadding() {
|
||||
val hud = show("strip", 0f, 0f, padLeft = 120, padRight = 40)
|
||||
assertEquals(120f, hud.x, 0.5f)
|
||||
assertEquals(2000 - 120 - 40, hud.width)
|
||||
}
|
||||
|
||||
@Test fun aHudSnappedLeftSitsBesideTheNotchInsteadOfUnderIt() {
|
||||
val hud = show("full", 0f, 300f, padLeft = 120, padRight = 0)
|
||||
assertEquals(120f, hud.x, 0.5f)
|
||||
}
|
||||
|
||||
@Test fun aHudSnappedRightStopsAtTheRightPadding() {
|
||||
val hud = show("full", 1990f, 300f, padLeft = 0, padRight = 90)
|
||||
assertEquals(2000f - 90f, hud.x + hud.width, 0.5f)
|
||||
}
|
||||
|
||||
@Test fun withoutPaddingTheHudStillReachesTheScreenEdges() {
|
||||
assertEquals(0f, show("full", 0f, 300f, 0, 0).x, 0.5f)
|
||||
val strip = show("strip", 0f, 0f, 0, 0)
|
||||
assertEquals(0f, strip.x, 0.5f)
|
||||
assertEquals(2000, strip.width)
|
||||
}
|
||||
|
||||
@Test fun boundsAnchorBetweenThePaddedEdges() {
|
||||
val b = HudBounds(120f, 0f, 2000f, 1000f, 400f, 200f)
|
||||
assertEquals(1600f, b.maxX, 0f)
|
||||
assertEquals(800f, b.maxY, 0f)
|
||||
assertEquals(120f, b.anchoredX(0f), 0f)
|
||||
assertEquals(1600f, b.anchoredX(1f), 0f)
|
||||
assertEquals(0f, b.anchorFor(0f), 0f)
|
||||
assertEquals(0f, b.anchorFor(850f), 0f)
|
||||
assertEquals(1f, b.anchorFor(870f), 0f)
|
||||
}
|
||||
|
||||
@Test fun boundsNeverInvertWhenTheHudIsWiderThanTheArea() {
|
||||
val b = HudBounds(120f, 50f, 600f, 300f, 900f, 900f)
|
||||
assertEquals(120f, b.maxX, 0f)
|
||||
assertEquals(50f, b.maxY, 0f)
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,6 @@ Links of the form `droiddeck://settings/<section>` open a Settings section direc
|
||||
| Launcher orientation | Settings › Launcher (`droiddeck://settings/launcher`) | rotate, portrait |
|
||||
| Session orientation | Settings › Launcher (`droiddeck://settings/launcher`) | rotate, portrait |
|
||||
| Fullscreen | Settings › Launcher (`droiddeck://settings/launcher`) | |
|
||||
| Swipe between pages | Settings › Launcher (`droiddeck://settings/launcher`) | gesture |
|
||||
| Controller haptics | Settings › Launcher (`droiddeck://settings/launcher`) | vibration, rumble |
|
||||
| Dual screen launcher | Settings › Launcher (`droiddeck://settings/launcher`) | thor, second screen, bottom screen |
|
||||
| Warn when storage is low | Settings › Launcher (`droiddeck://settings/launcher`) | |
|
||||
|
||||
@@ -582,16 +582,6 @@ const char *udev_device_get_action(void *device) {
|
||||
return real_get(device);
|
||||
}
|
||||
|
||||
const char *udev_device_get_driver(void *device) {
|
||||
static const char *(*real_get)(void *);
|
||||
struct pad *pad = device_pad(device);
|
||||
|
||||
if (pad != NULL) return NULL;
|
||||
if (real_get == NULL) real_get = next_symbol("udev_device_get_driver");
|
||||
if (real_get == NULL) return NULL;
|
||||
return real_get(device);
|
||||
}
|
||||
|
||||
dev_t udev_device_get_devnum(void *device) {
|
||||
static dev_t (*real_get)(void *);
|
||||
struct pad *pad = device_pad(device);
|
||||
@@ -696,54 +686,6 @@ void *udev_device_get_sysattr_list_entry(void *device) {
|
||||
return real_get != NULL ? real_get(device) : NULL;
|
||||
}
|
||||
|
||||
void *udev_device_get_current_tags_list_entry(void *device) {
|
||||
static void *(*real_get)(void *);
|
||||
|
||||
if (device_pad(device) != NULL) return NULL;
|
||||
if (real_get == NULL) real_get = next_symbol("udev_device_get_current_tags_list_entry");
|
||||
return real_get != NULL ? real_get(device) : NULL;
|
||||
}
|
||||
|
||||
int udev_device_has_current_tag(void *device, const char *tag) {
|
||||
static int (*real_has)(void *, const char *);
|
||||
|
||||
if (device_pad(device) != NULL) return 0;
|
||||
if (real_has == NULL) real_has = next_symbol("udev_device_has_current_tag");
|
||||
return real_has != NULL ? real_has(device, tag) : 0;
|
||||
}
|
||||
|
||||
void *udev_device_get_devlinks_list_entry(void *device) {
|
||||
static void *(*real_get)(void *);
|
||||
|
||||
if (device_pad(device) != NULL) return NULL;
|
||||
if (real_get == NULL) real_get = next_symbol("udev_device_get_devlinks_list_entry");
|
||||
return real_get != NULL ? real_get(device) : NULL;
|
||||
}
|
||||
|
||||
unsigned long long udev_device_get_seqnum(void *device) {
|
||||
static unsigned long long (*real_get)(void *);
|
||||
|
||||
if (device_pad(device) != NULL) return 0;
|
||||
if (real_get == NULL) real_get = next_symbol("udev_device_get_seqnum");
|
||||
return real_get != NULL ? real_get(device) : 0;
|
||||
}
|
||||
|
||||
unsigned long long udev_device_get_usec_since_initialized(void *device) {
|
||||
static unsigned long long (*real_get)(void *);
|
||||
|
||||
if (device_pad(device) != NULL) return 0;
|
||||
if (real_get == NULL) real_get = next_symbol("udev_device_get_usec_since_initialized");
|
||||
return real_get != NULL ? real_get(device) : 0;
|
||||
}
|
||||
|
||||
int udev_device_set_sysattr_value(void *device, const char *sysattr, const char *value) {
|
||||
static int (*real_set)(void *, const char *, const char *);
|
||||
|
||||
if (device_pad(device) != NULL) return -EACCES;
|
||||
if (real_set == NULL) real_set = next_symbol("udev_device_set_sysattr_value");
|
||||
return real_set != NULL ? real_set(device, sysattr, value) : -ENOSYS;
|
||||
}
|
||||
|
||||
void *udev_device_new_from_devnum(void *udev, char type, dev_t devnum) {
|
||||
static void *(*real_new)(void *, char, dev_t);
|
||||
struct pad pad;
|
||||
@@ -1069,7 +1011,6 @@ static const struct udev_symbol udev_symbols[] = {
|
||||
{"udev_device_get_subsystem", (void *)udev_device_get_subsystem},
|
||||
{"udev_device_get_devtype", (void *)udev_device_get_devtype},
|
||||
{"udev_device_get_action", (void *)udev_device_get_action},
|
||||
{"udev_device_get_driver", (void *)udev_device_get_driver},
|
||||
{"udev_device_get_devnum", (void *)udev_device_get_devnum},
|
||||
{"udev_device_get_sysattr_value", (void *)udev_device_get_sysattr_value},
|
||||
{"udev_device_get_property_value", (void *)udev_device_get_property_value},
|
||||
@@ -1082,12 +1023,6 @@ static const struct udev_symbol udev_symbols[] = {
|
||||
{"udev_device_get_properties_list_entry", (void *)udev_device_get_properties_list_entry},
|
||||
{"udev_device_get_tags_list_entry", (void *)udev_device_get_tags_list_entry},
|
||||
{"udev_device_get_sysattr_list_entry", (void *)udev_device_get_sysattr_list_entry},
|
||||
{"udev_device_get_current_tags_list_entry", (void *)udev_device_get_current_tags_list_entry},
|
||||
{"udev_device_has_current_tag", (void *)udev_device_has_current_tag},
|
||||
{"udev_device_get_devlinks_list_entry", (void *)udev_device_get_devlinks_list_entry},
|
||||
{"udev_device_get_seqnum", (void *)udev_device_get_seqnum},
|
||||
{"udev_device_get_usec_since_initialized", (void *)udev_device_get_usec_since_initialized},
|
||||
{"udev_device_set_sysattr_value", (void *)udev_device_set_sysattr_value},
|
||||
{"udev_enumerate_new", (void *)udev_enumerate_new},
|
||||
{"udev_enumerate_ref", (void *)udev_enumerate_ref},
|
||||
{"udev_enumerate_unref", (void *)udev_enumerate_unref},
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
# Tracked binary provenance
|
||||
|
||||
This is an **exception inventory**, not evidence that every distributed binary is
|
||||
built from source. `prebuilt.json` hashes opaque, checked-in payloads and records
|
||||
their known upstream *project*, not a verified corresponding source revision.
|
||||
|
||||
Run `python3 tools/provenance/check.py` locally. CI runs the same gate after
|
||||
merging a PR onto `main`, before the component builds. Adding or modifying any
|
||||
tracked native executable, shared library, compressed runtime archive, model,
|
||||
or other detected binary requires an explicit allowlist change reviewed in the
|
||||
same PR. Changed paths, hashes, or unexpectedly removed files fail the job.
|
||||
|
||||
## Outstanding source-build work
|
||||
|
||||
1. **Wayland server**: two identical checked-in copies of
|
||||
`libwayland-server.so`; `waylandcomp/CMakeLists.txt` imports one prebuilt
|
||||
directly. Pin the matching Wayland source and Android-specific patch/toolchain
|
||||
inputs, build the library in CI, and stage a single resulting ELF to JNI.
|
||||
Check required symbols, SONAME, Android ABI, and compositor boot before
|
||||
removing the checked-in copies.
|
||||
2. **PulseAudio / libffi / libltdl / libsndfile**: the audio recipe downloads
|
||||
PulseAudio 13.0 *sources* to build extra sink modules, but the base
|
||||
`pulseaudio.tzst` and JNI libraries are already compiled. Add explicit
|
||||
source builds for the base runtime/dependencies and verify ABI + plugin
|
||||
linkage. Avoid changing the working audio bundle until an Android smoke
|
||||
test exercises playback and suspend/resume.
|
||||
3. **Innoextract / Boost**: the runtime asset task stages a checked-in AArch64
|
||||
executable and five Boost shared libraries. Build innoextract from a pinned
|
||||
upstream revision and cross-build matching dependencies, or remove the
|
||||
prebuilt tool if another source-built extraction path covers its use cases.
|
||||
4. **Turnip archives**: verify their exact Mesa commits, build toolchains and
|
||||
redistribution notices. Migrate to pinned, checked source builds or
|
||||
independently verified upstream artifacts with documented provenance.
|
||||
|
||||
The `source_revision` value `unverified` explicitly means we have **not**
|
||||
established which upstream source produced the checked-in bytes. A project
|
||||
homepage and SHA-256 hash do not establish reproducibility, correspondence
|
||||
to source, license compliance, or supply-chain safety. They make unresolved
|
||||
items visible and prevent silent binary additions.
|
||||
|
||||
This gate intentionally inventories build tooling and opaque data separately
|
||||
from executable runtime code. It does not scan binaries downloaded dynamically
|
||||
or produced during CI: those are governed by the existing component recipes,
|
||||
hash pins, artifact handoff, and release checks. The build's verified preload
|
||||
snapshots are likewise covered by `tools/components/preloads.py`, not by
|
||||
this tracked-file exception list.
|
||||
|
||||
To remove an exception, migrate the build to source and delete its tracked
|
||||
artifact and manifest entry in the same PR. To update one, show the exact
|
||||
upstream revision, source URL, license/notice, patch set, build command,
|
||||
toolchain and validation evidence in the PR; don't just refresh the hash.
|
||||
@@ -1,178 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Fail closed on unreviewed, checked-in binary components.
|
||||
|
||||
This is a tracked-binary inventory and checksum gate, NOT a source-build,
|
||||
reproducibility, or licensing attestation.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
REPO = Path(__file__).resolve().parents[2]
|
||||
MANIFEST = "tools/provenance/prebuilt.json"
|
||||
BINARY_SUFFIXES = {
|
||||
".so", ".a", ".o", ".dll", ".exe", ".jar", ".aar", ".apk",
|
||||
".tzst", ".zst", ".task", ".wasm", ".bin", ".zip", ".7z",
|
||||
}
|
||||
MAGICS = (
|
||||
b"\x7fELF", b"MZ", b"\x00asm", # ELF, PE, WebAssembly
|
||||
b"\xcf\xfa\xed\xfe", b"\xfe\xed\xfa\xcf", # Mach-O
|
||||
b"\xca\xfe\xba\xbe", b"\x28\xb5\x2f\xfd", # universal, zstd
|
||||
b"PK\x03\x04", b"\x1f\x8b", b"\xfd7zXZ", b"7z\xbc\xaf\x27\x1c", # compressed archives
|
||||
)
|
||||
SHA256_RE = re.compile(r"^[a-f0-9]{64}$")
|
||||
VALID_STATES = {"prebuilt-exception", "binary-data", "build-tool"}
|
||||
|
||||
|
||||
def tracked_paths(root: Path) -> list[str]:
|
||||
data = subprocess.check_output(
|
||||
["git", "ls-files", "--cached", "--stage", "-z"], cwd=root
|
||||
)
|
||||
paths = []
|
||||
for item in data.split(b"\0"):
|
||||
if not item:
|
||||
continue
|
||||
meta, path = item.split(b"\t", 1)
|
||||
# Gitlinks contain an object ID, not a file blob. They are checked
|
||||
# separately by the pinned submodule source/build process.
|
||||
if meta.split()[0] == b"160000":
|
||||
continue
|
||||
paths.append((os.fsdecode(path), meta.split()[0]))
|
||||
return sorted(paths)
|
||||
|
||||
|
||||
def is_binary_payload(relpath: str, prefix: bytes) -> bool:
|
||||
name = Path(relpath).name.lower()
|
||||
return (
|
||||
name.endswith(tuple(BINARY_SUFFIXES))
|
||||
or ".so." in name
|
||||
or any(prefix.startswith(magic) for magic in MAGICS)
|
||||
)
|
||||
|
||||
|
||||
def hash_content(rel: str, handle) -> str | None:
|
||||
prefix = handle.read(8)
|
||||
if not is_binary_payload(rel, prefix):
|
||||
return None
|
||||
digest = hashlib.sha256()
|
||||
digest.update(prefix)
|
||||
for chunk in iter(lambda: handle.read(1024 * 1024), b""):
|
||||
digest.update(chunk)
|
||||
return digest.hexdigest()
|
||||
|
||||
|
||||
def discover(root: Path) -> dict[str, str]:
|
||||
"""Hash tracked binary payloads, including paths omitted by sparse checkout.
|
||||
|
||||
Git's index still holds blob IDs for sparse entries, so read those entries
|
||||
from Git rather than silently skipping them. A missing blob fails the gate.
|
||||
"""
|
||||
result: dict[str, str] = {}
|
||||
for rel, mode in tracked_paths(root):
|
||||
file = root / rel
|
||||
# A Git symlink blob stores the link target string, not target bytes.
|
||||
# Always hash that blob to match sparse and full checkouts.
|
||||
if mode != b"120000" and file.is_file():
|
||||
with file.open("rb") as handle:
|
||||
digest = hash_content(rel, handle)
|
||||
else:
|
||||
# The source CI checkout deliberately omits docs/releases/media.
|
||||
# Read the index version so an ELF added there cannot evade the gate.
|
||||
with subprocess.Popen(
|
||||
["git", "show", f":{rel}"], cwd=root,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
|
||||
) as proc:
|
||||
assert proc.stdout is not None
|
||||
digest = hash_content(rel, proc.stdout)
|
||||
# Drain even non-binary files before checking the exit status.
|
||||
for _ in iter(lambda: proc.stdout.read(1024 * 1024), b""):
|
||||
pass
|
||||
error = proc.stderr.read() if proc.stderr else b""
|
||||
if proc.wait() != 0:
|
||||
raise RuntimeError(
|
||||
f"cannot read tracked Git blob for {rel}: {error.decode(errors='replace')}"
|
||||
)
|
||||
if digest is not None:
|
||||
result[rel] = digest
|
||||
return result
|
||||
|
||||
|
||||
def validate(root: Path, manifest: Path) -> list[str]:
|
||||
try:
|
||||
data = json.loads(manifest.read_text(encoding="utf-8"))
|
||||
if not isinstance(data, dict) or data.get("schema") != 1:
|
||||
return ["manifest must be a schema: 1 object"]
|
||||
records = data["artifacts"]
|
||||
if not isinstance(records, list):
|
||||
return ["artifacts must be a list"]
|
||||
except (OSError, ValueError, KeyError) as exc:
|
||||
return [f"invalid manifest: {exc}"]
|
||||
|
||||
errors: list[str] = []
|
||||
expected: dict[str, str] = {}
|
||||
for index, item in enumerate(records):
|
||||
if not isinstance(item, dict):
|
||||
errors.append(f"artifacts[{index}] must be an object")
|
||||
continue
|
||||
rel = item.get("path")
|
||||
if not isinstance(rel, str) or not rel or rel.startswith("/") or ".." in Path(rel).parts:
|
||||
errors.append(f"artifacts[{index}]: invalid repository-relative path")
|
||||
continue
|
||||
if rel in expected:
|
||||
errors.append(f"duplicate manifest entry: {rel}")
|
||||
digest = item.get("sha256")
|
||||
if not isinstance(digest, str) or not SHA256_RE.fullmatch(digest):
|
||||
errors.append(f"{rel}: invalid sha256")
|
||||
else:
|
||||
expected[rel] = digest
|
||||
if item.get("status") not in VALID_STATES:
|
||||
errors.append(f"{rel}: status must be one of {sorted(VALID_STATES)}")
|
||||
if not isinstance(item.get("origin"), str) or not item["origin"].strip():
|
||||
errors.append(f"{rel}: origin must describe the source project")
|
||||
if not isinstance(item.get("source_revision"), str) or not item["source_revision"].strip():
|
||||
errors.append(f"{rel}: source_revision required (use 'unverified' if unknown)")
|
||||
if not isinstance(item.get("note"), str) or len(item["note"].strip()) < 12:
|
||||
errors.append(f"{rel}: note must explain this exception")
|
||||
|
||||
found = discover(root)
|
||||
for rel in sorted(set(found) - set(expected)):
|
||||
errors.append(f"UNREVIEWED binary: {rel} (sha256 {found[rel]})")
|
||||
for rel in sorted(set(expected) - set(found)):
|
||||
errors.append(f"manifest lists missing/untracked binary: {rel}")
|
||||
for rel in sorted(set(found) & set(expected)):
|
||||
if found[rel] != expected[rel]:
|
||||
errors.append(f"CHANGED binary: {rel} (expected {expected[rel]}, got {found[rel]})")
|
||||
return errors
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--root", type=Path, default=REPO)
|
||||
parser.add_argument("--manifest", type=Path, default=None)
|
||||
parser.add_argument("--list", action="store_true", help="print discovered paths and hashes")
|
||||
args = parser.parse_args()
|
||||
root = args.root.resolve()
|
||||
if args.list:
|
||||
for rel, digest in discover(root).items():
|
||||
print(f"{digest} {rel}")
|
||||
return 0
|
||||
manifest = args.manifest or root / MANIFEST
|
||||
errors = validate(root, manifest)
|
||||
for error in errors:
|
||||
print(f"::error::{error}", file=sys.stderr)
|
||||
if errors:
|
||||
print(f"Prebuilt inventory failed: {len(errors)} problem(s)", file=sys.stderr)
|
||||
return 1
|
||||
print(f"Prebuilt inventory verified: {len(discover(root))} tracked binary payloads")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -1,206 +0,0 @@
|
||||
{
|
||||
"schema": 1,
|
||||
"description": "Checksums for tracked opaque binaries; an explicit exception list, not a source-build or license certification.",
|
||||
"artifacts": [
|
||||
{
|
||||
"path": "app/src/main/assets/desktop-removal/emulators-keep.txt.gzip",
|
||||
"sha256": "8ee6bb678884767ee597e829e1df6dda70c55a23e727c301d14e817ab9b18344",
|
||||
"status": "binary-data",
|
||||
"origin": "DroidDeck generated desktop-removal inventories",
|
||||
"source_revision": "repository asset",
|
||||
"note": "Gzip-compressed text inventory; not executable. Review the generator and inputs when regenerating."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/assets/desktop-removal/kde-keep.txt.gzip",
|
||||
"sha256": "103fcc4c5238190b71af8064838cf2710d76fa0f35c85bb1d05d082237084e21",
|
||||
"status": "binary-data",
|
||||
"origin": "DroidDeck generated desktop-removal inventories",
|
||||
"source_revision": "repository asset",
|
||||
"note": "Gzip-compressed text inventory; not executable. Review the generator and inputs when regenerating."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/assets/desktop-removal/kde-remove.tsv.gzip",
|
||||
"sha256": "a6f9bb05ba52402e85ebadabfb632f65b359f7cd9721d65e8560a35a1415eac3",
|
||||
"status": "binary-data",
|
||||
"origin": "DroidDeck generated desktop-removal inventories",
|
||||
"source_revision": "repository asset",
|
||||
"note": "Gzip-compressed text inventory; not executable. Review the generator and inputs when regenerating."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/assets/desktop-removal/lxqt-r1.tsv.gzip",
|
||||
"sha256": "c2cc0c0bf2e58cb8134ca933a65baa5dd450e01d68eb06a9d5b388cb4a9dd140",
|
||||
"status": "binary-data",
|
||||
"origin": "DroidDeck generated desktop-removal inventories",
|
||||
"source_revision": "repository asset",
|
||||
"note": "Gzip-compressed text inventory; not executable. Review the generator and inputs when regenerating."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/assets/graphics_driver/adrenotools-turnip-sdk36.tzst",
|
||||
"sha256": "da8a3e83ea61f11b8ccee274524de3c0ad8a45f3be8921e23e1f162d26279b93",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://gitlab.freedesktop.org/mesa/mesa",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in Turnip driver archive; per-archive source revision and build recipe need verification."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/assets/graphics_driver/adrenotools-turnip25.1.0.tzst",
|
||||
"sha256": "b3824227a3bcac367352bae86a34ed95add9b99fae50c16b7c7f48506d7ce197",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://gitlab.freedesktop.org/mesa/mesa",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in Turnip driver archive; per-archive source revision and build recipe need verification."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/assets/pulseaudio.tzst",
|
||||
"sha256": "4ec3ce78220007ccb36108fabeb395671fd25bfe1069fb05a719fef7d067c859",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/pulseaudio/pulseaudio",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in PulseAudio runtime archive; the CI audio recipe adds source-built sinks but reuses this base."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/cpp/waylandcomp/prebuilt/lib/libwayland-server.so",
|
||||
"sha256": "2daff7500b6acee55291567d786653ba75f5aecf5a5e648fce4c10fe6bc7a8ea",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://gitlab.freedesktop.org/wayland/wayland",
|
||||
"source_revision": "unverified",
|
||||
"note": "Wayland server prebuilt imported into Android CMake; exact source revision and build recipe unverified."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libffi.so",
|
||||
"sha256": "8855ba6dc12e9abf40729481a7a99aa391ac7b2e77bad4fbe0bb51cd66216c0e",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/libffi/libffi",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in native dependency; source-build wiring is missing from Android CI."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libltdl.so",
|
||||
"sha256": "14d616028b38a4b778576477c675c1ce34618582b84ccc5c3fd2492e6518196f",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://www.gnu.org/software/libtool/",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in libltdl; exact source revision and Android build command unverified."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libpulse.so",
|
||||
"sha256": "8ce9c5ba9710aee64c70356b051a8df4f88396075b0264048b992ab7c337f2e6",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/pulseaudio/pulseaudio",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in PulseAudio ARM64 library; source-build wiring is missing from Android CI."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libpulseaudio.so",
|
||||
"sha256": "a9256b038381b192593c019ba779e219419f71b2a66aa1c1e29a756314489ed7",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/pulseaudio/pulseaudio",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in PulseAudio ARM64 library; source-build wiring is missing from Android CI."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libpulsecommon-13.0.so",
|
||||
"sha256": "3ef683f23660898933a66fb032976e06905cbca8e01027aa1ce9891e1d854c2b",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/pulseaudio/pulseaudio",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in PulseAudio ARM64 library; source-build wiring is missing from Android CI."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libpulsecore-13.0.so",
|
||||
"sha256": "1305d78969858a7a60e030a75c383901148b980518fc2d337b9c028c968c3f95",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/pulseaudio/pulseaudio",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in PulseAudio ARM64 library; source-build wiring is missing from Android CI."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libsndfile.so",
|
||||
"sha256": "ab999a10cd3f6979580447169a19c1c9c121e0d8340b2bc810c54dc916bb3ee0",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/libsndfile/libsndfile",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in libsndfile; exact source revision and Android build command unverified."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/jniLibs/arm64-v8a/libwayland-server.so",
|
||||
"sha256": "2daff7500b6acee55291567d786653ba75f5aecf5a5e648fce4c10fe6bc7a8ea",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://gitlab.freedesktop.org/wayland/wayland",
|
||||
"source_revision": "unverified",
|
||||
"note": "Wayland server prebuilt imported into Android CMake; exact source revision and build recipe unverified."
|
||||
},
|
||||
{
|
||||
"path": "app/src/main/resources/rockstar/legacy-cipher.bin",
|
||||
"sha256": "43a5bf698bd546954b3bc6eee65a6aa63cb4bc0c98677344843602b9ea93a2ae",
|
||||
"status": "binary-data",
|
||||
"origin": "DroidDeck repository",
|
||||
"source_revision": "unverified",
|
||||
"note": "Opaque cipher resource data; not a native library or executable."
|
||||
},
|
||||
{
|
||||
"path": "gradle/wrapper/gradle-wrapper.jar",
|
||||
"sha256": "e996d452d2645e70c01c11143ca2d3742734a28da2bf61f25c82bdc288c9e637",
|
||||
"status": "build-tool",
|
||||
"origin": "https://github.com/gradle/gradle",
|
||||
"source_revision": "unverified",
|
||||
"note": "Gradle bootstrap tool; not packaged as DroidDeck runtime code."
|
||||
},
|
||||
{
|
||||
"path": "tools/linuxfs/innoextract/linuxfs/usr/local/lib/droiddeck-inno/innoextract",
|
||||
"sha256": "67bda7fc5fd54d20488f8d7ad349655b65eb911e068e3fd7e348e13e2aec1a40",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/dscharrer/innoextract",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in ARM64 innoextract executable, directly staged into the APK's runtime assets."
|
||||
},
|
||||
{
|
||||
"path": "tools/linuxfs/innoextract/linuxfs/usr/local/lib/droiddeck-inno/libboost_container.so.1.92.0",
|
||||
"sha256": "ed95491c8f1718354bfdb23b8c6fd52ebcf8f72b85ed26429f856376527e34d9",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/boostorg/boost",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in Boost 1.92 runtime dependency of innoextract; not rebuilt by CI."
|
||||
},
|
||||
{
|
||||
"path": "tools/linuxfs/innoextract/linuxfs/usr/local/lib/droiddeck-inno/libboost_filesystem.so.1.92.0",
|
||||
"sha256": "eafdc0eb4f5470ad19f9bc09a0a2def56615dadc0684c6e173cfe82a0b510a5f",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/boostorg/boost",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in Boost 1.92 runtime dependency of innoextract; not rebuilt by CI."
|
||||
},
|
||||
{
|
||||
"path": "tools/linuxfs/innoextract/linuxfs/usr/local/lib/droiddeck-inno/libboost_iostreams.so.1.92.0",
|
||||
"sha256": "fa222fc97b48fe5360da9cdd3fb11b78a41083161da8b7052a5f88d3bb2a1804",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/boostorg/boost",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in Boost 1.92 runtime dependency of innoextract; not rebuilt by CI."
|
||||
},
|
||||
{
|
||||
"path": "tools/linuxfs/innoextract/linuxfs/usr/local/lib/droiddeck-inno/libboost_program_options.so.1.92.0",
|
||||
"sha256": "ded51b938d6ec5b979633b8d9f771478c2ea6390eee81cb7131b54cb969415a0",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/boostorg/boost",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in Boost 1.92 runtime dependency of innoextract; not rebuilt by CI."
|
||||
},
|
||||
{
|
||||
"path": "tools/linuxfs/innoextract/linuxfs/usr/local/lib/droiddeck-inno/libboost_random.so.1.92.0",
|
||||
"sha256": "c6db8078fa8d6bb287e4f987afef642290e7b69d22c59dea883c444edff80500",
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://github.com/boostorg/boost",
|
||||
"source_revision": "unverified",
|
||||
"note": "Checked-in Boost 1.92 runtime dependency of innoextract; not rebuilt by CI."
|
||||
},
|
||||
{
|
||||
"path": "tools/packs/tracking/hand_landmarker_lite.task",
|
||||
"sha256": "173c0f47ecee7e935bd4a1e93aa580756b4180c1307c07d709313e82c28672c8",
|
||||
"status": "binary-data",
|
||||
"origin": "https://ai.google.dev/edge/mediapipe",
|
||||
"source_revision": "unverified",
|
||||
"note": "Model data; see tools/packs/tracking provenance, not an executable."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
from pathlib import Path
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -182,48 +181,20 @@ void *udev_device_new_from_subsystem_sysname(void *udev, const char *subsystem,
|
||||
(void)udev; (void)subsystem; (void)sysname;
|
||||
return NULL;
|
||||
}
|
||||
int real_device_calls;
|
||||
void *udev_device_unref(void *device) { (void)device; real_device_calls++; return NULL; }
|
||||
void *udev_device_ref(void *device) { (void)device; real_device_calls++; return NULL; }
|
||||
void *udev_device_get_parent(void *device) { (void)device; real_device_calls++; return NULL; }
|
||||
void *udev_device_get_udev(void *device) { (void)device; real_device_calls++; return NULL; }
|
||||
const char *udev_device_get_syspath(void *device) { (void)device; real_device_calls++; return "real"; }
|
||||
const char *udev_device_get_sysnum(void *device) { (void)device; real_device_calls++; return "real"; }
|
||||
void *udev_device_new_from_devnum(void *udev, char type, unsigned long devnum) {
|
||||
(void)udev; (void)type; (void)devnum;
|
||||
return NULL;
|
||||
}
|
||||
void *udev_device_unref(void *device) { (void)device; return NULL; }
|
||||
void *udev_device_ref(void *device) { (void)device; return NULL; }
|
||||
void *udev_device_get_parent(void *device) { (void)device; return NULL; }
|
||||
void *udev_device_get_udev(void *device) { (void)device; return NULL; }
|
||||
const char *udev_device_get_syspath(void *device) { (void)device; return "real"; }
|
||||
const char *udev_device_get_sysnum(void *device) { (void)device; return "real"; }
|
||||
"""
|
||||
|
||||
DEVICE_FUNCTIONS = (
|
||||
"p:udev_device_ref", "p:udev_device_get_udev", "p:udev_device_get_parent",
|
||||
"P:udev_device_get_parent_with_subsystem_devtype", "s:udev_device_get_devpath", "s:udev_device_get_subsystem",
|
||||
"s:udev_device_get_devtype", "s:udev_device_get_syspath", "s:udev_device_get_sysname",
|
||||
"s:udev_device_get_sysnum", "s:udev_device_get_devnode", "i:udev_device_get_is_initialized",
|
||||
"p:udev_device_get_devlinks_list_entry", "p:udev_device_get_properties_list_entry",
|
||||
"p:udev_device_get_tags_list_entry", "p:udev_device_get_current_tags_list_entry",
|
||||
"p:udev_device_get_sysattr_list_entry", "S:udev_device_get_property_value", "s:udev_device_get_driver",
|
||||
"d:udev_device_get_devnum", "s:udev_device_get_action", "u:udev_device_get_seqnum",
|
||||
"u:udev_device_get_usec_since_initialized", "S:udev_device_get_sysattr_value",
|
||||
"W:udev_device_set_sysattr_value", "I:udev_device_has_tag", "I:udev_device_has_current_tag",
|
||||
"p:udev_device_unref",
|
||||
)
|
||||
SIGNATURES = {
|
||||
"p": ("void *", ""), "s": ("const char *", ""), "i": ("int", ""), "d": ("dev_t", ""),
|
||||
"u": ("unsigned long long", ""), "S": ("const char *", ", const char *a"), "I": ("int", ", const char *a"),
|
||||
"P": ("void *", ", const char *a, const char *b"), "W": ("int", ", const char *a, const char *b"),
|
||||
}
|
||||
UDEV += "#include <sys/types.h>\n" + "".join(
|
||||
f"{SIGNATURES[kind][0]} {name}(void *device{SIGNATURES[kind][1]}) {{ (void)device; real_device_calls++; return 0; }}\n"
|
||||
for kind, _, name in (entry.partition(":") for entry in DEVICE_FUNCTIONS) if not re.search(rf"\b{name}\(", UDEV))
|
||||
|
||||
PROGRAM = r"""
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define PAD "/sys/devices/virtual/input/droiddeck0"
|
||||
@@ -429,37 +400,6 @@ static void run_enumerate(void) {
|
||||
printf("nothing added scan %d\n", scan(other));
|
||||
}
|
||||
|
||||
static void run_every(int count, char **entries) {
|
||||
void *(*from_devnum)(void *, char, dev_t) = sym("udev_device_new_from_devnum");
|
||||
int *real_calls = dlsym(lib, "real_device_calls");
|
||||
int udev;
|
||||
void *pad = from_devnum(&udev, 'c', makedev(13, 64));
|
||||
int i;
|
||||
|
||||
for (i = 0; pad != NULL && i < count; i++) {
|
||||
const char *name = entries[i] + 2;
|
||||
void *call = sym(name);
|
||||
|
||||
if (call == NULL) {
|
||||
printf("missing %s\n", name);
|
||||
continue;
|
||||
}
|
||||
switch (entries[i][0]) {
|
||||
case 'p': ((void *(*)(void *))call)(pad); break;
|
||||
case 's': ((const char *(*)(void *))call)(pad); break;
|
||||
case 'i': ((int (*)(void *))call)(pad); break;
|
||||
case 'd': ((dev_t (*)(void *))call)(pad); break;
|
||||
case 'u': ((unsigned long long (*)(void *))call)(pad); break;
|
||||
case 'S': ((const char *(*)(void *, const char *))call)(pad, "attr"); break;
|
||||
case 'I': ((int (*)(void *, const char *))call)(pad, "attr"); break;
|
||||
case 'P': ((void *(*)(void *, const char *, const char *))call)(pad, "input", NULL); break;
|
||||
case 'W': ((int (*)(void *, const char *, const char *))call)(pad, "attr", "value"); break;
|
||||
default: printf("unknown signature %s\n", entries[i]);
|
||||
}
|
||||
}
|
||||
printf("pad %d real calls %d\n", pad != NULL, real_calls != NULL ? *real_calls : -1);
|
||||
}
|
||||
|
||||
static void run_probe(void) {
|
||||
int udev;
|
||||
|
||||
@@ -507,7 +447,6 @@ int main(int argc, char **argv) {
|
||||
name = sym("udev_list_entry_get_name");
|
||||
value = sym("udev_list_entry_get_value");
|
||||
if (strcmp(argv[1], "probe") == 0) run_probe();
|
||||
else if (strcmp(argv[1], "every") == 0) run_every(argc - 3, argv + 3);
|
||||
else if (strcmp(argv[1], "stable") == 0) run_stable();
|
||||
else if (strcmp(argv[1], "enumerate") == 0) run_enumerate();
|
||||
else run_udev();
|
||||
@@ -563,11 +502,11 @@ class InputUdevPreloadTest(unittest.TestCase):
|
||||
(pads / node).write_text("")
|
||||
return pads
|
||||
|
||||
def run_program(self, mode, *preloads, pads=None, slots="0=/pad", program=None, args=()):
|
||||
def run_program(self, mode, *preloads, pads=None, slots="0=/pad", program=None):
|
||||
env = dict(os.environ, LD_PRELOAD=":".join(str(self.dir / name) for name in ("libddsession.so", *preloads)),
|
||||
FAKE_EVDEV_MEMFD_PATHS=slots, FAKE_EVDEV_DIR=str(pads or self.pads))
|
||||
env.pop("FAKE_EVDEV_UINPUT", None)
|
||||
result = subprocess.run([str(program or self.program), mode, str(self.udev), *args], env=env, capture_output=True, text=True,
|
||||
result = subprocess.run([str(program or self.program), mode, str(self.udev)], env=env, capture_output=True, text=True,
|
||||
timeout=20)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
return result.stdout.splitlines()
|
||||
@@ -615,9 +554,6 @@ class InputUdevPreloadTest(unittest.TestCase):
|
||||
"contexts 1 1",
|
||||
])
|
||||
|
||||
def test_no_device_call_on_a_pad_reaches_the_real_libudev(self):
|
||||
self.assertEqual(self.run_program("every", args=DEVICE_FUNCTIONS), ["pad 1 real calls 0"])
|
||||
|
||||
def test_a_handle_keeps_its_strings_after_the_pad_goes_away(self):
|
||||
self.assertEqual(self.run_program("stable", pads=self.pad_dir("stable", "event0")), [
|
||||
"gone 1",
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
"""Regression tests for the checked-in binary allowlist and hash gate."""
|
||||
import importlib.util
|
||||
import json
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
SOURCE = Path(__file__).resolve().parents[1] / "provenance" / "check.py"
|
||||
spec = importlib.util.spec_from_file_location("prebuilt_check", SOURCE)
|
||||
check = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(check)
|
||||
|
||||
|
||||
class PrebuiltInventoryTest(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.tmp = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(self.tmp.cleanup)
|
||||
self.root = Path(self.tmp.name)
|
||||
subprocess.run(["git", "init", "-q"], cwd=self.root, check=True)
|
||||
(self.root / "note.txt").write_text("not binary", encoding="utf-8")
|
||||
self.binary = self.root / "vendor.so"
|
||||
self.binary.write_bytes(b"\x7fELF\x00example")
|
||||
subprocess.run(["git", "add", "."], cwd=self.root, check=True)
|
||||
sha = check.discover(self.root)["vendor.so"]
|
||||
self.record = {
|
||||
"path": "vendor.so",
|
||||
"sha256": sha,
|
||||
"status": "prebuilt-exception",
|
||||
"origin": "https://example.org/source",
|
||||
"source_revision": "unverified",
|
||||
"note": "An existing vendor binary awaiting source build.",
|
||||
}
|
||||
self.manifest = self.root / "prebuilt.json"
|
||||
self.write_manifest([self.record])
|
||||
|
||||
def write_manifest(self, entries):
|
||||
self.manifest.write_text(
|
||||
json.dumps({"schema": 1, "artifacts": entries}), encoding="utf-8"
|
||||
)
|
||||
|
||||
def test_known_binary_passes(self):
|
||||
self.assertEqual(check.validate(self.root, self.manifest), [])
|
||||
|
||||
def test_added_binary_is_rejected(self):
|
||||
(self.root / "new.exe").write_bytes(b"MZadditional")
|
||||
subprocess.run(["git", "add", "new.exe"], cwd=self.root, check=True)
|
||||
self.assertTrue(any("UNREVIEWED binary" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_changed_hash_is_rejected(self):
|
||||
self.binary.write_bytes(b"\x7fELF\x00tampered")
|
||||
self.assertTrue(any("CHANGED binary" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_disguised_extensionless_elf_is_detected(self):
|
||||
(self.root / "ordinary").write_bytes(b"\x7fELF\x00hidden")
|
||||
subprocess.run(["git", "add", "ordinary"], cwd=self.root, check=True)
|
||||
self.assertTrue(any("ordinary" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_compressed_archive_is_detected(self):
|
||||
(self.root / "payload.dat").write_bytes(b"\x1f\x8b\x08\x00compressed")
|
||||
subprocess.run(["git", "add", "payload.dat"], cwd=self.root, check=True)
|
||||
self.assertTrue(any("payload.dat" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_untracked_file_is_ignored(self):
|
||||
(self.root / "untracked.so").write_bytes(b"\x7fELF\x00local")
|
||||
self.assertEqual(check.validate(self.root, self.manifest), [])
|
||||
|
||||
def test_sparse_missing_binary_is_checked_from_git(self):
|
||||
self.binary.unlink()
|
||||
self.assertEqual(check.validate(self.root, self.manifest), [])
|
||||
|
||||
def test_sparse_unlisted_binary_is_rejected(self):
|
||||
hidden = self.root / "docs" / "releases" / "media" / "payload.exe"
|
||||
hidden.parent.mkdir(parents=True)
|
||||
hidden.write_bytes(b"MZhidden")
|
||||
subprocess.run(["git", "add", "docs/releases/media/payload.exe"], cwd=self.root, check=True)
|
||||
hidden.unlink() # Mimics a sparse-checkout file missing on disk.
|
||||
self.assertTrue(any("UNREVIEWED binary" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_symlink_hash_is_identical_in_full_and_sparse_checkout(self):
|
||||
alias = self.root / "alias.so"
|
||||
alias.symlink_to("vendor.so")
|
||||
subprocess.run(["git", "add", "alias.so"], cwd=self.root, check=True)
|
||||
full = check.discover(self.root)
|
||||
self.assertEqual(full["alias.so"], __import__("hashlib").sha256(b"vendor.so").hexdigest())
|
||||
alias.unlink()
|
||||
sparse = check.discover(self.root)
|
||||
self.assertEqual(full, sparse)
|
||||
|
||||
def test_unlisted_symlink_is_rejected(self):
|
||||
alias = self.root / "alias.so"
|
||||
alias.symlink_to("vendor.so")
|
||||
subprocess.run(["git", "add", "alias.so"], cwd=self.root, check=True)
|
||||
self.assertTrue(any("UNREVIEWED binary: alias.so" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_removed_index_entry_is_rejected(self):
|
||||
subprocess.run(["git", "rm", "--cached", "vendor.so"], cwd=self.root, check=True, stdout=subprocess.DEVNULL)
|
||||
self.assertTrue(any("missing/untracked" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_duplicate_manifest_entry_is_rejected(self):
|
||||
self.write_manifest([self.record, self.record])
|
||||
self.assertTrue(any("duplicate manifest" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
def test_missing_provenance_is_rejected(self):
|
||||
self.write_manifest([{**self.record, "source_revision": ""}])
|
||||
self.assertTrue(any("source_revision required" in x for x in check.validate(self.root, self.manifest)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user