mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 13:55:58 +00:00
Prepare isolated Play bundle builds and distribution safeguards
This commit is contained in:
1 parent
773d37ff21
commit
2f6e43e3d1
102 files changed
+3070
-182
No files matched your search
@@ -16,6 +16,7 @@ class App : Application() {
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
com.droiddeck.launcher.core.ComponentDownloads.init(this)
|
||||
com.droiddeck.launcher.ui.Themes.loadGradient(this)
|
||||
com.droiddeck.launcher.ui.BuildWatermark.install(this)
|
||||
HomeApp.trackRecents(this)
|
||||
|
||||
@@ -119,6 +119,7 @@ class FrontEndActivity : ComponentActivity() {
|
||||
private var frameGenLabel by mutableStateOf("")
|
||||
private var lossless by mutableStateOf(Lossless.State.NONE)
|
||||
private var showRemove by mutableStateOf(false)
|
||||
private var showAccessibilityConsent by mutableStateOf(false)
|
||||
private var showRuntimeActions by mutableStateOf<LinuxRuntimeInstaller.Release?>(null)
|
||||
private var pendingSwitch by mutableStateOf<Intent?>(null)
|
||||
private var switchingTo: Intent? = null
|
||||
@@ -323,6 +324,10 @@ class FrontEndActivity : ComponentActivity() {
|
||||
manageHomeApp()
|
||||
}
|
||||
SteamIntegration.Feature.SHORTCUTS -> {
|
||||
if (!SteamIntegration.accessibilityConsented(this)) {
|
||||
showAccessibilityConsent = true
|
||||
return
|
||||
}
|
||||
if (!integrationState.shortcuts) shortcutsTried = true
|
||||
if (!HomeApp.isDefault(this)) configureIntegration(SteamIntegration.Feature.HOME)
|
||||
else {
|
||||
@@ -1452,6 +1457,17 @@ class FrontEndActivity : ComponentActivity() {
|
||||
page = page,
|
||||
)
|
||||
}
|
||||
if (showAccessibilityConsent) ConfirmDialog(
|
||||
title = androidx.compose.ui.res.stringResource(R.string.integration_shortcuts),
|
||||
text = androidx.compose.ui.res.stringResource(R.string.integration_shortcuts_service_description),
|
||||
confirm = androidx.compose.ui.res.stringResource(R.string.glasses_allow),
|
||||
onConfirm = {
|
||||
SteamIntegration.acceptAccessibility(this@FrontEndActivity)
|
||||
integrationState = readIntegration()
|
||||
configureIntegration(SteamIntegration.Feature.SHORTCUTS)
|
||||
},
|
||||
onDismiss = { showAccessibilityConsent = false },
|
||||
)
|
||||
if (showRoms) RomsDialog(
|
||||
path = romsDir,
|
||||
onChoose = {
|
||||
|
||||
@@ -1939,7 +1939,13 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
SessionEvents.transition(SessionPhase.INSTALLING_RUNTIME, "proton.installing", mapOf("component" to "proton"))
|
||||
val protonProblem = installProton()
|
||||
if (protonProblem == null) SessionEvents.record("proton.ready")
|
||||
else SessionEvents.record("proton.skipped", mapOf("reason" to protonProblem))
|
||||
else {
|
||||
SessionEvents.record("proton.skipped", mapOf("reason" to protonProblem))
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) {
|
||||
problem = protonProblem
|
||||
failedComponent = "proton"
|
||||
}
|
||||
}
|
||||
}
|
||||
uiHandler.post {
|
||||
localInstalling = false
|
||||
@@ -1958,6 +1964,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
val code = when (failedComponent) {
|
||||
"runtime" -> "RUNTIME_INSTALL_FAILED"
|
||||
"package" -> "PACKAGE_RESUME_FAILED"
|
||||
"proton" -> "PROTON_INSTALL_FAILED"
|
||||
else -> "DESKTOP_INSTALL_FAILED"
|
||||
}
|
||||
SessionEvents.fail(code, problem)
|
||||
@@ -2043,6 +2050,21 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
val cancellation = com.droiddeck.launcher.core.Downloader.Cancellation { SessionState.stopRequested }
|
||||
SessionState.installCancellation = cancellation
|
||||
return try {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) {
|
||||
var last = "" to Int.MIN_VALUE
|
||||
return com.droiddeck.launcher.session.ProtonExtras.install(
|
||||
this, com.droiddeck.launcher.session.ProtonExtras.tools.single(), cancellation,
|
||||
) { message, percent ->
|
||||
val next = message to percent
|
||||
if (next != last) {
|
||||
last = next
|
||||
uiHandler.post {
|
||||
loading.percent = percent
|
||||
loading.say(message, PROTON_LINES.topic, readable = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
val entry = catalog.fetch(catalog.STEAM_SEED_URL, cancellation)?.firstOrNull { it.id == catalog.PROTON_SEED_ID }
|
||||
?: return if (cancellation.asBoolean) "cancelled" else "catalog unreachable"
|
||||
catalog.install(this, entry, cancellation, progressFor(PROTON_LINES, entry.size / 1_000_000))
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.content.IntentFilter
|
||||
import android.content.pm.PackageInstaller
|
||||
import android.os.Build
|
||||
import android.os.Handler
|
||||
import android.net.Uri
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@@ -17,8 +18,12 @@ import com.droiddeck.launcher.ui.UpdatesActions
|
||||
import com.droiddeck.launcher.ui.UpdatesState
|
||||
import com.droiddeck.launcher.update.AppUpdates
|
||||
import com.droiddeck.launcher.update.SelfInstaller
|
||||
import com.google.android.play.core.appupdate.AppUpdateManager
|
||||
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
|
||||
import com.google.android.play.core.install.model.UpdateAvailability
|
||||
|
||||
internal class UpdatesMenu(private val activity: Activity, private val ui: Handler) {
|
||||
internal class UpdatesMenu(private val activity: Activity, private val ui: Handler,
|
||||
private val playManager: () -> AppUpdateManager = { AppUpdateManagerFactory.create(activity) }) {
|
||||
var catalog by mutableStateOf<AppUpdates.Catalog?>(null)
|
||||
var follow by mutableStateOf(AppUpdates.Follow(AppUpdates.Channel.STABLE))
|
||||
var checking by mutableStateOf(false)
|
||||
@@ -26,12 +31,15 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
var stage by mutableStateOf<String?>(null)
|
||||
var percent by mutableIntStateOf(-1)
|
||||
var askPermission by mutableStateOf(false)
|
||||
var playUpdateAvailable by mutableStateOf<Boolean?>(null)
|
||||
private var playCheckedAt by mutableStateOf(0L)
|
||||
private var pending: AppUpdates.Release? = null
|
||||
private var lastCheck = 0L
|
||||
private var request = 0
|
||||
@Volatile private var session = -1
|
||||
|
||||
fun state() = UpdatesState(catalog, follow, checking, error, stage, percent, askPermission)
|
||||
fun state() = UpdatesState(catalog, follow, checking, error, stage, percent, askPermission,
|
||||
playUpdateAvailable, playCheckedAt)
|
||||
|
||||
fun actions() = UpdatesActions(
|
||||
onCheck = { check(force = true) },
|
||||
@@ -39,15 +47,22 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
onInstall = ::install,
|
||||
onAllowInstalls = {
|
||||
askPermission = false
|
||||
runCatching { activity.startActivity(SelfInstaller.permissionIntent(activity)) }
|
||||
.onFailure { error = activity.getString(R.string.upd_unknown_apps_failed); pending = null }
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) {
|
||||
runCatching { activity.startActivity(SelfInstaller.permissionIntent(activity)) }
|
||||
.onFailure { error = activity.getString(R.string.upd_unknown_apps_failed); pending = null }
|
||||
}
|
||||
},
|
||||
onDismissPermission = { askPermission = false; pending = null },
|
||||
onOpenPlay = ::openPlay,
|
||||
)
|
||||
|
||||
val hasUpdate: Boolean get() = AppUpdates.hasUpdate(catalog, follow)
|
||||
val hasUpdate: Boolean get() = if (BuildConfig.PLAY_DISTRIBUTION) playUpdateAvailable == true else AppUpdates.hasUpdate(catalog, follow)
|
||||
|
||||
fun onResume() {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) {
|
||||
if (!SessionState.running) check(force = false)
|
||||
return
|
||||
}
|
||||
pending?.let { r ->
|
||||
if (SelfInstaller.canInstall(activity)) { pending = null; install(r) }
|
||||
}
|
||||
@@ -55,6 +70,10 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
}
|
||||
|
||||
fun check(force: Boolean) {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) {
|
||||
checkPlay(force)
|
||||
return
|
||||
}
|
||||
if (checking || stage != null) return
|
||||
val now = System.currentTimeMillis()
|
||||
if (!force && now - lastCheck < 60_000) return
|
||||
@@ -75,6 +94,45 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
}, "app-updates").start()
|
||||
}
|
||||
|
||||
private fun checkPlay(force: Boolean) {
|
||||
if (checking) return
|
||||
val now = System.currentTimeMillis()
|
||||
if (!force && now - lastCheck < 60_000) return
|
||||
lastCheck = now
|
||||
checking = true
|
||||
error = null
|
||||
val id = ++request
|
||||
fun failed(failure: Throwable) {
|
||||
if (id != request || activity.isDestroyed) return
|
||||
checking = false
|
||||
if (force) error = activity.getString(R.string.upd_couldnt_check, failure.message ?: failure.javaClass.simpleName)
|
||||
}
|
||||
runCatching {
|
||||
playManager().appUpdateInfo.addOnSuccessListener { info ->
|
||||
if (id != request || activity.isDestroyed) return@addOnSuccessListener
|
||||
checking = false
|
||||
val availability = info.updateAvailability()
|
||||
playUpdateAvailable = when (availability) {
|
||||
UpdateAvailability.UPDATE_AVAILABLE, UpdateAvailability.DEVELOPER_TRIGGERED_UPDATE_IN_PROGRESS -> true
|
||||
UpdateAvailability.UPDATE_NOT_AVAILABLE -> false
|
||||
else -> null
|
||||
}
|
||||
playCheckedAt = now
|
||||
}.addOnFailureListener { failed(it) }
|
||||
}.onFailure { failed(it) }
|
||||
}
|
||||
|
||||
private fun openPlay() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
val listing = Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=${activity.packageName}"))
|
||||
.setPackage("com.android.vending")
|
||||
runCatching { activity.startActivity(listing) }.onFailure {
|
||||
runCatching {
|
||||
activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=${activity.packageName}")))
|
||||
}.onFailure { error = activity.getString(R.string.upd_couldnt_check, it.message ?: it.javaClass.simpleName) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun choose(f: AppUpdates.Follow) {
|
||||
AppUpdates.setFollow(activity, f)
|
||||
follow = f
|
||||
@@ -82,6 +140,7 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
}
|
||||
|
||||
private fun install(r: AppUpdates.Release) {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) { openPlay(); return }
|
||||
if (stage != null) return
|
||||
val apk = r.apk ?: run { error = activity.getString(R.string.upd_no_download); return }
|
||||
AppUpdates.installBlock(r)?.let { error = it.message(activity); return }
|
||||
@@ -124,6 +183,7 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
|
||||
@android.annotation.SuppressLint("UnspecifiedRegisterReceiverFlag")
|
||||
fun start() {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) return
|
||||
catalog = AppUpdates.cached(activity)
|
||||
follow = AppUpdates.follow(activity, catalog)
|
||||
val filter = IntentFilter(SelfInstaller.ACTION_STATUS)
|
||||
@@ -132,6 +192,8 @@ internal class UpdatesMenu(private val activity: Activity, private val ui: Handl
|
||||
}
|
||||
|
||||
fun unregister() {
|
||||
request++
|
||||
checking = false
|
||||
runCatching { activity.unregisterReceiver(receiver) }
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.droiddeck.launcher.core.FileUtils;
|
||||
import com.droiddeck.launcher.core.SessionPart;
|
||||
import com.droiddeck.launcher.core.HostProcess;
|
||||
import com.droiddeck.launcher.core.TarZst;
|
||||
import com.droiddeck.launcher.BuildConfig;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
@@ -114,6 +115,7 @@ public class PulseAudioComponent extends SessionPart {
|
||||
env.add("TMPDIR=" + workingDir);
|
||||
|
||||
String command = HostProcess.LINKER + " " + workingDir.getAbsolutePath() + "/libpulseaudio.so"
|
||||
+ (BuildConfig.PLAY_DISTRIBUTION ? " --dl-search-path=" + modules.getAbsolutePath() : "")
|
||||
+ " --system=false --disable-shm=true --fail=false"
|
||||
+ " -n --file=default.pa --daemonize=false --use-pid-file=false --exit-idle-time=-1"
|
||||
+ " --log-level=info";
|
||||
|
||||
@@ -95,8 +95,8 @@ internal class AddonPack(
|
||||
}
|
||||
val root = root(context).apply { mkdirs() }
|
||||
val archive = File(root, "$sha256.tar.zst")
|
||||
val downloaded = bundled(context, archive) || urls.any { url ->
|
||||
Downloader.downloadFile(url, archive, true, sha256) { p -> mutableState.value = State.Downloading(p.coerceIn(0f, 1f)) }
|
||||
val downloaded = bundled(context, archive) || !BuildConfig.PLAY_DISTRIBUTION && urls.any { url ->
|
||||
ComponentDownloads.downloadFile(url, archive, true, sha256) { p -> mutableState.value = State.Downloading(p.coerceIn(0f, 1f)) }
|
||||
.also { if (!it) archive.delete() }
|
||||
}
|
||||
if (!downloaded) return false
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.droiddeck.launcher.core;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import com.droiddeck.launcher.BuildConfig;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.function.BooleanSupplier;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public final class ComponentDownloads {
|
||||
private static volatile ComponentPayloadStore store;
|
||||
|
||||
private ComponentDownloads() {}
|
||||
|
||||
public static void init(Context context) {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) {
|
||||
Context application = context.getApplicationContext();
|
||||
store = new ComponentPayloadStore(path -> {
|
||||
try {
|
||||
return application.getAssets().open(path);
|
||||
} catch (IOException error) {
|
||||
throw new java.io.UncheckedIOException(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static ComponentPayloadStore bundled() throws IOException {
|
||||
ComponentPayloadStore current = store;
|
||||
if (current == null) throw new IOException("Bundled component delivery is unavailable");
|
||||
return current;
|
||||
}
|
||||
|
||||
public static String catalogName(String name) {
|
||||
return BuildConfig.PLAY_DISTRIBUTION ? "play-" + BuildConfig.SOURCE_COMMIT + "-" + name : name;
|
||||
}
|
||||
|
||||
public static String downloadString(String url) {
|
||||
return downloadString(url, null);
|
||||
}
|
||||
|
||||
public static String downloadString(String url, BooleanSupplier cancelled) {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return Downloader.downloadString(url, cancelled);
|
||||
try {
|
||||
return bundled().read(url, cancelled);
|
||||
} catch (Exception error) {
|
||||
Log.w("ComponentDownloads", "Bundled catalog unavailable: " + url, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String downloadDirect(String url) {
|
||||
return BuildConfig.PLAY_DISTRIBUTION ? downloadString(url) : Downloader.downloadDirect(url);
|
||||
}
|
||||
|
||||
public static long copyBundled(String url, OutputStream output, long limit, Consumer<Float> progress) throws IOException {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) throw new IOException("Bundled delivery requires a Play distribution");
|
||||
try {
|
||||
return bundled().copy(url, output, limit, null, null, progress);
|
||||
} catch (java.io.UncheckedIOException error) {
|
||||
throw error.getCause();
|
||||
} catch (Exception error) {
|
||||
if (error instanceof IOException) throw (IOException) error;
|
||||
throw new IOException("Invalid bundled component index", error);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean downloadFile(String url, File destination, boolean resume, Consumer<Float> progress) {
|
||||
return downloadFile(url, destination, resume, null, null, progress);
|
||||
}
|
||||
|
||||
public static boolean downloadFile(String url, File destination, boolean resume, String expectedSha256, Consumer<Float> progress) {
|
||||
return downloadFile(url, destination, resume, expectedSha256, null, progress);
|
||||
}
|
||||
|
||||
public static boolean downloadFile(String url, File destination, boolean resume, String expectedSha256,
|
||||
BooleanSupplier cancelled, Consumer<Float> progress) {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) {
|
||||
return Downloader.downloadFile(url, destination, resume, expectedSha256, cancelled, progress);
|
||||
}
|
||||
try {
|
||||
bundled().install(url, destination, expectedSha256, cancelled, progress);
|
||||
return true;
|
||||
} catch (Exception error) {
|
||||
Log.w("ComponentDownloads", "Bundled component unavailable: " + url, error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import org.json.JSONObject
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.StandardCopyOption
|
||||
import java.security.MessageDigest
|
||||
import java.util.function.BooleanSupplier
|
||||
import java.util.function.Consumer
|
||||
|
||||
internal class ComponentPayloadStore(private val assets: (String) -> InputStream) {
|
||||
private val entries by lazy {
|
||||
val index = readObject("play-components/index.json", 2 * 1024 * 1024)
|
||||
if (index.getInt("schema") != 1) throw IOException("Unsupported component index")
|
||||
index.getJSONObject("entries")
|
||||
}
|
||||
|
||||
private fun readObject(path: String, limit: Int = INDEX_LIMIT): JSONObject {
|
||||
val bytes = assets(path).use { input ->
|
||||
val output = ByteArrayOutputStream()
|
||||
val buffer = ByteArray(65536)
|
||||
while (true) {
|
||||
val count = input.read(buffer)
|
||||
if (count < 0) break
|
||||
if (output.size() + count > limit) throw IOException("Component metadata exceeds its size limit")
|
||||
output.write(buffer, 0, count)
|
||||
}
|
||||
output.toByteArray()
|
||||
}
|
||||
return JSONObject(String(bytes, Charsets.UTF_8))
|
||||
}
|
||||
|
||||
fun copy(url: String, output: OutputStream, limit: Long, expectedSha256: String? = null,
|
||||
cancelled: BooleanSupplier? = null, progress: Consumer<Float>? = null): Long {
|
||||
checkCancelled(cancelled)
|
||||
val entry = entries.optJSONObject(url) ?: throw IOException("Component is absent from this build: $url")
|
||||
val size = entry.getLong("size")
|
||||
val digest = entry.getString("sha256")
|
||||
if (size <= 0 || size > limit || !SHA256.matches(digest)) throw IOException("Invalid component metadata")
|
||||
if (expectedSha256 != null && !digest.equals(expectedSha256, ignoreCase = true)) {
|
||||
throw IOException("Component version does not match this build")
|
||||
}
|
||||
val recipe = "play-components/recipes/$digest.json"
|
||||
if (entry.getString("recipe") != recipe) throw IOException("Invalid component recipe path")
|
||||
val chunks = readObject(recipe).getJSONArray("chunks")
|
||||
if (chunks.length() == 0) throw IOException("Component contains no payload")
|
||||
val fullDigest = MessageDigest.getInstance("SHA-256")
|
||||
val buffer = ByteArray(65536)
|
||||
var total = 0L
|
||||
var lastPercent = -1
|
||||
for (index in 0 until chunks.length()) {
|
||||
checkCancelled(cancelled)
|
||||
val chunk = chunks.getJSONObject(index)
|
||||
val path = chunk.getString("asset")
|
||||
val chunkSize = chunk.getLong("size")
|
||||
val chunkSha256 = chunk.getString("sha256")
|
||||
if (!ASSET.matches(path) || chunkSize <= 0 || chunkSize > size - total || !SHA256.matches(chunkSha256)) {
|
||||
throw IOException("Invalid component chunk metadata")
|
||||
}
|
||||
val chunkDigest = MessageDigest.getInstance("SHA-256")
|
||||
var copied = 0L
|
||||
assets(path).use { input ->
|
||||
while (true) {
|
||||
checkCancelled(cancelled)
|
||||
val count = input.read(buffer)
|
||||
if (count < 0) break
|
||||
if (count.toLong() > chunkSize - copied) throw IOException("Component chunk exceeds pinned size")
|
||||
chunkDigest.update(buffer, 0, count)
|
||||
fullDigest.update(buffer, 0, count)
|
||||
output.write(buffer, 0, count)
|
||||
copied += count
|
||||
total += count
|
||||
val percent = (total * 100 / size).toInt().coerceAtMost(99)
|
||||
if (percent != lastPercent) {
|
||||
lastPercent = percent
|
||||
progress?.accept(percent / 100f)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (copied != chunkSize || hex(chunkDigest.digest()) != chunkSha256) {
|
||||
throw IOException("Component chunk failed verification")
|
||||
}
|
||||
}
|
||||
checkCancelled(cancelled)
|
||||
if (total != size || hex(fullDigest.digest()) != digest) throw IOException("Component failed verification")
|
||||
progress?.accept(1f)
|
||||
return total
|
||||
}
|
||||
|
||||
fun read(url: String, cancelled: BooleanSupplier? = null): String {
|
||||
val output = ByteArrayOutputStream()
|
||||
copy(url, output, INDEX_LIMIT.toLong(), cancelled = cancelled)
|
||||
return output.toString(Charsets.UTF_8.name())
|
||||
}
|
||||
|
||||
fun install(url: String, destination: File, expectedSha256: String? = null,
|
||||
cancelled: BooleanSupplier? = null, progress: Consumer<Float>? = null) {
|
||||
val parent = destination.absoluteFile.parentFile ?: throw IOException("Component destination has no parent")
|
||||
Files.createDirectories(parent.toPath())
|
||||
val temporary = Files.createTempFile(parent.toPath(), destination.name + ".", ".component-part")
|
||||
try {
|
||||
Files.newOutputStream(temporary).use { output ->
|
||||
copy(url, output, Long.MAX_VALUE, expectedSha256, cancelled, progress)
|
||||
}
|
||||
checkCancelled(cancelled)
|
||||
Files.move(temporary, destination.toPath(), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING)
|
||||
} finally {
|
||||
Files.deleteIfExists(temporary)
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkCancelled(cancelled: BooleanSupplier?) {
|
||||
if (Thread.currentThread().isInterrupted || cancelled?.asBoolean == true) throw IOException("Component copy cancelled")
|
||||
}
|
||||
|
||||
private fun hex(bytes: ByteArray) = bytes.joinToString("") { "%02x".format(it.toInt() and 255) }
|
||||
|
||||
companion object {
|
||||
private const val INDEX_LIMIT = 16 * 1024 * 1024
|
||||
private val SHA256 = Regex("[0-9a-f]{64}")
|
||||
private val ASSET = Regex("play-components/[0-9a-f]{64}/[0-9]{4,}")
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import com.droiddeck.launcher.input.HomeButtonService
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
|
||||
object SteamIntegration {
|
||||
private const val ACCESSIBILITY_CONSENT_VERSION = 1
|
||||
const val ACTION_SETUP = "com.droiddeck.launcher.STEAM_INTEGRATION"
|
||||
const val EXTRA_FEATURE = "integration_feature"
|
||||
enum class Feature { WIFI, BRIGHTNESS, HOME, SHORTCUTS }
|
||||
@@ -36,7 +37,7 @@ object SteamIntegration {
|
||||
locationOn = WifiDiscovery.locationEnabled(context),
|
||||
brightness = Settings.System.canWrite(context),
|
||||
home = HomeApp.isDefault(context),
|
||||
shortcuts = context.getSystemService(AccessibilityManager::class.java)
|
||||
shortcuts = accessibilityConsented(context) && context.getSystemService(AccessibilityManager::class.java)
|
||||
.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_ALL_MASK).any {
|
||||
val service = it.resolveInfo.serviceInfo
|
||||
ComponentName(service.packageName, service.name) == ComponentName(context, HomeButtonService::class.java)
|
||||
@@ -56,6 +57,14 @@ object SteamIntegration {
|
||||
|
||||
private fun shortcutsComponent(context: Context) = ComponentName(context, HomeButtonService::class.java)
|
||||
|
||||
fun accessibilityConsented(context: Context): Boolean =
|
||||
SessionPrefs.sessionPrefs(context).getInt("accessibility_consent", 0) == ACCESSIBILITY_CONSENT_VERSION
|
||||
|
||||
fun acceptAccessibility(context: Context) {
|
||||
SessionPrefs.sessionPrefs(context).edit().putInt("accessibility_consent", ACCESSIBILITY_CONSENT_VERSION).apply()
|
||||
HomeButtonService.consentChanged()
|
||||
}
|
||||
|
||||
fun shortcutsChosen(context: Context): Boolean = shortcutsSelection(context) == true
|
||||
|
||||
private fun shortcutsSelection(context: Context): Boolean? {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.droiddeck.launcher.gpu
|
||||
|
||||
import com.droiddeck.launcher.core.DownloadSource
|
||||
import com.droiddeck.launcher.core.Downloader
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import com.droiddeck.launcher.core.Hashes
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.FileUtils
|
||||
@@ -17,9 +18,9 @@ import java.net.URL
|
||||
object TurnipReleases {
|
||||
private const val TAG = "TurnipReleases"
|
||||
private const val PREFS = "turnip_releases"
|
||||
private const val KEY_RELEASE = "latest"
|
||||
private val KEY_RELEASE = ComponentDownloads.catalogName("latest")
|
||||
private const val KEY_DOWNLOADS = "downloads"
|
||||
private const val KEY_PICKS = "autoPicks"
|
||||
private val KEY_PICKS = ComponentDownloads.catalogName("autoPicks")
|
||||
|
||||
class Asset(val source: String, val tag: String, val name: String, val url: String, val size: Long, val linux: Boolean, val label: String,
|
||||
val sha256: String = "", val pair: String = "", val bundle: Boolean = false)
|
||||
@@ -132,6 +133,8 @@ object TurnipReleases {
|
||||
}
|
||||
|
||||
private fun get(context: Context, source: String, url: String): String {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) return ComponentDownloads.downloadString(url)
|
||||
?: throw IOException("Driver catalog is absent from this build")
|
||||
val c = URL(source).openConnection() as HttpURLConnection
|
||||
c.connectTimeout = 15_000
|
||||
c.readTimeout = 20_000
|
||||
@@ -188,7 +191,7 @@ object TurnipReleases {
|
||||
fun download(context: Context, asset: Asset, progress: (Int) -> Unit): File {
|
||||
if (asset.sha256.isEmpty()) throw IOException(context.getString(R.string.turnip_list_predates_checksums))
|
||||
val target = File(context.cacheDir, asset.name)
|
||||
val ok = Downloader.downloadFile(asset.url, target, true, asset.sha256) { f -> progress(if (f < 0) -1 else (f * 100).toInt()) }
|
||||
val ok = ComponentDownloads.downloadFile(asset.url, target, true, asset.sha256) { f -> progress(if (f < 0) -1 else (f * 100).toInt()) }
|
||||
if (!ok) throw IOException(context.getString(R.string.turnip_download_failed))
|
||||
if (!asset.sha256.equals(Hashes.sha256(target), ignoreCase = true)) {
|
||||
FileUtils.delete(target)
|
||||
|
||||
@@ -9,6 +9,8 @@ import android.os.Looper
|
||||
import android.view.KeyEvent
|
||||
import android.view.accessibility.AccessibilityEvent
|
||||
import com.droiddeck.launcher.HomeApp
|
||||
import com.droiddeck.launcher.core.SteamIntegration
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
object HomeButtonShortcuts {
|
||||
private var owner: Any? = null
|
||||
@@ -47,10 +49,20 @@ object HomeButtonShortcuts {
|
||||
|
||||
class HomeButtonService : AccessibilityService(), InputManager.InputDeviceListener {
|
||||
private var bottomScreen: BottomScreenWatch? = null
|
||||
private var consented = false
|
||||
|
||||
override fun onServiceConnected() {
|
||||
current = WeakReference(this)
|
||||
getSystemService(InputManager::class.java).registerInputDeviceListener(this, Handler(Looper.getMainLooper()))
|
||||
if (android.os.Build.VERSION.SDK_INT >= 33 && bottomScreen == null && BottomScreenGuests.supported()) bottomScreen = BottomScreenWatch(this).also { it.start() }
|
||||
updateConsent()
|
||||
}
|
||||
|
||||
private fun updateConsent() {
|
||||
consented = SteamIntegration.accessibilityConsented(this)
|
||||
if (consented && android.os.Build.VERSION.SDK_INT >= 33 && bottomScreen == null && BottomScreenGuests.supported()) {
|
||||
bottomScreen = BottomScreenWatch(this).also { it.start() }
|
||||
}
|
||||
if (!consented) stopBottomScreen()
|
||||
}
|
||||
|
||||
private fun stopBottomScreen() {
|
||||
@@ -58,7 +70,7 @@ class HomeButtonService : AccessibilityService(), InputManager.InputDeviceListen
|
||||
bottomScreen = null
|
||||
}
|
||||
|
||||
override fun onKeyEvent(event: KeyEvent) = HomeButtonShortcuts.onKeyEvent(this, event)
|
||||
override fun onKeyEvent(event: KeyEvent) = consented && HomeButtonShortcuts.onKeyEvent(this, event)
|
||||
override fun onAccessibilityEvent(event: AccessibilityEvent?) { if (android.os.Build.VERSION.SDK_INT >= 33) event?.let { bottomScreen?.onEvent(it) } }
|
||||
override fun onInterrupt() { HomeButtonShortcuts.release() }
|
||||
override fun onInputDeviceAdded(deviceId: Int) {}
|
||||
@@ -66,6 +78,8 @@ class HomeButtonService : AccessibilityService(), InputManager.InputDeviceListen
|
||||
override fun onInputDeviceRemoved(deviceId: Int) { HomeButtonShortcuts.onDeviceRemoved(deviceId) }
|
||||
|
||||
override fun onUnbind(intent: Intent?): Boolean {
|
||||
if (current?.get() === this) current = null
|
||||
consented = false
|
||||
HomeButtonShortcuts.release()
|
||||
stopBottomScreen()
|
||||
com.droiddeck.launcher.core.SteamIntegration.syncShortcutsListing(this)
|
||||
@@ -73,9 +87,16 @@ class HomeButtonService : AccessibilityService(), InputManager.InputDeviceListen
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
if (current?.get() === this) current = null
|
||||
HomeButtonShortcuts.release()
|
||||
stopBottomScreen()
|
||||
getSystemService(InputManager::class.java).unregisterInputDeviceListener(this)
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var current: WeakReference<HomeButtonService>? = null
|
||||
|
||||
fun consentChanged() { current?.get()?.updateConsent() }
|
||||
}
|
||||
}
|
||||
@@ -329,6 +329,7 @@ object BwrapSpawner {
|
||||
val verbose = plan.env["DROIDDECK_PROOT_VERBOSE"]?.toIntOrNull()
|
||||
if (verbose != null) { cmd.add(1, "-v"); cmd.add(2, verbose.toString()) }
|
||||
plan.binds.forEach { cmd.add("-b"); cmd.add(it.spec) }
|
||||
LinuxRuntime.bindComponentBundles(context, plan.root, cmd)
|
||||
cmd.add(plan.envTool)
|
||||
cmd.add("-i")
|
||||
plan.env.forEach { (k, v) -> cmd.add("$k=$v") }
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.droiddeck.launcher.core.Hashes
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.core.Downloader
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import com.droiddeck.launcher.session.SessionState
|
||||
import com.droiddeck.launcher.core.ArchivePaths
|
||||
import java.io.BufferedInputStream
|
||||
@@ -101,7 +101,7 @@ object DeckyManager {
|
||||
}
|
||||
|
||||
fun releaseChannels(context: Context): ReleaseChannels {
|
||||
val body = Downloader.downloadString(RELEASES) ?: return ReleaseChannels(emptyList(), emptyList())
|
||||
val body = ComponentDownloads.downloadString(RELEASES) ?: return ReleaseChannels(emptyList(), emptyList())
|
||||
return try {
|
||||
val array = JSONArray(body)
|
||||
val stable = mutableListOf<Release>()
|
||||
@@ -141,11 +141,11 @@ object DeckyManager {
|
||||
target.parentFile?.mkdirs()
|
||||
val temp = File(target.parentFile, "PluginLoader.download")
|
||||
val downloading = context.getString(R.string.user_apps_downloading, release.tag)
|
||||
val ok = Downloader.downloadFile(release.url, temp, true, release.digest?.substringAfter(':')) { f -> progress(downloading, if (f < 0) -1 else (f * 100).toInt().coerceIn(0, 100)) }
|
||||
val ok = ComponentDownloads.downloadFile(release.url, temp, true, release.digest?.substringAfter(':')) { f -> progress(downloading, if (f < 0) -1 else (f * 100).toInt().coerceIn(0, 100)) }
|
||||
if (!ok) { temp.delete(); return context.getString(R.string.deckymgr_download_failed) }
|
||||
if (temp.length() != release.size) { temp.delete(); return context.getString(R.string.deckymgr_size_mismatch) }
|
||||
val expected = release.digest?.substringAfter(':') ?: release.shaUrl?.let { checksumUrl ->
|
||||
val checksumBody = Downloader.downloadDirect(checksumUrl) ?: run { temp.delete(); return context.getString(R.string.deckymgr_checksum_download_failed) }
|
||||
val checksumBody = ComponentDownloads.downloadDirect(checksumUrl) ?: run { temp.delete(); return context.getString(R.string.deckymgr_checksum_download_failed) }
|
||||
Regex("(?i)\\b[0-9a-f]{64}\\b").find(checksumBody)?.value
|
||||
} ?: run { temp.delete(); return context.getString(R.string.deckymgr_checksum_missing) }
|
||||
if (!expected.matches(Regex("(?i)[0-9a-f]{64}"))) { temp.delete(); return context.getString(R.string.deckymgr_checksum_invalid) }
|
||||
@@ -270,7 +270,7 @@ object DeckyManager {
|
||||
downloadingBinary = true
|
||||
progress(downloading, -1)
|
||||
val downloaded = try {
|
||||
Downloader.downloadFile(url, temp, true, hash) { fraction ->
|
||||
ComponentDownloads.downloadFile(url, temp, true, hash) { fraction ->
|
||||
progress(downloading, if (fraction < 0) -1 else (fraction * 100).toInt().coerceIn(0, 100))
|
||||
}
|
||||
} finally {
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.util.Log
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.core.Downloader
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import com.droiddeck.launcher.core.FileUtils
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
@@ -22,8 +23,10 @@ object DesktopCatalog {
|
||||
val icon: String, val category: String,
|
||||
)
|
||||
|
||||
internal fun offered(entry: Entry): Boolean = !BuildConfig.PLAY_DISTRIBUTION || entry.id == DESKTOP_ID || entry.id == "desktop"
|
||||
|
||||
fun fetch(url: String = CATALOG_URL, cancelled: java.util.function.BooleanSupplier? = null): List<Entry>? {
|
||||
val body = Downloader.downloadString(url, cancelled) ?: return null
|
||||
val body = ComponentDownloads.downloadString(url, cancelled) ?: return null
|
||||
return try {
|
||||
val json = JSONObject(body)
|
||||
val arr = json.getJSONArray("packages")
|
||||
@@ -39,7 +42,7 @@ object DesktopCatalog {
|
||||
file.optLong("size", 0L), o.optString("notes", ""),
|
||||
o.optString("icon", "applications-games"), o.optString("category", "Game"),
|
||||
)
|
||||
}
|
||||
}.filter(::offered)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, "catalog: $e"); null
|
||||
}
|
||||
@@ -51,7 +54,7 @@ object DesktopCatalog {
|
||||
|
||||
private fun journal(root: File, id: String) = File(root, ".droiddeck-pkg-$id$JOURNAL_SUFFIX")
|
||||
|
||||
fun interrupted(context: Context): List<Entry> = interrupted(LinuxRuntime.rootDir(context))
|
||||
fun interrupted(context: Context): List<Entry> = interrupted(LinuxRuntime.rootDir(context)).filter(::offered)
|
||||
|
||||
fun interrupted(root: File): List<Entry> =
|
||||
root.listFiles { f -> f.name.startsWith(".droiddeck-pkg-") && f.name.endsWith(JOURNAL_SUFFIX) }.orEmpty()
|
||||
@@ -63,7 +66,7 @@ object DesktopCatalog {
|
||||
private fun downloadFile(context: Context, entry: Entry) = File(context.cacheDir, "pkg-${entry.id}-${entry.sha256.take(12)}.download")
|
||||
|
||||
fun pruneDownloads(context: Context) = synchronized(installLock) {
|
||||
val keep = interrupted(context).map { downloadFile(context, it).name }.toSet()
|
||||
val keep = interrupted(LinuxRuntime.rootDir(context)).map { downloadFile(context, it).name }.toSet()
|
||||
context.cacheDir.listFiles { f -> f.name.startsWith("pkg-") && f.name.removeSuffix(".resume.properties").endsWith(".download") }
|
||||
?.filter { it.name.removeSuffix(".resume.properties") !in keep }?.forEach { it.delete() }
|
||||
}
|
||||
@@ -107,9 +110,13 @@ object DesktopCatalog {
|
||||
fun installed(context: Context, id: String): String? =
|
||||
FileUtils.readString(marker(context, id))?.trim()?.takeIf { it.isNotEmpty() }
|
||||
|
||||
fun protonSeedNeeded(context: Context): Boolean =
|
||||
installed(context, PROTON_SEED_ID) == null &&
|
||||
fun protonSeedNeeded(context: Context): Boolean {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) return com.droiddeck.launcher.session.ProtonExtras.installed(
|
||||
context, com.droiddeck.launcher.session.ProtonExtras.tools.single(),
|
||||
) == null
|
||||
return installed(context, PROTON_SEED_ID) == null &&
|
||||
!File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/steamapps/appmanifest_4427310.acf").isFile
|
||||
}
|
||||
|
||||
const val DESKTOP_ID = "desktop-kde"
|
||||
const val EMULATORS_ID = "emulators"
|
||||
@@ -172,6 +179,7 @@ object DesktopCatalog {
|
||||
|
||||
private fun installLocked(context: Context, entry: Entry, cancelled: Downloader.Cancellation?,
|
||||
listener: LinuxRuntimeInstaller.ProgressListener?): String? {
|
||||
if (!offered(entry)) return context.getString(R.string.deskpkg_install_failed)
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
if (!root.isDirectory) return context.getString(R.string.deskpkg_runtime_missing)
|
||||
if (entry.id == EMULATORS_ID && desktopFromPack(root)) return installEmulators(context, entry, cancelled, listener)
|
||||
@@ -195,9 +203,9 @@ object DesktopCatalog {
|
||||
report.onProgress(LinuxRuntimeInstaller.Step.DOWNLOADING, downloading, if (f < 0) -1 else Math.round(f * 100f))
|
||||
}
|
||||
val ok = if (cancelled == null) {
|
||||
Downloader.downloadFile(entry.url, download, true, entry.sha256, progress)
|
||||
ComponentDownloads.downloadFile(entry.url, download, true, entry.sha256, progress)
|
||||
} else {
|
||||
Downloader.downloadFile(entry.url, download, true, entry.sha256, cancelled, progress)
|
||||
ComponentDownloads.downloadFile(entry.url, download, true, entry.sha256, cancelled, progress)
|
||||
}
|
||||
if (!ok || cancelled?.getAsBoolean() == true) return context.getString(R.string.user_apps_download_failed)
|
||||
report.onProgress(LinuxRuntimeInstaller.Step.VERIFYING, context.getString(R.string.rtinst_verifying), -1)
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.droiddeck.launcher.session.SessionPaths
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
import java.util.function.BooleanSupplier
|
||||
|
||||
object GuestCommand {
|
||||
fun run(context: Context, argv: List<String>, fakeRoot: Boolean = false, logName: String? = null,
|
||||
@@ -22,14 +23,19 @@ object GuestCommand {
|
||||
}
|
||||
log?.println("== ${java.util.Date()} ${argv.joinToString(" ")}")
|
||||
try {
|
||||
return runLogged(context, argv, fakeRoot, linkDir, extraBinds, fastPath, cancelled) { line -> log?.println(line); log?.flush(); onLine(line) }
|
||||
return runLogged(context, argv, fakeRoot, linkDir, extraBinds, fastPath,
|
||||
cancelled?.let { flag -> BooleanSupplier { flag.get() } }) { line -> log?.println(line); log?.flush(); onLine(line) }
|
||||
} finally {
|
||||
log?.close()
|
||||
}
|
||||
}
|
||||
|
||||
fun runCancellable(context: Context, argv: List<String>, cancelled: BooleanSupplier?, onLine: (String) -> Unit): Int =
|
||||
runLogged(context, argv, false, null, null, false, cancelled, onLine)
|
||||
|
||||
private fun runLogged(context: Context, argv: List<String>, fakeRoot: Boolean, linkDir: File?, extraBinds: List<String>?,
|
||||
fastPath: Boolean, cancelled: AtomicBoolean?, onLine: (String) -> Unit): Int {
|
||||
fastPath: Boolean, cancelled: BooleanSupplier?, onLine: (String) -> Unit): Int {
|
||||
if (cancelled?.asBoolean == true || Thread.currentThread().isInterrupted) return 130
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
LinuxRuntime.writeAccounts(context)
|
||||
SessionFiles.stage(context, root)
|
||||
@@ -65,7 +71,7 @@ object GuestCommand {
|
||||
fastPathKey?.let { ProotFastPath.hostEnv(it).let { (k, v) -> put(k, v) } }
|
||||
LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { put("LD_LIBRARY_PATH", it) }
|
||||
}
|
||||
if (cancelled?.get() == true) return 130
|
||||
if (cancelled?.asBoolean == true) return 130
|
||||
val process = builder.start()
|
||||
val pid = HostProcess.pidOf(process)
|
||||
OrphanReaper.keep(pid)
|
||||
@@ -74,8 +80,8 @@ object GuestCommand {
|
||||
val flag = cancelled
|
||||
Thread({
|
||||
try {
|
||||
while (process.isAlive && flag?.get() != true && !caller.isInterrupted) Thread.sleep(200)
|
||||
if (flag?.get() == true || caller.isInterrupted) {
|
||||
while (process.isAlive && flag?.asBoolean != true && !caller.isInterrupted) Thread.sleep(200)
|
||||
if (flag?.asBoolean == true || caller.isInterrupted) {
|
||||
if (pid > 0) {
|
||||
runCatching { android.system.Os.kill(pid, android.system.OsConstants.SIGQUIT) }
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.droiddeck.launcher.runtime;
|
||||
|
||||
import com.droiddeck.launcher.core.AddonPack;
|
||||
import com.droiddeck.launcher.BuildConfig;
|
||||
import com.droiddeck.launcher.core.ArchivePaths;
|
||||
import android.content.Context;
|
||||
import android.os.Process;
|
||||
import android.system.ErrnoException;
|
||||
@@ -89,10 +91,12 @@ public final class LinuxRuntime {
|
||||
}
|
||||
|
||||
public static boolean patchedProot(Context context) {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) return bundledProotReady(context);
|
||||
return bundledProotReady(context) || AddonPack.PROOT.installed(context);
|
||||
}
|
||||
|
||||
public static File prootBinary(Context context) {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) return bundledProot(context, "libproot.so");
|
||||
if (bundledProotReady(context)) return bundledProot(context, "libproot.so");
|
||||
if (AddonPack.PROOT.installed(context)) return AddonPack.PROOT.file(context, "libproot.so");
|
||||
if (SessionPrefs.allowStockProot(context)) return rootfsProot(context);
|
||||
@@ -100,6 +104,7 @@ public final class LinuxRuntime {
|
||||
}
|
||||
|
||||
public static File prootLoader(Context context) {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) return bundledProot(context, "libproot-loader.so");
|
||||
if (bundledProotReady(context)) return bundledProot(context, "libproot-loader.so");
|
||||
if (AddonPack.PROOT.installed(context)) return AddonPack.PROOT.file(context, "libproot-loader.so");
|
||||
if (SessionPrefs.allowStockProot(context)) return rootfsLoader(context);
|
||||
@@ -274,6 +279,7 @@ public final class LinuxRuntime {
|
||||
bindGpuNode(context, cmd);
|
||||
bindAdrenoStats(cmd, extraBinds);
|
||||
bindCpuTemps(cmd, root);
|
||||
bindComponentBundles(context, root, cmd);
|
||||
if (extraBinds != null) {
|
||||
for (String spec : extraBinds) bind(cmd, spec);
|
||||
}
|
||||
@@ -282,6 +288,27 @@ public final class LinuxRuntime {
|
||||
return specs;
|
||||
}
|
||||
|
||||
public static void bindComponentBundles(Context context, File root, List<String> command) {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return;
|
||||
java.util.LinkedHashSet<File> directories = new java.util.LinkedHashSet<>();
|
||||
directories.add(new File(context.getApplicationInfo().sourceDir).getParentFile());
|
||||
String[] splits = context.getApplicationInfo().splitSourceDirs;
|
||||
if (splits != null) for (String split : splits) directories.add(new File(split).getParentFile());
|
||||
int index = 0;
|
||||
for (File directory : directories) {
|
||||
File target;
|
||||
try {
|
||||
target = ArchivePaths.inside(root, "opt/droiddeck-bundles/" + index++);
|
||||
} catch (IOException error) {
|
||||
throw new IllegalStateException("Installed component bundle mount is invalid", error);
|
||||
}
|
||||
if (directory == null || !directory.isDirectory() || target == null || !target.isDirectory() && !target.mkdirs()) {
|
||||
throw new IllegalStateException("Installed component bundles cannot be mounted");
|
||||
}
|
||||
bind(command, directory.getPath() + ":/" + root.toPath().relativize(target.toPath()).toString());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean unreadablePciDevice() {
|
||||
File[] devices = new File("/sys/bus/pci/devices").listFiles();
|
||||
if (devices == null) return false;
|
||||
|
||||
@@ -8,7 +8,7 @@ import android.util.Log;
|
||||
import com.droiddeck.launcher.R;
|
||||
import com.droiddeck.launcher.session.SessionPrefs;
|
||||
import com.droiddeck.launcher.core.ArchivePaths;
|
||||
import com.droiddeck.launcher.core.Downloader;
|
||||
import com.droiddeck.launcher.core.ComponentDownloads;
|
||||
import com.droiddeck.launcher.core.Hashes;
|
||||
import com.droiddeck.launcher.core.FileUtils;
|
||||
|
||||
@@ -104,7 +104,7 @@ public final class LinuxRuntimeInstaller {
|
||||
}
|
||||
|
||||
public static Release fetchRelease() {
|
||||
String body = Downloader.downloadString(catalogUrl());
|
||||
String body = ComponentDownloads.downloadString(catalogUrl());
|
||||
if (body == null || body.isEmpty()) return null;
|
||||
try {
|
||||
JSONObject json = new JSONObject(body);
|
||||
@@ -288,7 +288,7 @@ public final class LinuxRuntimeInstaller {
|
||||
&& !SessionPrefs.allowStockProot(context))
|
||||
throw new IOException("Cannot download proot");
|
||||
if (!AddonPack.DIRECTAUDIO.await(context)) throw new IOException("Cannot download DirectAudio");
|
||||
boolean ok = Downloader.downloadFile(release.url, archive, true, release.sha256, (fraction) -> {
|
||||
boolean ok = ComponentDownloads.downloadFile(release.url, archive, true, release.sha256, (fraction) -> {
|
||||
if (listener != null) {
|
||||
listener.onProgress(Step.DOWNLOADING, downloading,
|
||||
fraction < 0 ? -1 : Math.round(fraction * 100f));
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.droiddeck.launcher.core.Hashes
|
||||
import com.droiddeck.launcher.R
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.Downloader
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import com.droiddeck.launcher.core.FileUtils
|
||||
import com.droiddeck.launcher.core.GameEnvironment
|
||||
import com.droiddeck.launcher.gpu.GpuInfo
|
||||
@@ -87,7 +87,7 @@ object ComponentsManager {
|
||||
private fun packagesDir(context: Context) = File(dataDir(context), "packages").apply { mkdirs() }
|
||||
private fun originalsDir(context: Context) = File(dataDir(context), "originals").apply { mkdirs() }
|
||||
private fun stateFile(context: Context) = File(dataDir(context), "state.json")
|
||||
private fun catalogFile(context: Context) = File(dataDir(context), "catalog.json")
|
||||
private fun catalogFile(context: Context) = File(dataDir(context), ComponentDownloads.catalogName("catalog.json"))
|
||||
private const val LAUNCH_DIR = "root/.local/share/droiddeck-components"
|
||||
private const val LEGACY_LAUNCH_DIR = "root/.local/share/bannerlator-components"
|
||||
private fun launchDir(context: Context): File {
|
||||
@@ -283,6 +283,7 @@ object ComponentsManager {
|
||||
for ((base, valve) in bases) {
|
||||
val entries = base.listFiles()?.sortedBy { it.name } ?: continue
|
||||
for (dir in entries) {
|
||||
if (com.droiddeck.launcher.BuildConfig.PLAY_DISTRIBUTION && (valve || !dir.name.startsWith("DroidDeck-Proton"))) continue
|
||||
if (!File(dir, WINE).isDirectory || !File(dir, "proton").isFile) continue
|
||||
val real = runCatching { dir.canonicalPath }.getOrDefault(dir.path)
|
||||
if (found.containsKey(real)) continue
|
||||
@@ -945,7 +946,7 @@ object ComponentsManager {
|
||||
if (!force) return Catalog(emptyList(), 0)
|
||||
val items = JSONArray()
|
||||
for ((repo, tag) in SOURCES) {
|
||||
val body = Downloader.downloadString("https://api.github.com/repos/$repo/releases/tags/$tag") ?: continue
|
||||
val body = ComponentDownloads.downloadString("https://api.github.com/repos/$repo/releases/tags/$tag") ?: continue
|
||||
val assets = runCatching { JSONObject(body).optJSONArray("assets") }.getOrNull() ?: continue
|
||||
for (i in 0 until assets.length()) {
|
||||
val a = assets.getJSONObject(i)
|
||||
@@ -1079,7 +1080,7 @@ object ComponentsManager {
|
||||
require(Hashes.isGithubSha256(item.digest)) { context.getString(R.string.cmgr_list_predates_checksums) }
|
||||
val dest = File(packagesDir(context), safeName(item.file))
|
||||
val part = File(dest.parentFile, dest.name + ".part")
|
||||
check(Downloader.downloadFile(item.url, part, true, item.digest.substringAfter(':')) { f -> progress(if (f < 0) -1 else (f * 100).toInt().coerceIn(0, 100)) }) {
|
||||
check(ComponentDownloads.downloadFile(item.url, part, true, item.digest.substringAfter(':')) { f -> progress(if (f < 0) -1 else (f * 100).toInt().coerceIn(0, 100)) }) {
|
||||
context.getString(if (item.release == DD_NIGHTLY) R.string.cmgr_nightly_replaced else R.string.user_apps_download_failed)
|
||||
}
|
||||
if (!Hashes.sha256(part).equals(item.digest.substringAfter(':'), true)) { part.delete(); error(context.getString(R.string.cmgr_checksum_mismatch)) }
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.droiddeck.launcher.session
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import com.droiddeck.launcher.core.DownloadSource
|
||||
import com.droiddeck.launcher.core.FileUtils
|
||||
import com.droiddeck.launcher.core.Hashes
|
||||
@@ -861,8 +863,17 @@ object EsyncPacks {
|
||||
return null
|
||||
}
|
||||
|
||||
private fun fetch(url: String, limit: Long, out: OutputStream, progress: ((Long) -> Unit)?): Boolean =
|
||||
fetcher(url, limit, out, progress)
|
||||
private fun fetch(url: String, limit: Long, out: OutputStream, progress: ((Long) -> Unit)?): Boolean {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return fetcher(url, limit, out, progress)
|
||||
return try {
|
||||
val bytes = ComponentDownloads.copyBundled(url, out, limit, null)
|
||||
progress?.invoke(bytes)
|
||||
true
|
||||
} catch (error: IOException) {
|
||||
Log.w(TAG, "Bundled synchronization component unavailable: $url", error)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private fun httpFetch(url: String, limit: Long, out: OutputStream, progress: ((Long) -> Unit)?): Boolean {
|
||||
var connection: HttpURLConnection? = null
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.droiddeck.launcher.session
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.DownloadSource
|
||||
import com.droiddeck.launcher.core.Downloader
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
|
||||
@@ -20,7 +20,7 @@ object FexCatalog {
|
||||
|
||||
@Volatile private var refreshedAt = 0L
|
||||
|
||||
private fun file(context: Context) = File(context.filesDir, "fex-catalog.json")
|
||||
private fun file(context: Context) = File(context.filesDir, ComponentDownloads.catalogName("fex-catalog.json"))
|
||||
|
||||
internal fun parse(text: String): Build? = runCatching {
|
||||
val o = JSONObject(text)
|
||||
@@ -42,7 +42,7 @@ object FexCatalog {
|
||||
fun refresh(context: Context, now: Long = System.currentTimeMillis()): Build? {
|
||||
if (now - refreshedAt < REFRESH_MS) return cached(context)
|
||||
refreshedAt = now
|
||||
val text = Downloader.downloadDirect(CATALOG_URL) ?: return cached(context)
|
||||
val text = ComponentDownloads.downloadDirect(CATALOG_URL) ?: return cached(context)
|
||||
val build = parse(text) ?: run {
|
||||
Log.w(TAG, "fex.json not usable; keeping the last one")
|
||||
return cached(context)
|
||||
|
||||
@@ -2,13 +2,15 @@ package com.droiddeck.launcher.session
|
||||
|
||||
import com.droiddeck.launcher.core.Hashes
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
import android.content.Context
|
||||
import android.os.StatFs
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.Downloader
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import com.droiddeck.launcher.core.FileUtils
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import java.io.File
|
||||
import java.util.function.BooleanSupplier
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
||||
@@ -30,17 +32,19 @@ object ProtonExtras {
|
||||
|
||||
const val OWN = "droiddeck"
|
||||
|
||||
val tools = listOf(
|
||||
internal val sources = listOf(
|
||||
Tool("ge", "GE-Proton", "GE-Proton", "GloriousEggroll/proton-ge-custom", Regex("aarch64\\.tar\\.(gz|xz)$")),
|
||||
Tool("cachyos", "proton-cachyos", "proton-cachyos", "CachyOS/proton-cachyos", Regex("arm64\\.tar\\.(gz|xz)$")),
|
||||
Tool("droiddeck", "DroidDeck-Proton", "DroidDeck-Proton", "Droid-Deck/DroidDeck-Proton", Regex("aarch64\\.tar\\.(gz|xz)$")),
|
||||
Tool("droiddeck", "DroidDeck-Proton", "DroidDeck-Proton", "Droid-Deck/DroidDeck-Proton", Regex(if (BuildConfig.PLAY_DISTRIBUTION) "aarch64\\.tar\\.(gz|xz|zst)$" else "aarch64\\.tar\\.(gz|xz)$")),
|
||||
)
|
||||
|
||||
val tools = sources.filter { !BuildConfig.PLAY_DISTRIBUTION || it.id == OWN }
|
||||
|
||||
private fun home(context: Context) = File(LinuxRuntime.rootDir(context), "root")
|
||||
private fun requests(context: Context) = File(home(context), ".bl-proton-extra")
|
||||
private fun toolsDir(context: Context) = File(home(context), ".local/share/Steam/compatibilitytools.d")
|
||||
private fun releasesFile(context: Context) = File(context.filesDir, "proton-extras.json")
|
||||
private fun latestFile(context: Context) = File(context.filesDir, "proton-latest.json")
|
||||
private fun latestFile(context: Context) = File(context.filesDir, ComponentDownloads.catalogName("proton-latest.json"))
|
||||
|
||||
fun installed(context: Context, tool: Tool): String? = installedIn(toolsDir(context), tool).lastOrNull()
|
||||
|
||||
@@ -200,13 +204,17 @@ object ProtonExtras {
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun install(context: Context, tool: Tool, onProgress: (String, Int) -> Unit): String? {
|
||||
fun install(context: Context, tool: Tool, onProgress: (String, Int) -> Unit): String? = install(context, tool, null, onProgress)
|
||||
|
||||
@Synchronized
|
||||
fun install(context: Context, tool: Tool, cancelled: BooleanSupplier?, onProgress: (String, Int) -> Unit): String? {
|
||||
if (installInProgress) return context.getString(R.string.pextra_busy)
|
||||
installInProgress = true
|
||||
return try { installNow(context, tool, onProgress) } finally { installInProgress = false }
|
||||
return try { installNow(context, tool, cancelled, onProgress) } finally { installInProgress = false }
|
||||
}
|
||||
|
||||
private fun installNow(context: Context, tool: Tool, onProgress: (String, Int) -> Unit): String? {
|
||||
private fun installNow(context: Context, tool: Tool, cancelled: BooleanSupplier?, onProgress: (String, Int) -> Unit): String? {
|
||||
if (cancelled?.asBoolean == true || Thread.currentThread().isInterrupted) return context.getString(R.string.pextra_interrupted)
|
||||
if (SessionState.running) return context.getString(R.string.pextra_stop_session)
|
||||
if (!LinuxRuntime.isInstalled(context)) return context.getString(R.string.user_apps_runtime_required)
|
||||
|
||||
@@ -223,10 +231,12 @@ object ProtonExtras {
|
||||
onProgress(downloading, 0)
|
||||
var downloaded = false
|
||||
for (attempt in 0 until 5) {
|
||||
downloaded = Downloader.downloadFile(asset.url, archive, true, asset.sha256) { fraction ->
|
||||
if (cancelled?.asBoolean == true || Thread.currentThread().isInterrupted) return context.getString(R.string.pextra_interrupted)
|
||||
downloaded = ComponentDownloads.downloadFile(asset.url, archive, true, asset.sha256, cancelled) { fraction ->
|
||||
onProgress(downloading, if (fraction < 0) -1 else (fraction * 100f).toInt().coerceIn(0, 100))
|
||||
}
|
||||
if (downloaded) break
|
||||
if (cancelled?.asBoolean == true) return context.getString(R.string.pextra_interrupted)
|
||||
if (attempt < 4) {
|
||||
onProgress(context.getString(R.string.pextra_retrying, attempt + 2, 5), -1)
|
||||
try { Thread.sleep(3_000) } catch (_: InterruptedException) {
|
||||
@@ -248,7 +258,7 @@ object ProtonExtras {
|
||||
val verified = when {
|
||||
asset.sha256 != null -> asset.sha256.equals(Hashes.sha256(archive), ignoreCase = true)
|
||||
asset.sha512 != null -> {
|
||||
val expected = Downloader.downloadDirect(asset.sha512)?.let { Regex("(?i)\\b[0-9a-f]{128}\\b").find(it)?.value }
|
||||
val expected = ComponentDownloads.downloadDirect(asset.sha512)?.let { Regex("(?i)\\b[0-9a-f]{128}\\b").find(it)?.value }
|
||||
?: return context.getString(R.string.pextra_checksum_unreadable)
|
||||
expected.equals(Hashes.sha512(archive), ignoreCase = true)
|
||||
}
|
||||
@@ -263,38 +273,23 @@ object ProtonExtras {
|
||||
}
|
||||
|
||||
if (SessionState.running) return context.getString(R.string.pextra_session_started)
|
||||
if (cancelled?.asBoolean == true || Thread.currentThread().isInterrupted) return context.getString(R.string.pextra_interrupted)
|
||||
val installing = context.getString(R.string.pextra_installing, tool.name)
|
||||
onProgress(installing, -1)
|
||||
return try {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
LinuxRuntime.writeAccounts(context)
|
||||
com.droiddeck.launcher.session.SessionFiles.stage(context, root)
|
||||
val runtimeDir = File(context.filesDir, ".proton-install-rt").apply { mkdirs() }
|
||||
val guest = listOf(
|
||||
"/usr/bin/env", "-i", "HOME=/root", "USER=root", "PATH=/usr/local/bin:/usr/bin:/bin",
|
||||
"LANG=C.UTF-8", "XDG_DATA_HOME=/root/.local/share",
|
||||
"/usr/local/bin/droiddeck-proton-extra", "/root/.local/share/Steam", archive.absolutePath,
|
||||
)
|
||||
val command = LinuxRuntime.command(context, null, runtimeDir, null, guest)
|
||||
val process = ProcessBuilder(command)
|
||||
.directory(root)
|
||||
.redirectErrorStream(true)
|
||||
val hostEnv = process.environment()
|
||||
hostEnv["PROOT_LOADER"] = LinuxRuntime.prootLoader(context).path
|
||||
hostEnv["PROOT_TMP_DIR"] = LinuxRuntime.prootTempDir(context).path
|
||||
LinuxRuntime.prootLibraryPath(context).takeIf { it.isNotEmpty() }?.let { hostEnv["LD_LIBRARY_PATH"] = it }
|
||||
val child = process.start()
|
||||
var placed: String? = null
|
||||
child.inputStream.bufferedReader().useLines { lines ->
|
||||
lines.forEach { line ->
|
||||
Log.i(TAG, line)
|
||||
line.substringAfter("droiddeck-proton-extra: installed ", "").takeIf { it.isNotEmpty() }?.let { placed = it }
|
||||
if (line.contains("unpacking", ignoreCase = true) || line.contains("adopted", ignoreCase = true)) {
|
||||
onProgress(installing, -1)
|
||||
}
|
||||
val status = com.droiddeck.launcher.runtime.GuestCommand.runCancellable(context, guest, cancelled) { line ->
|
||||
Log.i(TAG, line)
|
||||
line.substringAfter("droiddeck-proton-extra: installed ", "").takeIf { it.isNotEmpty() }?.let { placed = it }
|
||||
if (line.contains("unpacking", ignoreCase = true) || line.contains("adopted", ignoreCase = true)) {
|
||||
onProgress(installing, -1)
|
||||
}
|
||||
}
|
||||
val status = child.waitFor()
|
||||
if (cancelled?.asBoolean == true || Thread.currentThread().isInterrupted) return context.getString(R.string.pextra_interrupted)
|
||||
if (status != 0) context.getString(R.string.pextra_install_failed, tool.name, status)
|
||||
else {
|
||||
archive.delete()
|
||||
@@ -318,7 +313,7 @@ object ProtonExtras {
|
||||
}
|
||||
|
||||
private fun findLatestAsset(tool: Tool): Asset? {
|
||||
val releases = Downloader.downloadString(RELEASES.format(tool.repo)) ?: return null
|
||||
val releases = ComponentDownloads.downloadString(RELEASES.format(tool.repo)) ?: return null
|
||||
return try {
|
||||
pickAsset(tool, JSONArray(releases))
|
||||
} catch (e: Exception) {
|
||||
@@ -341,7 +336,9 @@ object ProtonExtras {
|
||||
}?.optString("browser_download_url")?.takeIf { it.startsWith("http") }
|
||||
return Asset(
|
||||
release.optString("tag_name"), name,
|
||||
archive.optString("browser_download_url").takeIf { it.startsWith("http") } ?: continue, checksum,
|
||||
archive.optString("browser_download_url").takeIf {
|
||||
it.startsWith("http") || BuildConfig.PLAY_DISTRIBUTION && it.startsWith("droiddeck-bundle://")
|
||||
} ?: continue, checksum,
|
||||
archive.optLong("size", 0L),
|
||||
Hashes.githubSha256(archive.optString("digest")),
|
||||
)
|
||||
|
||||
@@ -45,6 +45,7 @@ object SessionFiles {
|
||||
"usr/local/bin/droiddeck-esync" to "usr/local/bin/droiddeck-esync",
|
||||
"usr/local/bin/droiddeck-steam-compat" to "usr/local/bin/droiddeck-steam-compat",
|
||||
"usr/local/bin/droiddeck-fex" to "usr/local/bin/droiddeck-fex",
|
||||
"usr/local/lib/droiddeck/component_delivery.py" to "usr/local/lib/droiddeck/component_delivery.py",
|
||||
"libblsession.so" to "usr/local/lib/libblsession.so",
|
||||
"libfakeinput.so" to "usr/local/lib/libfakeinput.so",
|
||||
"libblfastpath.so" to "usr/local/lib/libblfastpath.so",
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
|
||||
import com.droiddeck.launcher.core.AddonPack
|
||||
import com.droiddeck.launcher.gpu.LinuxVulkanDriver
|
||||
import com.droiddeck.launcher.gpu.LinuxVulkanDriverManager
|
||||
@@ -844,7 +846,8 @@ class SessionService : Service() {
|
||||
SessionArtifacts.markSteamLogs(it, File(SessionPrefs.steamRoot(this, arch), "logs"))
|
||||
}
|
||||
}
|
||||
FexCatalog.cached(this)?.let { guest.addAll(FexCatalog.environment(it)) }
|
||||
(if (BuildConfig.PLAY_DISTRIBUTION) FexCatalog.refresh(this) else FexCatalog.cached(this))
|
||||
?.let { guest.addAll(FexCatalog.environment(it)) }
|
||||
if (SessionState.mode == MODE_STEAM) {
|
||||
guest.add("BL_GAMESCOPE_STRETCH_16X9=" + (if (SessionPrefs.stretch16x9(this)) "1" else "0"))
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import android.util.AtomicFile
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.core.ArchivePaths
|
||||
import com.droiddeck.launcher.core.Downloader
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import com.droiddeck.launcher.core.FileUtils
|
||||
import com.droiddeck.launcher.runtime.GuestCommand
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
@@ -86,13 +86,13 @@ object WinComponents {
|
||||
|
||||
private val SNAPSHOT_COVERS = INSTALLER_STEPS + setOf("download_archive", "archive_extract", "copy_dll", "copy_file") + OFFLINE_STEPS
|
||||
|
||||
fun fetch(): List<Component>? = Downloader.downloadString(CATALOG_URL)?.let { parse(it) }
|
||||
fun fetch(): List<Component>? = ComponentDownloads.downloadString(CATALOG_URL)?.let { parse(it) }
|
||||
|
||||
private const val CATALOG_CACHE = "wincomponents-catalog.json"
|
||||
private val CATALOG_CACHE = ComponentDownloads.catalogName("wincomponents-catalog.json")
|
||||
|
||||
fun fetch(context: Context): List<Component>? {
|
||||
val cache = File(context.filesDir, CATALOG_CACHE)
|
||||
Downloader.downloadString(CATALOG_URL)?.let { body ->
|
||||
ComponentDownloads.downloadString(CATALOG_URL)?.let { body ->
|
||||
parse(body)?.let { runCatching { write(cache, body) }; return it }
|
||||
}
|
||||
return runCatching { parse(cache.readText()) }.getOrNull()
|
||||
@@ -241,7 +241,7 @@ object WinComponents {
|
||||
val byRuntime = name.lowercase().let { it.endsWith(".exe") || it.endsWith(".cab") }
|
||||
val file = if (byRuntime) File(root, "$MSI_CACHE/${archives.size}-$name").apply { parentFile?.mkdirs() }
|
||||
else File(work, "${archives.size}-$name")
|
||||
val ok = Downloader.downloadFile(url, file, false) { f -> onProgress(Progress(c.name, name, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }
|
||||
val ok = ComponentDownloads.downloadFile(url, file, false) { f -> onProgress(Progress(c.name, name, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }
|
||||
if (!ok) return "download failed: $name"
|
||||
step.str("file_checksum").takeIf { it.length == 32 }?.let { md5 ->
|
||||
if (!digest(file, "MD5").equals(md5, ignoreCase = true)) return "checksum mismatch: $name"
|
||||
@@ -368,7 +368,7 @@ object WinComponents {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val name = c.snapshot.substringAfterLast('/')
|
||||
val json = File(work, "${c.name}.snapshot.json")
|
||||
if (!Downloader.downloadFile(c.snapshot, json, false) { f -> onProgress(Progress(c.name, name, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
if (!ComponentDownloads.downloadFile(c.snapshot, json, false) { f -> onProgress(Progress(c.name, name, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
return null to "download failed: $name"
|
||||
}
|
||||
val snapshot = runCatching { JSONObject(json.readText()) }.getOrNull() ?: return null to "the recording could not be read"
|
||||
@@ -384,7 +384,7 @@ object WinComponents {
|
||||
val url = c.snapshot.substringBeforeLast('/') + "/" + archiveName
|
||||
val file = File(work, "${c.name}.files.tar.xz")
|
||||
val sha = archive.optString("sha256").takeIf { it.matches(Regex("(?i)[0-9a-f]{64}")) }
|
||||
if (!Downloader.downloadFile(url, file, false, sha) { f -> onProgress(Progress(c.name, archiveName, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
if (!ComponentDownloads.downloadFile(url, file, false, sha) { f -> onProgress(Progress(c.name, archiveName, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
return null to "download failed: $archiveName"
|
||||
}
|
||||
archive.optString("sha256").takeIf { it.length == 64 }?.let { sha ->
|
||||
@@ -403,7 +403,7 @@ object WinComponents {
|
||||
val installer = File(cache, "${c.name}-snapshot-src.bin")
|
||||
var unpacked: File? = null
|
||||
try {
|
||||
if (!Downloader.downloadFile(url, installer, false) { f -> onProgress(Progress(c.name, installerName, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
if (!ComponentDownloads.downloadFile(url, installer, false) { f -> onProgress(Progress(c.name, installerName, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
return null to "download failed: $installerName"
|
||||
}
|
||||
unpacked = unpackInRuntime(context, c, installer, "snapshot", onProgress) ?: return null to "could not open $installerName"
|
||||
@@ -479,7 +479,7 @@ object WinComponents {
|
||||
val ext = if (listOf(step.str("file_name"), name).any { it.endsWith(".exe", ignoreCase = true) }) "exe" else "msi"
|
||||
val file = File(cache, "${c.name}-${c.steps.indexOf(step)}.$ext")
|
||||
try {
|
||||
if (!Downloader.downloadFile(url, file, false) { f -> onProgress(Progress(c.name, name, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
if (!ComponentDownloads.downloadFile(url, file, false) { f -> onProgress(Progress(c.name, name, Phase.DOWNLOAD, if (f < 0) -1 else Math.round(f * 100f))) }) {
|
||||
return null to "download failed: $name"
|
||||
}
|
||||
step.str("file_checksum").takeIf { it.length == 32 }?.let { md5 ->
|
||||
|
||||
@@ -26,9 +26,11 @@ object BuildWatermark {
|
||||
commit: String = BuildConfig.SOURCE_COMMIT,
|
||||
title: String = BuildConfig.PR_TITLE,
|
||||
branch: String = BuildConfig.BUILD_BRANCH,
|
||||
play: Boolean = BuildConfig.PLAY_DISTRIBUTION,
|
||||
): List<String>? {
|
||||
if (ci && pr <= 0) return null
|
||||
val hash = commit.take(7).ifEmpty { "unknown" }
|
||||
if (play) return listOf(hash)
|
||||
if (ci && pr <= 0) return null
|
||||
val head = if (pr > 0) "PR-$pr | $hash" else "LOCAL | $hash"
|
||||
val detail = (if (pr > 0) title else branch).trim()
|
||||
return if (detail.isEmpty()) listOf(head) else listOf(head, truncate(detail))
|
||||
|
||||
@@ -173,7 +173,7 @@ private fun DesktopDock(
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val narrow = LocalNarrowPane.current
|
||||
val available = s.emulators.filter { !it.installed }
|
||||
val available = if (com.droiddeck.launcher.BuildConfig.PLAY_DISTRIBUTION) emptyList() else s.emulators.filter { !it.installed }
|
||||
val flatpaks = com.droiddeck.launcher.store.StoreState.installed.filter { f -> apps.none { it.key == "flatpak:${f.id}" } }
|
||||
val keys = installed.map { "emu:${it.id}" } + apps.map { "user:${it.key}" } + flatpaks.map { "flatpak:${it.id}" }
|
||||
var lastAt by remember { mutableStateOf<Rect?>(null) }
|
||||
|
||||
@@ -360,6 +360,11 @@ internal fun SetupPanel(
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.setup_runtime)) { runtimeCheck(false) }
|
||||
SteamIntegrationGroup(s.integration, s.integrationFocus, a.onIntegration, a.onIntegrationAppInfo, a.onIntegrationLocation)
|
||||
if (com.droiddeck.launcher.BuildConfig.PLAY_DISTRIBUTION) {
|
||||
SecondaryButton(stringResource(R.string.setup_privacy_policy), compact = true) {
|
||||
openUrl(ctx, "https://github.com/Droid-Deck/DroidDeck/blob/playstore/PRIVACY.md")
|
||||
}
|
||||
}
|
||||
}
|
||||
1 -> {
|
||||
val controller = s.controller
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
|
||||
import com.droiddeck.launcher.R
|
||||
import androidx.compose.ui.res.pluralStringResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
@@ -77,8 +79,10 @@ class UpdatesState(
|
||||
val stage: String? = null,
|
||||
val percent: Int = -1,
|
||||
val askPermission: Boolean = false,
|
||||
val playUpdateAvailable: Boolean? = null,
|
||||
val playCheckedAt: Long = 0L,
|
||||
) {
|
||||
val hasUpdate: Boolean get() = AppUpdates.hasUpdate(catalog, follow)
|
||||
val hasUpdate: Boolean get() = if (BuildConfig.PLAY_DISTRIBUTION) playUpdateAvailable == true else AppUpdates.hasUpdate(catalog, follow)
|
||||
}
|
||||
|
||||
class UpdatesActions(
|
||||
@@ -87,6 +91,7 @@ class UpdatesActions(
|
||||
val onInstall: (Release) -> Unit = {},
|
||||
val onAllowInstalls: () -> Unit = {},
|
||||
val onDismissPermission: () -> Unit = {},
|
||||
val onOpenPlay: () -> Unit = {},
|
||||
)
|
||||
|
||||
@OptIn(androidx.compose.foundation.ExperimentalFoundationApi::class)
|
||||
@@ -106,13 +111,17 @@ internal fun UpdatesPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
|
||||
maxLines = 1, modifier = Modifier.weight(1f)
|
||||
.basicMarquee(iterations = Int.MAX_VALUE, initialDelayMillis = 700, velocity = 40.dp),
|
||||
)
|
||||
val checked = u.catalog?.checkedAt?.takeIf { it > 0 }
|
||||
if (!LocalNarrowPane.current) Text(
|
||||
val checked = (if (BuildConfig.PLAY_DISTRIBUTION) u.playCheckedAt else u.catalog?.checkedAt)?.takeIf { it > 0 }
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION && !LocalNarrowPane.current) Text(
|
||||
if (u.checking) stringResource(R.string.common_checking) else if (checked != null) stringResource(R.string.upd_checked, ago(checked).replaceFirstChar { it.lowercase() }) else stringResource(R.string.upd_not_checked),
|
||||
fontSize = 13.sp, color = colors.onSurfaceVariant,
|
||||
)
|
||||
ToolIcon(Icons.Outlined.Refresh, stringResource(R.string.store_check_updates), busy = u.checking, enabled = !u.checking && u.stage == null, onClick = ua.onCheck)
|
||||
}
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) {
|
||||
StatusPanel(s, u, ua, me)
|
||||
return@Column
|
||||
}
|
||||
BoxWithConstraints(Modifier.weight(1f).fillMaxWidth()) {
|
||||
val stacked = LocalNarrowPane.current || maxWidth < 600.dp
|
||||
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(bottom = 16.dp)) {
|
||||
@@ -131,7 +140,7 @@ internal fun UpdatesPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
|
||||
}
|
||||
}
|
||||
}
|
||||
if (u.askPermission) AlertDialog(
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION && u.askPermission) AlertDialog(
|
||||
onDismissRequest = ua.onDismissPermission,
|
||||
title = { Text(stringResource(R.string.upd_perm_title)) },
|
||||
text = {
|
||||
@@ -156,6 +165,14 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m
|
||||
val installBlock = release?.let { AppUpdates.installBlock(it, me) }
|
||||
class Look(val tint: Color, val status: String, val headline: String, val detail: String?)
|
||||
val look = when {
|
||||
BuildConfig.PLAY_DISTRIBUTION -> Look(
|
||||
if (u.playUpdateAvailable == true) AttentionAmber else colors.onSurfaceVariant,
|
||||
stringResource(when {
|
||||
u.checking -> R.string.common_checking
|
||||
u.playUpdateAvailable == true -> R.string.upd_available
|
||||
u.playUpdateAvailable == false -> R.string.upd_current_status
|
||||
else -> R.string.upd_not_checked
|
||||
}), stringResource(R.string.upd_title), null)
|
||||
!me.updatable -> Look(colors.onSurfaceVariant, stringResource(R.string.upd_signed_status), stringResource(R.string.upd_signed_headline),
|
||||
stringResource(R.string.upd_signed_detail))
|
||||
catalog == null -> Look(colors.onSurfaceVariant, if (u.checking) stringResource(R.string.common_checking) else stringResource(R.string.upd_not_checked), stringResource(R.string.upd_title), null)
|
||||
@@ -189,6 +206,9 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m
|
||||
val button = release?.apk?.size?.takeIf { it > 0 }?.let { " · ${megabytes(it)}" }.orEmpty()
|
||||
Box(Modifier.padding(top = 14.dp)) {
|
||||
when {
|
||||
BuildConfig.PLAY_DISTRIBUTION && u.playUpdateAvailable == true ->
|
||||
PrimaryButton(stringResource(R.string.common_update), onClick = ua.onOpenPlay)
|
||||
BuildConfig.PLAY_DISTRIBUTION -> Unit
|
||||
u.stage != null -> Column(Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Text(if (u.percent >= 0) stringResource(R.string.upd_stage_percent, u.stage, u.percent) else stringResource(R.string.upd_stage, u.stage), fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||
if (u.percent >= 0) LinearProgressIndicator(progress = { u.percent / 100f }, modifier = Modifier.fillMaxWidth().height(6.dp).clip(CircleShape))
|
||||
|
||||
@@ -148,6 +148,7 @@ object AppUpdates {
|
||||
}
|
||||
|
||||
fun hasUpdate(catalog: Catalog?, follow: Follow): Boolean {
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) return false
|
||||
if (catalog == null) return false
|
||||
val me = installed()
|
||||
val r = release(catalog, follow) ?: return false
|
||||
@@ -247,6 +248,7 @@ object AppUpdates {
|
||||
}
|
||||
|
||||
fun refresh(context: Context): Catalog {
|
||||
check(!BuildConfig.PLAY_DISTRIBUTION) { "Application updates are managed by Google Play" }
|
||||
val checkedAt = System.currentTimeMillis()
|
||||
val published = JSONObject(get(context, "$CATALOG_URL?checked=$checkedAt"))
|
||||
val catalog = try {
|
||||
|
||||
@@ -21,12 +21,13 @@ object SelfInstaller {
|
||||
const val ACTION_STATUS = "com.droiddeck.launcher.update.INSTALL_STATUS"
|
||||
|
||||
fun canInstall(context: Context): Boolean =
|
||||
Build.VERSION.SDK_INT < 26 || context.packageManager.canRequestPackageInstalls()
|
||||
!BuildConfig.PLAY_DISTRIBUTION && (Build.VERSION.SDK_INT < 26 || context.packageManager.canRequestPackageInstalls())
|
||||
|
||||
fun permissionIntent(context: Context): Intent =
|
||||
Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, Uri.parse("package:${context.packageName}"))
|
||||
|
||||
fun download(context: Context, apk: AppUpdates.Apk, progress: (Int) -> Unit): File {
|
||||
check(!BuildConfig.PLAY_DISTRIBUTION) { "Application updates are managed by Google Play" }
|
||||
val dir = File(context.cacheDir, "updates")
|
||||
dir.listFiles()?.forEach { if (it.name != apk.name) FileUtils.delete(it) }
|
||||
dir.mkdirs()
|
||||
@@ -91,6 +92,7 @@ object SelfInstaller {
|
||||
}
|
||||
|
||||
fun install(context: Context, apk: File, onSession: (Int) -> Unit = {}) {
|
||||
check(!BuildConfig.PLAY_DISTRIBUTION) { "Application updates are managed by Google Play" }
|
||||
val installer = context.packageManager.packageInstaller
|
||||
val params = PackageInstaller.SessionParams(PackageInstaller.SessionParams.MODE_FULL_INSTALL).apply {
|
||||
setAppPackageName(context.packageName)
|
||||
|
||||
@@ -3669,7 +3669,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">غير متاح في Android؟ معلومات التطبيق → ⋮ → السماح بالإعدادات المحظورة</string>
|
||||
<string name="integration_shortcuts_restricted">محظور من Android · معلومات التطبيق → ⋮ → السماح بالإعدادات المحظورة</string>
|
||||
<string name="integration_shortcuts_service">زر الشاشة الرئيسية في DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">يمرّر ضغطات زر الشاشة الرئيسية إلى Steam Guide عندما تكون جلسة Steam في المقدمة ويكون DroidDeck تطبيق الشاشة الرئيسية الافتراضي. لا يقرأ محتوى الشاشة.</string>
|
||||
<string name="integration_shortcuts_service_description">تتيح خدمة تسهيل الاستخدام اختصارات Home/Guide وتكتشف التطبيقات على الشاشة السفلية. تقرأ هذه الخدمة أسماء حزم التطبيقات وحدود النوافذ محليًا. ولا تقرأ النصوص أو تلتقط الشاشة أو ترسل هذه البيانات.</string>
|
||||
<string name="integration_brightness_needed">فعّل «السطوع» من الإعداد → تكامل Steam</string>
|
||||
<string name="apps_search_hint">البحث في التطبيقات</string>
|
||||
<string name="apps_no_match">لا توجد تطبيقات تطابق ”%1$s“.</string>
|
||||
@@ -3799,4 +3799,5 @@
|
||||
<string name="bottom_strip_cpu_temp">درجة حرارة المعالج</string>
|
||||
<string name="stats_hud_battery_temp">البطارية</string>
|
||||
<string name="stats_hud_game_cores">لعبة</string>
|
||||
<string name="setup_privacy_policy">سياسة الخصوصية</string>
|
||||
</resources>
|
||||
@@ -3534,7 +3534,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">¿Aparece en gris en Android? Información de la app → ⋮ → Permitir configuración restringida</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqueado por Android · Información de la app → ⋮ → Permitir configuración restringida</string>
|
||||
<string name="integration_shortcuts_service">Botón de inicio de DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Pasa las pulsaciones del botón de inicio a Steam Guide mientras una sesión de Steam está en primer plano y DroidDeck es la app de inicio predeterminada. No lee el contenido de la pantalla.</string>
|
||||
<string name="integration_shortcuts_service_description">El servicio de accesibilidad permite usar atajos Home/Guide y detecta apps en la pantalla inferior. Lee los nombres de los paquetes de las apps y los límites de las ventanas de forma local. No lee texto, captura pantallas ni envía estos datos.</string>
|
||||
<string name="integration_brightness_needed">Activa Brillo en Configuración → Integración con Steam</string>
|
||||
<string name="apps_search_hint">Buscar apps</string>
|
||||
<string name="apps_no_match">Ninguna app coincide con «%1$s».</string>
|
||||
@@ -3661,4 +3661,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Temperatura de CPU</string>
|
||||
<string name="stats_hud_battery_temp">Batería</string>
|
||||
<string name="stats_hud_game_cores">Juego</string>
|
||||
<string name="setup_privacy_policy">Política de privacidad</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Неактивно в Android? Информация за приложението → ⋮ → Разрешаване на ограничените настройки</string>
|
||||
<string name="integration_shortcuts_restricted">Блокирано от Android · Информация за приложението → ⋮ → Разрешаване на ограничените настройки</string>
|
||||
<string name="integration_shortcuts_service">Бутон за начален екран на DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Предава натисканията на бутона за начален екран към Steam Guide, докато сесия на Steam е на фокус и DroidDeck е приложението за начален екран по подразбиране. Не чете съдържанието на екрана.</string>
|
||||
<string name="integration_shortcuts_service_description">Услугата за достъпност позволява преки пътища Home/Guide и открива приложения на долния екран. Тя чете локално имената на пакетите на приложенията и границите на прозорците. Не чете текст, не заснема екрани и не изпраща тези данни.</string>
|
||||
<string name="integration_brightness_needed">Включете „Яркост“ в Настройка → Интеграция със Steam</string>
|
||||
<string name="apps_search_hint">Търсене на приложения</string>
|
||||
<string name="apps_no_match">Няма приложения, отговарящи на „%1$s“.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Температура на CPU</string>
|
||||
<string name="stats_hud_battery_temp">Батерия</string>
|
||||
<string name="stats_hud_game_cores">Игра</string>
|
||||
<string name="setup_privacy_policy">Политика за поверителност</string>
|
||||
</resources>
|
||||
@@ -3597,7 +3597,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">V Androidu zašedlé? Informace o aplikaci → ⋮ → Povolit omezená nastavení</string>
|
||||
<string name="integration_shortcuts_restricted">Blokováno Androidem · Informace o aplikaci → ⋮ → Povolit omezená nastavení</string>
|
||||
<string name="integration_shortcuts_service">Tlačítko Domů pro DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Předává stisky tlačítka Domů do Steam Guide, když je aktivní relace Steamu a DroidDeck je výchozí aplikací domovské obrazovky. Nečte obsah obrazovky.</string>
|
||||
<string name="integration_shortcuts_service_description">Služba usnadnění umožňuje zkratky Home/Guide a rozpoznává aplikace na spodní obrazovce. Místně čte názvy balíčků aplikací a hranice oken. Nečte text, nesnímá obrazovky ani tyto údaje neodesílá.</string>
|
||||
<string name="integration_brightness_needed">Zapněte Jas v Příprava → Integrace se Steamem</string>
|
||||
<string name="apps_search_hint">Hledat aplikace</string>
|
||||
<string name="apps_no_match">Výrazu „%1$s“ neodpovídá žádná aplikace.</string>
|
||||
@@ -3725,4 +3725,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Teplota CPU</string>
|
||||
<string name="stats_hud_battery_temp">Baterie</string>
|
||||
<string name="stats_hud_game_cores">Hra</string>
|
||||
<string name="setup_privacy_policy">Zásady ochrany osobních údajů</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Nedtonet i Android? Appinfo → ⋮ → Tillad begrænsede indstillinger</string>
|
||||
<string name="integration_shortcuts_restricted">Blokeret af Android · Appinfo → ⋮ → Tillad begrænsede indstillinger</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck Hjem-knap</string>
|
||||
<string name="integration_shortcuts_service_description">Sender tryk på Hjem-knappen til Steam Guide, mens en Steam-session er i fokus, og DroidDeck er standardstartskærmen. Læser ikke skærmindhold.</string>
|
||||
<string name="integration_shortcuts_service_description">Tilgængelighedstjenesten muliggør Home/Guide-genveje og registrerer apps på den nederste skærm. Tjenesten læser appenes pakkenavne og vinduesgrænser lokalt. Den læser ikke tekst, tager ikke skærmbilleder og sender ikke disse data.</string>
|
||||
<string name="integration_brightness_needed">Slå Lysstyrke til under Opsætning → Steam-integration</string>
|
||||
<string name="apps_search_hint">Søg i apps</string>
|
||||
<string name="apps_no_match">Ingen apps matcher “%1$s”.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU-temperatur</string>
|
||||
<string name="stats_hud_battery_temp">Batteri</string>
|
||||
<string name="stats_hud_game_cores">Spil</string>
|
||||
<string name="setup_privacy_policy">Privatlivspolitik</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">In Android ausgegraut? App-Info → ⋮ → Eingeschränkte Einstellungen zulassen</string>
|
||||
<string name="integration_shortcuts_restricted">Von Android blockiert · App-Info → ⋮ → Eingeschränkte Einstellungen zulassen</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck-Home-Taste</string>
|
||||
<string name="integration_shortcuts_service_description">Leitet Drücke der Home-Taste an Steam Guide weiter, während eine Steam-Sitzung im Fokus ist und DroidDeck die Standard-Startbildschirm-App ist. Liest keine Bildschirminhalte.</string>
|
||||
<string name="integration_shortcuts_service_description">Der Bedienungshilfedienst ermöglicht Home/Guide-Tastenkürzel und erkennt Apps auf dem unteren Bildschirm. Er liest App-Paketnamen und Fenstergrenzen lokal aus. Er liest keine Texte, nimmt keine Bildschirme auf und überträgt diese Daten nicht.</string>
|
||||
<string name="integration_brightness_needed">Aktiviere Helligkeit unter Einrichtung → Steam-Integration</string>
|
||||
<string name="apps_search_hint">Apps durchsuchen</string>
|
||||
<string name="apps_no_match">Keine Apps passen zu „%1$s“.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU-Temperatur</string>
|
||||
<string name="stats_hud_battery_temp">Akku</string>
|
||||
<string name="stats_hud_game_cores">Spiel</string>
|
||||
<string name="setup_privacy_policy">Datenschutzerklärung</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Γκρίζο στο Android; Πληροφορίες εφαρμογής → ⋮ → Να επιτρέπονται οι περιορισμένες ρυθμίσεις</string>
|
||||
<string name="integration_shortcuts_restricted">Αποκλείεται από το Android · Πληροφορίες εφαρμογής → ⋮ → Να επιτρέπονται οι περιορισμένες ρυθμίσεις</string>
|
||||
<string name="integration_shortcuts_service">Κουμπί Αρχικής DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Μεταβιβάζει τα πατήματα του κουμπιού Αρχικής στο Steam Guide όσο μια συνεδρία Steam είναι εστιασμένη και το DroidDeck είναι η προεπιλεγμένη εφαρμογή Αρχικής. Δεν διαβάζει το περιεχόμενο της οθόνης.</string>
|
||||
<string name="integration_shortcuts_service_description">Η υπηρεσία προσβασιμότητας ενεργοποιεί συντομεύσεις Home/Guide και εντοπίζει εφαρμογές στην κάτω οθόνη. Διαβάζει τοπικά ονόματα πακέτων εφαρμογών και όρια παραθύρων. Δεν διαβάζει κείμενο, δεν καταγράφει οθόνες και δεν αποστέλλει αυτά τα δεδομένα.</string>
|
||||
<string name="integration_brightness_needed">Ενεργοποιήστε τη Φωτεινότητα στη Ρύθμιση → Ενσωμάτωση Steam</string>
|
||||
<string name="apps_search_hint">Αναζήτηση εφαρμογών</string>
|
||||
<string name="apps_no_match">Καμία εφαρμογή δεν ταιριάζει με «%1$s».</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Θερμοκρασία CPU</string>
|
||||
<string name="stats_hud_battery_temp">Μπαταρία</string>
|
||||
<string name="stats_hud_game_cores">Παιχνίδι</string>
|
||||
<string name="setup_privacy_policy">Πολιτική απορρήτου</string>
|
||||
</resources>
|
||||
@@ -3561,7 +3561,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">¿Aparece en gris en Android? Información de la aplicación → ⋮ → Permitir ajustes restringidos</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqueado por Android · Información de la aplicación → ⋮ → Permitir ajustes restringidos</string>
|
||||
<string name="integration_shortcuts_service">Botón de inicio de DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Pasa las pulsaciones del botón de inicio a Steam Guide mientras una sesión de Steam está en primer plano y DroidDeck es la app de inicio predeterminada. No lee el contenido de la pantalla.</string>
|
||||
<string name="integration_shortcuts_service_description">El servicio de accesibilidad permite usar atajos Home/Guide y detecta aplicaciones en la pantalla inferior. Lee los nombres de los paquetes de las aplicaciones y los límites de las ventanas de forma local. No lee texto, captura pantallas ni envía estos datos.</string>
|
||||
<string name="integration_brightness_needed">Activa Brillo en Configuración → Integración con Steam</string>
|
||||
<string name="apps_search_hint">Buscar aplicaciones</string>
|
||||
<string name="apps_no_match">Ninguna aplicación coincide con «%1$s».</string>
|
||||
@@ -3688,4 +3688,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Temperatura de CPU</string>
|
||||
<string name="stats_hud_battery_temp">Batería</string>
|
||||
<string name="stats_hud_game_cores">Juego</string>
|
||||
<string name="setup_privacy_policy">Política de privacidad</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Harmaana Androidissa? Sovelluksen tiedot → ⋮ → Salli rajoitetut asetukset</string>
|
||||
<string name="integration_shortcuts_restricted">Androidin estämä · Sovelluksen tiedot → ⋮ → Salli rajoitetut asetukset</string>
|
||||
<string name="integration_shortcuts_service">DroidDeckin Koti-painike</string>
|
||||
<string name="integration_shortcuts_service_description">Välittää Koti-painikkeen painallukset Steam Guidelle, kun Steam-istunto on aktiivinen ja DroidDeck on oletusaloitusnäyttösovellus. Ei lue näytön sisältöä.</string>
|
||||
<string name="integration_shortcuts_service_description">Esteettömyyspalvelu mahdollistaa Home/Guide-pikanäppäimet ja tunnistaa alemman näytön sovellukset. Se lukee sovellusten pakettien nimet ja ikkunoiden rajat paikallisesti. Se ei lue tekstiä, tallenna näyttökuvia eikä lähetä näitä tietoja.</string>
|
||||
<string name="integration_brightness_needed">Ota Kirkkaus käyttöön kohdassa Käyttöönotto → Steam-integraatio</string>
|
||||
<string name="apps_search_hint">Hae sovelluksia</string>
|
||||
<string name="apps_no_match">Mikään sovellus ei vastaa hakua ”%1$s”.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU:n lämpötila</string>
|
||||
<string name="stats_hud_battery_temp">Akku</string>
|
||||
<string name="stats_hud_game_cores">Peli</string>
|
||||
<string name="setup_privacy_policy">Tietosuojakäytäntö</string>
|
||||
</resources>
|
||||
@@ -3561,7 +3561,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Grisé dans Android ? Infos sur l\'appli → ⋮ → Autoriser les paramètres restreints</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqué par Android · Infos sur l\'appli → ⋮ → Autoriser les paramètres restreints</string>
|
||||
<string name="integration_shortcuts_service">Bouton Accueil DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Transmet les appuis sur le bouton Accueil à Steam Guide lorsqu\'une session Steam est au premier plan et que DroidDeck est l\'application d\'écran d\'accueil par défaut. Ne lit pas le contenu de l\'écran.</string>
|
||||
<string name="integration_shortcuts_service_description">Le service d’accessibilité permet les raccourcis Home/Guide et détecte les applications sur l’écran inférieur. Il lit localement les noms des paquets et les limites des fenêtres. Il ne lit aucun texte, ne capture pas les écrans et ne transmet pas ces données.</string>
|
||||
<string name="integration_brightness_needed">Activez Luminosité dans Paramètres → Intégration Steam</string>
|
||||
<string name="apps_search_hint">Rechercher des applications</string>
|
||||
<string name="apps_no_match">Aucune application ne correspond à « %1$s ».</string>
|
||||
@@ -3688,4 +3688,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Température du processeur</string>
|
||||
<string name="stats_hud_battery_temp">Batterie</string>
|
||||
<string name="stats_hud_game_cores">Jeu</string>
|
||||
<string name="setup_privacy_policy">Politique de confidentialité</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Android में धूसर है? ऐप्लिकेशन की जानकारी → ⋮ → प्रतिबंधित सेटिंग की अनुमति दें</string>
|
||||
<string name="integration_shortcuts_restricted">Android ने ब्लॉक किया · ऐप्लिकेशन की जानकारी → ⋮ → प्रतिबंधित सेटिंग की अनुमति दें</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck होम बटन</string>
|
||||
<string name="integration_shortcuts_service_description">जब Steam सेशन फ़ोकस में हो और DroidDeck डिफ़ॉल्ट होम ऐप हो, तब होम बटन दबाने को Steam Guide तक भेजता है। स्क्रीन की सामग्री नहीं पढ़ता।</string>
|
||||
<string name="integration_shortcuts_service_description">सुलभता सेवा Home/Guide शॉर्टकट सक्षम करती है और निचली स्क्रीन पर ऐप्स का पता लगाती है। यह सेवा ऐप पैकेज के नाम और विंडो की सीमाएँ डिवाइस पर ही पढ़ती है। यह टेक्स्ट नहीं पढ़ती, स्क्रीन कैप्चर नहीं करती और यह डेटा नहीं भेजती।</string>
|
||||
<string name="integration_brightness_needed">Setup → Steam इंटीग्रेशन में ब्राइटनेस चालू करें</string>
|
||||
<string name="apps_search_hint">ऐप खोजें</string>
|
||||
<string name="apps_no_match">“%1$s” से कोई ऐप मेल नहीं खाता।</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU तापमान</string>
|
||||
<string name="stats_hud_battery_temp">बैटरी</string>
|
||||
<string name="stats_hud_game_cores">गेम</string>
|
||||
<string name="setup_privacy_policy">निजता नीति</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Szürke az Androidban? Alkalmazásinformáció → ⋮ → Korlátozott beállítások engedélyezése</string>
|
||||
<string name="integration_shortcuts_restricted">Az Android letiltotta · Alkalmazásinformáció → ⋮ → Korlátozott beállítások engedélyezése</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck Kezdőképernyő gomb</string>
|
||||
<string name="integration_shortcuts_service_description">A Kezdőképernyő gomb lenyomásait továbbítja a Steam Guide-nak, amíg egy Steam-munkamenet van fókuszban, és a DroidDeck az alapértelmezett kezdőképernyő alkalmazás. Nem olvassa a képernyő tartalmát.</string>
|
||||
<string name="integration_shortcuts_service_description">A kisegítő szolgáltatás lehetővé teszi a Home/Guide billentyűparancsokat, és felismeri az alsó képernyőn futó alkalmazásokat. Helyben olvassa az alkalmazáscsomagok nevét és az ablakok határait. Nem olvas szöveget, nem rögzíti a képernyőt, és nem továbbítja ezeket az adatokat.</string>
|
||||
<string name="integration_brightness_needed">Kapcsolja be a Fényerőt itt: Beállítás → Steam-integráció</string>
|
||||
<string name="apps_search_hint">Alkalmazások keresése</string>
|
||||
<string name="apps_no_match">Egy alkalmazás sem felel meg ennek: „%1$s”.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU-hőmérséklet</string>
|
||||
<string name="stats_hud_battery_temp">Akkumulátor</string>
|
||||
<string name="stats_hud_game_cores">Játék</string>
|
||||
<string name="setup_privacy_policy">Adatvédelmi szabályzat</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Berwarna abu-abu di Android? Info aplikasi → ⋮ → Izinkan setelan terbatas</string>
|
||||
<string name="integration_shortcuts_restricted">Diblokir oleh Android · Info aplikasi → ⋮ → Izinkan setelan terbatas</string>
|
||||
<string name="integration_shortcuts_service">Tombol Home DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Meneruskan tekanan tombol Home ke Steam Guide saat sesi Steam sedang aktif dan DroidDeck adalah aplikasi Beranda default. Tidak membaca konten layar.</string>
|
||||
<string name="integration_shortcuts_service_description">Layanan aksesibilitas mengaktifkan pintasan Home/Guide dan mendeteksi aplikasi di layar bawah. Layanan ini membaca nama paket aplikasi dan batas jendela secara lokal. Layanan ini tidak membaca teks, merekam layar, atau mengirimkan data tersebut.</string>
|
||||
<string name="integration_brightness_needed">Aktifkan Kecerahan di Penyiapan → Integrasi Steam</string>
|
||||
<string name="apps_search_hint">Cari aplikasi</string>
|
||||
<string name="apps_no_match">Tidak ada aplikasi yang cocok dengan “%1$s”.</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Suhu CPU</string>
|
||||
<string name="stats_hud_battery_temp">Baterai</string>
|
||||
<string name="stats_hud_game_cores">Permainan</string>
|
||||
<string name="setup_privacy_policy">Kebijakan privasi</string>
|
||||
</resources>
|
||||
@@ -3561,7 +3561,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Disattivato in grigio su Android? Informazioni app → ⋮ → Consenti impostazioni con limitazioni</string>
|
||||
<string name="integration_shortcuts_restricted">Bloccato da Android · Informazioni app → ⋮ → Consenti impostazioni con limitazioni</string>
|
||||
<string name="integration_shortcuts_service">Tasto Home di DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Inoltra le pressioni del tasto Home a Steam Guide mentre una sessione Steam è in primo piano e DroidDeck è l\'app Home predefinita. Non legge il contenuto dello schermo.</string>
|
||||
<string name="integration_shortcuts_service_description">Il servizio di accessibilità abilita le scorciatoie Home/Guide e rileva le app sullo schermo inferiore. Legge localmente i nomi dei pacchetti delle app e i limiti delle finestre. Non legge testi, non acquisisce schermate e non invia questi dati.</string>
|
||||
<string name="integration_brightness_needed">Attiva Luminosità in Configurazione → Integrazione con Steam</string>
|
||||
<string name="apps_search_hint">Cerca app</string>
|
||||
<string name="apps_no_match">Nessuna app corrisponde a «%1$s».</string>
|
||||
@@ -3688,4 +3688,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Temperatura CPU</string>
|
||||
<string name="stats_hud_battery_temp">Batteria</string>
|
||||
<string name="stats_hud_game_cores">Gioco</string>
|
||||
<string name="setup_privacy_policy">Informativa sulla privacy</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Androidでグレー表示されていますか?アプリ情報 → ⋮ → 制限付き設定を許可</string>
|
||||
<string name="integration_shortcuts_restricted">Androidによってブロックされています · アプリ情報 → ⋮ → 制限付き設定を許可</string>
|
||||
<string name="integration_shortcuts_service">DroidDeckホームボタン</string>
|
||||
<string name="integration_shortcuts_service_description">Steamセッションがフォーカスされ、DroidDeckがデフォルトのホームアプリの場合に、ホームボタンの操作をSteamガイドに渡します。画面のコンテンツは読み取りません。</string>
|
||||
<string name="integration_shortcuts_service_description">ユーザー補助サービスはHome/Guideショートカットを有効にし、下側の画面にあるアプリを検出します。アプリのパッケージ名とウィンドウの範囲を端末内で読み取ります。テキストの読み取り、画面のキャプチャ、これらのデータの送信は行いません。</string>
|
||||
<string name="integration_brightness_needed">「セットアップ」→「Steam連携」で明るさをオンにしてください</string>
|
||||
<string name="apps_search_hint">アプリを検索</string>
|
||||
<string name="apps_no_match">「%1$s」に一致するアプリはありません。</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU温度</string>
|
||||
<string name="stats_hud_battery_temp">バッテリー</string>
|
||||
<string name="stats_hud_game_cores">ゲーム</string>
|
||||
<string name="setup_privacy_policy">プライバシーポリシー</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Android에서 회색으로 표시되나요? 앱 정보 → ⋮ → 제한된 설정 허용</string>
|
||||
<string name="integration_shortcuts_restricted">Android에서 차단됨 · 앱 정보 → ⋮ → 제한된 설정 허용</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck 홈 버튼</string>
|
||||
<string name="integration_shortcuts_service_description">Steam 세션에 포커스가 있고 DroidDeck이 기본 홈 앱일 때 홈 버튼 입력을 Steam Guide로 전달합니다. 화면 콘텐츠는 읽지 않습니다.</string>
|
||||
<string name="integration_shortcuts_service_description">접근성 서비스는 Home/Guide 단축키를 활성화하고 아래쪽 화면의 앱을 감지합니다. 이 서비스는 기기 내에서 앱 패키지 이름과 창 경계를 읽습니다. 텍스트를 읽거나 화면을 캡처하거나 이 데이터를 전송하지 않습니다.</string>
|
||||
<string name="integration_brightness_needed">설정 → Steam 연동에서 밝기를 켜세요</string>
|
||||
<string name="apps_search_hint">앱 검색</string>
|
||||
<string name="apps_no_match">‘%1$s’와(과) 일치하는 앱이 없습니다.</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU 온도</string>
|
||||
<string name="stats_hud_battery_temp">배터리</string>
|
||||
<string name="stats_hud_game_cores">게임</string>
|
||||
<string name="setup_privacy_policy">개인정보처리방침</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Dikelabukan dalam Android? Maklumat apl → ⋮ → Benarkan tetapan terhad</string>
|
||||
<string name="integration_shortcuts_restricted">Disekat oleh Android · Maklumat apl → ⋮ → Benarkan tetapan terhad</string>
|
||||
<string name="integration_shortcuts_service">Butang Laman Utama DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Menghantar tekanan butang Laman Utama kepada Steam Guide semasa sesi Steam difokuskan dan DroidDeck ialah apl Laman Utama lalai. Tidak membaca kandungan skrin.</string>
|
||||
<string name="integration_shortcuts_service_description">Perkhidmatan kebolehcapaian mengaktifkan pintasan Home/Guide dan mengesan aplikasi pada skrin bawah. Perkhidmatan ini membaca nama pakej aplikasi dan sempadan tetingkap secara setempat. Ia tidak membaca teks, menangkap skrin atau menghantar data ini.</string>
|
||||
<string name="integration_brightness_needed">Hidupkan Kecerahan dalam Persediaan → Integrasi Steam</string>
|
||||
<string name="apps_search_hint">Cari apl</string>
|
||||
<string name="apps_no_match">Tiada apl sepadan dengan “%1$s”.</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Suhu CPU</string>
|
||||
<string name="stats_hud_battery_temp">Bateri</string>
|
||||
<string name="stats_hud_game_cores">Permainan</string>
|
||||
<string name="setup_privacy_policy">Dasar privasi</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Nedtonet i Android? Appinfo → ⋮ → Tillat begrensede innstillinger</string>
|
||||
<string name="integration_shortcuts_restricted">Blokkert av Android · Appinfo → ⋮ → Tillat begrensede innstillinger</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck Hjem-knapp</string>
|
||||
<string name="integration_shortcuts_service_description">Sender trykk på Hjem-knappen til Steam Guide mens en Steam-sesjon er i fokus og DroidDeck er standard startskjerm-app. Leser ikke skjerminnhold.</string>
|
||||
<string name="integration_shortcuts_service_description">Tilgjengelighetstjenesten aktiverer Home/Guide-snarveier og oppdager apper på den nederste skjermen. Den leser appenes pakkenavn og vindusgrenser lokalt. Den leser ikke tekst, tar ikke skjermbilder og sender ikke disse dataene.</string>
|
||||
<string name="integration_brightness_needed">Slå på Lysstyrke i Oppsett → Steam-integrering</string>
|
||||
<string name="apps_search_hint">Søk i apper</string>
|
||||
<string name="apps_no_match">Ingen apper samsvarer med «%1$s».</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU-temperatur</string>
|
||||
<string name="stats_hud_battery_temp">Batteri</string>
|
||||
<string name="stats_hud_game_cores">Spill</string>
|
||||
<string name="setup_privacy_policy">Personvernerklæring</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Grijs in Android? App-info → ⋮ → Beperkte instellingen toestaan</string>
|
||||
<string name="integration_shortcuts_restricted">Geblokkeerd door Android · App-info → ⋮ → Beperkte instellingen toestaan</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck-startknop</string>
|
||||
<string name="integration_shortcuts_service_description">Geeft drukken op de startknop door aan Steam Guide terwijl een Steam-sessie actief is en DroidDeck de standaard startscherm-app is. Leest geen scherminhoud.</string>
|
||||
<string name="integration_shortcuts_service_description">De toegankelijkheidsservice maakt Home/Guide-sneltoetsen mogelijk en detecteert apps op het onderste scherm. De service leest pakketnamen van apps en venstergrenzen lokaal. De service leest geen tekst, maakt geen schermopnamen en verzendt deze gegevens niet.</string>
|
||||
<string name="integration_brightness_needed">Zet Helderheid aan in Installatie → Steam-integratie</string>
|
||||
<string name="apps_search_hint">Apps zoeken</string>
|
||||
<string name="apps_no_match">Geen apps gevonden voor ‘%1$s’.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU-temperatuur</string>
|
||||
<string name="stats_hud_battery_temp">Accu</string>
|
||||
<string name="stats_hud_game_cores">Spel</string>
|
||||
<string name="setup_privacy_policy">Privacybeleid</string>
|
||||
</resources>
|
||||
@@ -3597,7 +3597,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Wyszarzone w Androidzie? Informacje o aplikacji → ⋮ → Zezwól na ustawienia z ograniczeniami</string>
|
||||
<string name="integration_shortcuts_restricted">Zablokowane przez Androida · Informacje o aplikacji → ⋮ → Zezwól na ustawienia z ograniczeniami</string>
|
||||
<string name="integration_shortcuts_service">Przycisk ekranu głównego DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Przekazuje naciśnięcia przycisku ekranu głównego do Steam Guide, gdy aktywna jest sesja Steam, a DroidDeck jest domyślną aplikacją ekranu głównego. Nie odczytuje zawartości ekranu.</string>
|
||||
<string name="integration_shortcuts_service_description">Usługa ułatwień dostępu włącza skróty Home/Guide i wykrywa aplikacje na dolnym ekranie. Lokalnie odczytuje nazwy pakietów aplikacji i granice okien. Nie odczytuje tekstu, nie przechwytuje obrazu ekranu ani nie wysyła tych danych.</string>
|
||||
<string name="integration_brightness_needed">Włącz Jasność w Konfiguracja → Integracja ze Steam</string>
|
||||
<string name="apps_search_hint">Szukaj aplikacji</string>
|
||||
<string name="apps_no_match">Żadna aplikacja nie pasuje do „%1$s”.</string>
|
||||
@@ -3725,4 +3725,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Temperatura CPU</string>
|
||||
<string name="stats_hud_battery_temp">Bateria</string>
|
||||
<string name="stats_hud_game_cores">Gra</string>
|
||||
<string name="setup_privacy_policy">Polityka prywatności</string>
|
||||
</resources>
|
||||
@@ -3561,7 +3561,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Desativado a cinzento no Android? Informações da aplicação → ⋮ → Permitir definições restritas</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqueado pelo Android · Informações da aplicação → ⋮ → Permitir definições restritas</string>
|
||||
<string name="integration_shortcuts_service">Botão Página inicial do DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Envia os toques no botão Página inicial para o Guide do Steam enquanto uma sessão do Steam está em foco e o DroidDeck é a app de página inicial predefinida. Não lê o conteúdo do ecrã.</string>
|
||||
<string name="integration_shortcuts_service_description">O serviço de acessibilidade ativa os atalhos Home/Guide e deteta aplicações no ecrã inferior. Lê localmente os nomes dos pacotes das aplicações e os limites das janelas. Não lê texto, não captura ecrãs nem envia estes dados.</string>
|
||||
<string name="integration_brightness_needed">Ative Brilho em Configuração → Integração com o Steam</string>
|
||||
<string name="apps_search_hint">Pesquisar aplicações</string>
|
||||
<string name="apps_no_match">Nenhuma aplicação corresponde a “%1$s”.</string>
|
||||
@@ -3688,4 +3688,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Temperatura da CPU</string>
|
||||
<string name="stats_hud_battery_temp">Bateria</string>
|
||||
<string name="stats_hud_game_cores">Jogo</string>
|
||||
<string name="setup_privacy_policy">Política de privacidade</string>
|
||||
</resources>
|
||||
@@ -3561,7 +3561,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Esmaecido no Android? Informações do app → ⋮ → Permitir configurações restritas</string>
|
||||
<string name="integration_shortcuts_restricted">Bloqueado pelo Android · Informações do app → ⋮ → Permitir configurações restritas</string>
|
||||
<string name="integration_shortcuts_service">Botão Início do DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Repassa os toques no botão Início para o Guide da Steam enquanto uma sessão da Steam está em foco e o DroidDeck é o app de tela inicial padrão. Não lê o conteúdo da tela.</string>
|
||||
<string name="integration_shortcuts_service_description">O serviço de acessibilidade ativa os atalhos Home/Guide e detecta apps na tela inferior. Ele lê os nomes dos pacotes dos apps e os limites das janelas localmente. Não lê textos, não captura telas nem envia esses dados.</string>
|
||||
<string name="integration_brightness_needed">Ative Brilho em Configuração → Integração com a Steam</string>
|
||||
<string name="apps_search_hint">Pesquisar apps</string>
|
||||
<string name="apps_no_match">Nenhum app corresponde a “%1$s”.</string>
|
||||
@@ -3688,4 +3688,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Temperatura da CPU</string>
|
||||
<string name="stats_hud_battery_temp">Bateria</string>
|
||||
<string name="stats_hud_game_cores">Jogo</string>
|
||||
<string name="setup_privacy_policy">Política de privacidade</string>
|
||||
</resources>
|
||||
@@ -3561,7 +3561,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Inactiv în Android? Informații despre aplicație → ⋮ → Permite setările restricționate</string>
|
||||
<string name="integration_shortcuts_restricted">Blocat de Android · Informații despre aplicație → ⋮ → Permite setările restricționate</string>
|
||||
<string name="integration_shortcuts_service">Butonul Acasă DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Transmite apăsările butonului Acasă către Steam Guide cât timp o sesiune Steam este activă și DroidDeck este aplicația Acasă implicită. Nu citește conținutul ecranului.</string>
|
||||
<string name="integration_shortcuts_service_description">Serviciul de accesibilitate activează comenzile rapide Home/Guide și detectează aplicațiile de pe ecranul inferior. Citește local numele pachetelor aplicațiilor și limitele ferestrelor. Nu citește text, nu capturează ecrane și nu trimite aceste date.</string>
|
||||
<string name="integration_brightness_needed">Activează Luminozitate în Configurare → Integrare Steam</string>
|
||||
<string name="apps_search_hint">Caută aplicații</string>
|
||||
<string name="apps_no_match">Nicio aplicație nu se potrivește cu „%1$s”.</string>
|
||||
@@ -3688,4 +3688,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Temperatura CPU</string>
|
||||
<string name="stats_hud_battery_temp">Baterie</string>
|
||||
<string name="stats_hud_game_cores">Joc</string>
|
||||
<string name="setup_privacy_policy">Politica de confidențialitate</string>
|
||||
</resources>
|
||||
@@ -3597,7 +3597,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Неактивно в Android? «О приложении» → ⋮ → «Разрешить доступ к настройкам с ограниченным доступом»</string>
|
||||
<string name="integration_shortcuts_restricted">Заблокировано Android · «О приложении» → ⋮ → «Разрешить доступ к настройкам с ограниченным доступом»</string>
|
||||
<string name="integration_shortcuts_service">Кнопка «Домой» DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Передаёт нажатия кнопки «Домой» в Steam Guide, пока активна сессия Steam и DroidDeck является главным экраном по умолчанию. Не считывает содержимое экрана.</string>
|
||||
<string name="integration_shortcuts_service_description">Служба специальных возможностей включает сочетания Home/Guide и определяет приложения на нижнем экране. Она локально считывает имена пакетов приложений и границы окон. Служба не читает текст, не записывает экран и не передаёт эти данные.</string>
|
||||
<string name="integration_brightness_needed">Включите «Яркость» в «Настройка → Интеграция со Steam»</string>
|
||||
<string name="apps_search_hint">Поиск приложений</string>
|
||||
<string name="apps_no_match">Нет приложений по запросу «%1$s».</string>
|
||||
@@ -3725,4 +3725,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Температура ЦП</string>
|
||||
<string name="stats_hud_battery_temp">Батарея</string>
|
||||
<string name="stats_hud_game_cores">Игра</string>
|
||||
<string name="setup_privacy_policy">Политика конфиденциальности</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Nedtonat i Android? Appinfo → ⋮ → Tillåt begränsade inställningar</string>
|
||||
<string name="integration_shortcuts_restricted">Blockerat av Android · Appinfo → ⋮ → Tillåt begränsade inställningar</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck hemknapp</string>
|
||||
<string name="integration_shortcuts_service_description">Skickar tryck på hemknappen till Steam Guide medan en Steam-session är i fokus och DroidDeck är standardappen för startskärmen. Läser inte skärminnehåll.</string>
|
||||
<string name="integration_shortcuts_service_description">Tillgänglighetstjänsten aktiverar Home/Guide-genvägar och upptäcker appar på den nedre skärmen. Den läser apparnas paketnamn och fönstergränser lokalt. Den läser inte text, tar inte skärmbilder och skickar inte dessa data.</string>
|
||||
<string name="integration_brightness_needed">Slå på Ljusstyrka under Konfiguration → Steam-integration</string>
|
||||
<string name="apps_search_hint">Sök appar</string>
|
||||
<string name="apps_no_match">Inga appar matchar ”%1$s”.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU-temperatur</string>
|
||||
<string name="stats_hud_battery_temp">Batteri</string>
|
||||
<string name="stats_hud_game_cores">Spel</string>
|
||||
<string name="setup_privacy_policy">Integritetspolicy</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">เป็นสีเทาใน Android? ข้อมูลแอป → ⋮ → อนุญาตการตั้งค่าที่จำกัด</string>
|
||||
<string name="integration_shortcuts_restricted">ถูกบล็อกโดย Android · ข้อมูลแอป → ⋮ → อนุญาตการตั้งค่าที่จำกัด</string>
|
||||
<string name="integration_shortcuts_service">ปุ่มหน้าหลัก DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">ส่งการกดปุ่มหน้าหลักไปยัง Steam Guide ขณะเซสชัน Steam อยู่ในโฟกัสและ DroidDeck เป็นแอปหน้าหลักเริ่มต้น ไม่อ่านเนื้อหาบนหน้าจอ</string>
|
||||
<string name="integration_shortcuts_service_description">บริการการช่วยเหลือพิเศษเปิดใช้ทางลัด Home/Guide และตรวจจับแอปบนหน้าจอด้านล่าง บริการนี้อ่านชื่อแพ็กเกจแอปและขอบเขตหน้าต่างภายในอุปกรณ์เท่านั้น โดยไม่อ่านข้อความ ไม่จับภาพหน้าจอ และไม่ส่งข้อมูลเหล่านี้</string>
|
||||
<string name="integration_brightness_needed">เปิดความสว่างในการตั้งค่า → การผสานรวม Steam</string>
|
||||
<string name="apps_search_hint">ค้นหาแอป</string>
|
||||
<string name="apps_no_match">ไม่มีแอปที่ตรงกับ “%1$s”</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">อุณหภูมิ CPU</string>
|
||||
<string name="stats_hud_battery_temp">แบตเตอรี่</string>
|
||||
<string name="stats_hud_game_cores">เกม</string>
|
||||
<string name="setup_privacy_policy">นโยบายความเป็นส่วนตัว</string>
|
||||
</resources>
|
||||
@@ -3525,7 +3525,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Android\'de gri mi görünüyor? Uygulama bilgileri → ⋮ → Kısıtlanmış ayarlara izin ver</string>
|
||||
<string name="integration_shortcuts_restricted">Android tarafından engellendi · Uygulama bilgileri → ⋮ → Kısıtlanmış ayarlara izin ver</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck Ana ekran düğmesi</string>
|
||||
<string name="integration_shortcuts_service_description">Bir Steam oturumu odaktayken ve DroidDeck varsayılan Ana ekran uygulamasıyken Ana ekran düğmesine basışları Steam Guide\'a iletir. Ekran içeriğini okumaz.</string>
|
||||
<string name="integration_shortcuts_service_description">Erişilebilirlik hizmeti Home/Guide kısayollarını etkinleştirir ve alt ekrandaki uygulamaları algılar. Uygulama paket adlarını ve pencere sınırlarını cihazda okur. Metin okumaz, ekran görüntüsü almaz veya bu verileri göndermez.</string>
|
||||
<string name="integration_brightness_needed">Kurulum → Steam entegrasyonu bölümünde Parlaklık\'ı açın</string>
|
||||
<string name="apps_search_hint">Uygulama ara</string>
|
||||
<string name="apps_no_match">“%1$s” ile eşleşen uygulama yok.</string>
|
||||
@@ -3651,4 +3651,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU sıcaklığı</string>
|
||||
<string name="stats_hud_battery_temp">Pil</string>
|
||||
<string name="stats_hud_game_cores">Oyun</string>
|
||||
<string name="setup_privacy_policy">Gizlilik politikası</string>
|
||||
</resources>
|
||||
@@ -3597,7 +3597,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Неактивно в Android? «Про додаток» → ⋮ → «Дозволити обмежені налаштування»</string>
|
||||
<string name="integration_shortcuts_restricted">Заблоковано Android · «Про додаток» → ⋮ → «Дозволити обмежені налаштування»</string>
|
||||
<string name="integration_shortcuts_service">Кнопка «Додому» DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Передає натискання кнопки «Додому» в Steam Guide, поки активний сеанс Steam і DroidDeck є типовим головним екраном. Не зчитує вміст екрана.</string>
|
||||
<string name="integration_shortcuts_service_description">Служба спеціальних можливостей вмикає комбінації Home/Guide та визначає програми на нижньому екрані. Вона локально зчитує назви пакетів програм і межі вікон. Служба не читає текст, не записує екран і не передає ці дані.</string>
|
||||
<string name="integration_brightness_needed">Увімкніть «Яскравість» у «Налаштування → Інтеграція зі Steam»</string>
|
||||
<string name="apps_search_hint">Пошук застосунків</string>
|
||||
<string name="apps_no_match">Немає застосунків за запитом «%1$s».</string>
|
||||
@@ -3725,4 +3725,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Температура ЦП</string>
|
||||
<string name="stats_hud_battery_temp">Батарея</string>
|
||||
<string name="stats_hud_game_cores">Гра</string>
|
||||
<string name="setup_privacy_policy">Політика конфіденційності</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Bị làm mờ trong Android? Thông tin ứng dụng → ⋮ → Cho phép chế độ cài đặt bị hạn chế</string>
|
||||
<string name="integration_shortcuts_restricted">Bị Android chặn · Thông tin ứng dụng → ⋮ → Cho phép chế độ cài đặt bị hạn chế</string>
|
||||
<string name="integration_shortcuts_service">Nút Home DroidDeck</string>
|
||||
<string name="integration_shortcuts_service_description">Chuyển các lần nhấn nút Home đến Steam Guide khi phiên Steam đang được chọn và DroidDeck là ứng dụng màn hình chính mặc định. Không đọc nội dung màn hình.</string>
|
||||
<string name="integration_shortcuts_service_description">Dịch vụ hỗ trợ tiếp cận bật phím tắt Home/Guide và phát hiện ứng dụng trên màn hình dưới. Dịch vụ này đọc tên gói ứng dụng và giới hạn cửa sổ ngay trên thiết bị. Dịch vụ không đọc văn bản, chụp màn hình hay gửi dữ liệu này.</string>
|
||||
<string name="integration_brightness_needed">Bật Độ sáng trong Thiết lập → Tích hợp Steam</string>
|
||||
<string name="apps_search_hint">Tìm ứng dụng</string>
|
||||
<string name="apps_no_match">Không có ứng dụng nào khớp với “%1$s”.</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">Nhiệt độ CPU</string>
|
||||
<string name="stats_hud_battery_temp">Pin</string>
|
||||
<string name="stats_hud_game_cores">Trò chơi</string>
|
||||
<string name="setup_privacy_policy">Chính sách quyền riêng tư</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">在 Android 中显示为灰色?应用信息 → ⋮ → 允许受限设置</string>
|
||||
<string name="integration_shortcuts_restricted">已被 Android 阻止 · 应用信息 → ⋮ → 允许受限设置</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck 主屏幕按钮</string>
|
||||
<string name="integration_shortcuts_service_description">当 Steam 会话处于焦点且 DroidDeck 为默认主屏幕应用时,将主屏幕按钮的按下操作传递给 Steam Guide 按钮。不会读取屏幕内容。</string>
|
||||
<string name="integration_shortcuts_service_description">无障碍服务用于启用Home/Guide快捷键并检测下方屏幕上的应用。此服务仅在设备本地读取应用包名和窗口边界,不读取文字、不截取屏幕,也不发送这些数据。</string>
|
||||
<string name="integration_brightness_needed">请在“配置”→“Steam 集成”中开启亮度</string>
|
||||
<string name="apps_search_hint">搜索应用</string>
|
||||
<string name="apps_no_match">没有与“%1$s”匹配的应用。</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU 温度</string>
|
||||
<string name="stats_hud_battery_temp">电池</string>
|
||||
<string name="stats_hud_game_cores">游戏</string>
|
||||
<string name="setup_privacy_policy">隐私政策</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">在 Android 中呈灰色?應用程式資訊 → ⋮ → 允許受限制的設定</string>
|
||||
<string name="integration_shortcuts_restricted">已被 Android 封鎖 · 應用程式資訊 → ⋮ → 允許受限制的設定</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck 主畫面按鈕</string>
|
||||
<string name="integration_shortcuts_service_description">當 Steam 會話處於焦點且 DroidDeck 為預設主畫面應用程式時,將主畫面按鈕的按壓傳送給 Steam Guide。不會讀取螢幕內容。</string>
|
||||
<string name="integration_shortcuts_service_description">無障礙服務用於啟用Home/Guide快捷鍵,並偵測下方螢幕上的應用程式。此服務只在裝置本機讀取應用程式套件名稱及視窗邊界,不會讀取文字、擷取螢幕或傳送這些資料。</string>
|
||||
<string name="integration_brightness_needed">請在「初始設定 → Steam 整合」中開啟「亮度」</string>
|
||||
<string name="apps_search_hint">搜尋應用程式</string>
|
||||
<string name="apps_no_match">沒有符合「%1$s」的應用程式。</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU 溫度</string>
|
||||
<string name="stats_hud_battery_temp">電池</string>
|
||||
<string name="stats_hud_game_cores">遊戲</string>
|
||||
<string name="setup_privacy_policy">私隱政策</string>
|
||||
</resources>
|
||||
@@ -3498,7 +3498,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">在 Android 中呈灰色?應用程式資訊 → ⋮ → 允許受限制的設定</string>
|
||||
<string name="integration_shortcuts_restricted">已被 Android 封鎖 · 應用程式資訊 → ⋮ → 允許受限制的設定</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck 主畫面按鈕</string>
|
||||
<string name="integration_shortcuts_service_description">當 Steam 工作階段處於焦點且 DroidDeck 為預設主畫面應用程式時,將主畫面按鈕的按壓傳送給 Steam Guide。不會讀取螢幕內容。</string>
|
||||
<string name="integration_shortcuts_service_description">無障礙服務用於啟用Home/Guide快捷鍵,並偵測下方螢幕上的應用程式。此服務僅在裝置本機讀取應用程式套件名稱及視窗邊界,不會讀取文字、擷取螢幕或傳送這些資料。</string>
|
||||
<string name="integration_brightness_needed">請在「初始設定 → Steam 整合」中開啟「亮度」</string>
|
||||
<string name="apps_search_hint">搜尋應用程式</string>
|
||||
<string name="apps_no_match">沒有符合「%1$s」的應用程式。</string>
|
||||
@@ -3623,4 +3623,5 @@
|
||||
<string name="bottom_strip_cpu_temp">CPU 溫度</string>
|
||||
<string name="stats_hud_battery_temp">電池</string>
|
||||
<string name="stats_hud_game_cores">遊戲</string>
|
||||
<string name="setup_privacy_policy">隱私權政策</string>
|
||||
</resources>
|
||||
@@ -3663,7 +3663,7 @@
|
||||
<string name="integration_shortcuts_maybe_restricted">Greyed out in Android? App info → ⋮ → Allow restricted settings</string>
|
||||
<string name="integration_shortcuts_restricted">Blocked by Android · App info → ⋮ → Allow restricted settings</string>
|
||||
<string name="integration_shortcuts_service">DroidDeck Home button</string>
|
||||
<string name="integration_shortcuts_service_description">Pass Home button presses to Steam Guide while a Steam session is focused and DroidDeck is the default Home app. Does not read screen content.</string>
|
||||
<string name="integration_shortcuts_service_description">Accessibility enables Home/Guide shortcuts and detects apps on the lower screen. This service reads app package names and window bounds locally. It does not read text, capture screens, or send this data.</string>
|
||||
<string name="integration_brightness_needed">Turn on Brightness in Setup → Steam integration</string>
|
||||
<string name="desktop_restore_title">Restoring your software</string>
|
||||
<string name="desktop_restore_body">Reinstalling the apps you added after a DroidDeck update.</string>
|
||||
@@ -3685,4 +3685,5 @@
|
||||
<string name="steam_import_later">Later</string>
|
||||
<string name="setup_all_files">All files access</string>
|
||||
<string name="setup_local_network">Local network</string>
|
||||
<string name="setup_privacy_policy">Privacy policy</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove" />
|
||||
</manifest>
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.droiddeck.launcher
|
||||
|
||||
import android.app.Activity
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import com.droiddeck.launcher.core.DroidDeckTestRunner
|
||||
import com.google.android.play.core.appupdate.testing.FakeAppUpdateManager
|
||||
import com.google.android.play.core.install.model.InstallErrorCode
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNotNull
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
|
||||
@RunWith(DroidDeckTestRunner::class)
|
||||
class PlayUpdatesTest {
|
||||
@Test fun availablePlayUpdateSetsTheExistingUpdateIndicatorWithoutInstalling() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
Robolectric.buildActivity(Activity::class.java).setup().use { controller ->
|
||||
val activity = controller.get()
|
||||
val manager = FakeAppUpdateManager(activity)
|
||||
manager.setUpdateAvailable(Int.MAX_VALUE)
|
||||
val menu = UpdatesMenu(activity, Handler(Looper.getMainLooper())) { manager }
|
||||
menu.check(true)
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
assertTrue(menu.hasUpdate)
|
||||
assertTrue(menu.state().hasUpdate)
|
||||
assertFalse(menu.checking)
|
||||
assertNull(menu.stage)
|
||||
assertNull(shadowOf(activity).nextStartedActivity)
|
||||
assertFalse(manager.isImmediateFlowVisible)
|
||||
assertFalse(manager.isConfirmationDialogVisible)
|
||||
menu.actions().onOpenPlay()
|
||||
val intent = shadowOf(activity).nextStartedActivity
|
||||
assertEquals("market://details?id=${activity.packageName}", intent.dataString)
|
||||
assertEquals("com.android.vending", intent.`package`)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun playCanReportNoUpdateWithoutConsultingAnExternalCatalog() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
Robolectric.buildActivity(Activity::class.java).setup().use { controller ->
|
||||
val manager = FakeAppUpdateManager(controller.get())
|
||||
manager.setUpdateNotAvailable()
|
||||
val menu = UpdatesMenu(controller.get(), Handler(Looper.getMainLooper())) { manager }
|
||||
menu.check(true)
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
assertEquals(false, menu.playUpdateAvailable)
|
||||
assertFalse(menu.hasUpdate)
|
||||
assertNull(menu.catalog)
|
||||
assertTrue(menu.state().playCheckedAt > 0)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun failedPlayCheckDoesNotClaimTheAppIsCurrent() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
Robolectric.buildActivity(Activity::class.java).setup().use { controller ->
|
||||
val manager = FakeAppUpdateManager(controller.get())
|
||||
manager.setInstallErrorCode(InstallErrorCode.ERROR_API_NOT_AVAILABLE)
|
||||
val menu = UpdatesMenu(controller.get(), Handler(Looper.getMainLooper())) { manager }
|
||||
menu.check(true)
|
||||
shadowOf(Looper.getMainLooper()).idle()
|
||||
assertNull(menu.playUpdateAvailable)
|
||||
assertNotNull(menu.error)
|
||||
assertFalse(menu.checking)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun playCannotOpenTheUnknownPackageInstallationSettings() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
Robolectric.buildActivity(Activity::class.java).setup().use { controller ->
|
||||
val activity = controller.get()
|
||||
val menu = UpdatesMenu(activity, Handler(Looper.getMainLooper()))
|
||||
menu.actions().onAllowInstalls()
|
||||
assertFalse(menu.askPermission)
|
||||
assertNull(shadowOf(activity).nextStartedActivity)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert.assertArrayEquals
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import org.junit.runner.RunWith
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.IOException
|
||||
import java.nio.file.Files
|
||||
import java.security.MessageDigest
|
||||
import java.util.function.BooleanSupplier
|
||||
import java.util.function.Consumer
|
||||
|
||||
@RunWith(DroidDeckTestRunner::class)
|
||||
class ComponentPayloadStoreTest {
|
||||
@get:Rule val temporary = TemporaryFolder()
|
||||
private val url = "https://example.test/component"
|
||||
private val content = ByteArray(180000) { (it % 251).toByte() }
|
||||
private val digest get() = hash(content)
|
||||
private fun hash(bytes: ByteArray) = MessageDigest.getInstance("SHA-256").digest(bytes)
|
||||
.joinToString("") { "%02x".format(it.toInt() and 255) }
|
||||
|
||||
private fun fixture(transform: (JSONObject, MutableMap<String, ByteArray>) -> Unit = { _, _ -> }): ComponentPayloadStore {
|
||||
val assets = mutableMapOf<String, ByteArray>()
|
||||
val chunks = JSONArray()
|
||||
content.toList().chunked(60000).forEachIndexed { number, bytes ->
|
||||
val path = "play-components/$digest/${number.toString().padStart(4, '0')}"
|
||||
val data = bytes.toByteArray()
|
||||
assets[path] = data
|
||||
chunks.put(JSONObject().put("asset", path).put("size", data.size).put("sha256", hash(data)))
|
||||
}
|
||||
val entry = JSONObject().put("size", content.size).put("sha256", digest).put("chunks", chunks)
|
||||
transform(entry, assets)
|
||||
val recipe = "play-components/recipes/${entry.getString("sha256")}.json"
|
||||
assets[recipe] = JSONObject().put("chunks", entry.getJSONArray("chunks")).toString().toByteArray()
|
||||
entry.remove("chunks")
|
||||
entry.put("recipe", recipe)
|
||||
assets["play-components/index.json"] = JSONObject().put("schema", 1)
|
||||
.put("entries", JSONObject().put(url, entry)).toString().toByteArray()
|
||||
return ComponentPayloadStore { path ->
|
||||
ByteArrayInputStream(assets[path] ?: throw IOException("Missing asset: $path"))
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun reassemblesChunksAndVerifiesFullPayload() {
|
||||
val output = ByteArrayOutputStream()
|
||||
assertEquals(content.size.toLong(), fixture().copy(url, output, content.size.toLong(), digest))
|
||||
assertArrayEquals(content, output.toByteArray())
|
||||
}
|
||||
|
||||
@Test fun missingComponentCannotUseNetwork() {
|
||||
assertThrows(IOException::class.java) {
|
||||
fixture().copy("https://other.test/component", ByteArrayOutputStream(), Long.MAX_VALUE)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun corruptChunkPreservesPreviouslyInstalledDestination() {
|
||||
val store = fixture { entry, assets ->
|
||||
val path = entry.getJSONArray("chunks").getJSONObject(1).getString("asset")
|
||||
assets[path] = ByteArray(60000)
|
||||
}
|
||||
val destination = temporary.newFile("installed")
|
||||
destination.writeText("existing")
|
||||
assertThrows(IOException::class.java) { store.install(url, destination) }
|
||||
assertEquals("existing", destination.readText())
|
||||
assertEquals(listOf("installed"), temporary.root.listFiles()!!.map { it.name })
|
||||
}
|
||||
|
||||
@Test fun cancellationDuringCopyPreservesDestinationAndStopsProgress() {
|
||||
var cancelled = false
|
||||
var progressCount = 0
|
||||
val destination = temporary.newFile("installed")
|
||||
destination.writeText("existing")
|
||||
assertThrows(IOException::class.java) {
|
||||
fixture().install(url, destination, cancelled = BooleanSupplier { cancelled }, progress = Consumer {
|
||||
progressCount++
|
||||
cancelled = true
|
||||
})
|
||||
}
|
||||
assertEquals(1, progressCount)
|
||||
assertEquals("existing", destination.readText())
|
||||
}
|
||||
|
||||
@Test fun successfulInstallAtomicallyReplacesDestination() {
|
||||
val destination = temporary.newFile("installed")
|
||||
destination.writeText("existing")
|
||||
fixture().install(url, destination, digest)
|
||||
assertArrayEquals(content, destination.readBytes())
|
||||
assertEquals(listOf("installed"), temporary.root.listFiles()!!.map { it.name })
|
||||
}
|
||||
|
||||
@Test fun wrongVersionAndOversizedMetadataAreRejectedBeforeWritingBytes() {
|
||||
val output = ByteArrayOutputStream()
|
||||
assertThrows(IOException::class.java) { fixture().copy(url, output, Long.MAX_VALUE, "0".repeat(64)) }
|
||||
assertThrows(IOException::class.java) { fixture().copy(url, output, content.size - 1L) }
|
||||
assertEquals(0, output.size())
|
||||
}
|
||||
|
||||
@Test fun truncatedAndOverlongChunksFailVerification() {
|
||||
for (size in listOf(59999, 60001)) {
|
||||
val store = fixture { entry, assets ->
|
||||
assets[entry.getJSONArray("chunks").getJSONObject(0).getString("asset")] = ByteArray(size)
|
||||
}
|
||||
assertThrows(IOException::class.java) { store.copy(url, ByteArrayOutputStream(), Long.MAX_VALUE) }
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun traversalPathIsRejectedWithoutOpeningIt() {
|
||||
val store = fixture { entry, _ -> entry.getJSONArray("chunks").getJSONObject(0).put("asset", "../secret") }
|
||||
assertThrows(IOException::class.java) { store.copy(url, ByteArrayOutputStream(), Long.MAX_VALUE) }
|
||||
}
|
||||
|
||||
@Test fun fullDigestIsCheckedEvenWhenEachChunkIsValid() {
|
||||
val store = fixture { entry, _ -> entry.put("sha256", "0".repeat(64)) }
|
||||
assertThrows(IOException::class.java) { store.copy(url, ByteArrayOutputStream(), Long.MAX_VALUE) }
|
||||
}
|
||||
|
||||
@Test fun cancelledBeforeStartCreatesNoDestination() {
|
||||
val destination = temporary.root.resolve("installed")
|
||||
assertThrows(IOException::class.java) {
|
||||
fixture().install(url, destination, cancelled = BooleanSupplier { true })
|
||||
}
|
||||
assertFalse(Files.exists(destination.toPath()))
|
||||
assertEquals(0, temporary.root.listFiles()!!.size)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.droiddeck.launcher.core
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageManager
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
import com.droiddeck.launcher.update.SelfInstaller
|
||||
import com.droiddeck.launcher.session.ProtonExtras
|
||||
import com.droiddeck.launcher.runtime.DesktopCatalog
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertThrows
|
||||
import org.junit.Rule
|
||||
import org.junit.Test
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import org.junit.runner.RunWith
|
||||
import java.net.ServerSocket
|
||||
import java.net.SocketTimeoutException
|
||||
import java.io.File
|
||||
import java.util.function.BooleanSupplier
|
||||
|
||||
@RunWith(DroidDeckTestRunner::class)
|
||||
class PlayDistributionTest {
|
||||
@get:Rule val temporary = TemporaryFolder()
|
||||
private val context: Context = ApplicationProvider.getApplicationContext()
|
||||
|
||||
@Test fun mergedManifestRestrictsPackageInstallationToStandaloneDistribution() {
|
||||
val permissions = context.packageManager.getPackageInfo(context.packageName, PackageManager.GET_PERMISSIONS)
|
||||
.requestedPermissions.orEmpty()
|
||||
assertEquals(!BuildConfig.PLAY_DISTRIBUTION, "android.permission.REQUEST_INSTALL_PACKAGES" in permissions)
|
||||
}
|
||||
|
||||
@Test fun missingPlayComponentCannotContactAnExternalServerOrReplaceExistingData() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
ComponentDownloads.init(context)
|
||||
val destination = temporary.newFile("component")
|
||||
destination.writeText("existing")
|
||||
ServerSocket(0).use { server ->
|
||||
server.soTimeout = 100
|
||||
assertFalse(ComponentDownloads.downloadFile("http://127.0.0.1:${server.localPort}/missing", destination, true, null))
|
||||
assertThrows(SocketTimeoutException::class.java) { server.accept() }
|
||||
}
|
||||
assertEquals("existing", destination.readText())
|
||||
}
|
||||
|
||||
@Test fun playDistributionRejectsSelfInstallationBeforeOpeningPackageInstaller() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
assertFalse(SelfInstaller.canInstall(context))
|
||||
assertThrows(IllegalStateException::class.java) { SelfInstaller.install(context, temporary.newFile("update.apk")) }
|
||||
}
|
||||
|
||||
@Test fun playOffersOnlyDroidDeckProtonWhileStandaloneKeepsItsChoices() {
|
||||
assertEquals(if (BuildConfig.PLAY_DISTRIBUTION) listOf("droiddeck") else listOf("ge", "cachyos", "droiddeck"),
|
||||
ProtonExtras.tools.map { it.id })
|
||||
}
|
||||
|
||||
@Test fun freshPlayInstallationRequiresDroidDeckProtonInsteadOfValveSeed() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
assertEquals(true, DesktopCatalog.protonSeedNeeded(context))
|
||||
val directory = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/compatibilitytools.d/DroidDeck-Proton-test")
|
||||
directory.mkdirs()
|
||||
File(directory, "toolmanifest.vdf").writeText("fixture")
|
||||
assertFalse(DesktopCatalog.protonSeedNeeded(context))
|
||||
}
|
||||
|
||||
@Test fun cancelledProtonBootstrapStopsBeforeRuntimeChanges() {
|
||||
val root = LinuxRuntime.rootDir(context)
|
||||
val before = root.exists()
|
||||
val tool = ProtonExtras.tools.first { it.id == ProtonExtras.OWN }
|
||||
val result = ProtonExtras.install(context, tool, BooleanSupplier { true }) { _, _ ->
|
||||
throw AssertionError("Cancelled bootstrap reported installation progress")
|
||||
}
|
||||
assertEquals(context.getString(com.droiddeck.launcher.R.string.pextra_interrupted), result)
|
||||
assertEquals(before, root.exists())
|
||||
assertFalse(ProtonExtras.installInProgress)
|
||||
}
|
||||
|
||||
@Test fun standaloneCatalogCannotOfferAnUnbundledFexVersionAfterPlayUpgrade() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
val old = File(context.filesDir, "fex-catalog.json")
|
||||
val body = """{"release":"fex-2601-r1","url":"https://github.com/Droid-Deck/DroidDeck-Components/releases/download/fex-2601-r1/fex.tzst","sha256":"${"a".repeat(64)}"}"""
|
||||
old.writeText(body)
|
||||
assertEquals("fex-2601-r1", com.droiddeck.launcher.session.FexCatalog.parse(body)?.tag)
|
||||
assertEquals(null, com.droiddeck.launcher.session.FexCatalog.cached(context))
|
||||
assertEquals(body, old.readText())
|
||||
}
|
||||
|
||||
@Test fun extraDesktopEmulatorsAreOnlyOfferedByTheStandaloneDistribution() {
|
||||
val entry = DesktopCatalog.Entry("emulators", "Emulators", 1, "r1", "tar", "https://example.test/emulators.tar.zst",
|
||||
"a".repeat(64), 100, "", "", "Game")
|
||||
assertEquals(!BuildConfig.PLAY_DISTRIBUTION, DesktopCatalog.offered(entry))
|
||||
val desktop = DesktopCatalog.Entry(DesktopCatalog.DESKTOP_ID, "Desktop", 1, "r1", "tar",
|
||||
"https://example.test/desktop.tar.zst", "b".repeat(64), 100, "", "", "")
|
||||
assertEquals(true, DesktopCatalog.offered(desktop))
|
||||
}
|
||||
|
||||
@Test fun playDoesNotResumeOrDiscardAnOldExtraEmulatorInstallation() {
|
||||
if (!BuildConfig.PLAY_DISTRIBUTION) return
|
||||
val root = LinuxRuntime.rootDir(context).apply { mkdirs() }
|
||||
val entry = DesktopCatalog.Entry("emulators", "Emulators", 1, "r1", "tar", "https://example.test/emulators.tar.zst",
|
||||
"a".repeat(64), 100, "", "", "Game")
|
||||
val journal = File(root, ".droiddeck-pkg-emulators.installing")
|
||||
val original = DesktopCatalog.entryJson(entry).toString()
|
||||
journal.writeText(original)
|
||||
assertEquals(emptyList<DesktopCatalog.Entry>(), DesktopCatalog.interrupted(context))
|
||||
assertEquals(null, DesktopCatalog.resumeInterrupted(context, null))
|
||||
assertEquals(original, journal.readText())
|
||||
assertEquals(listOf("emulators"), DesktopCatalog.interrupted(root).map { it.id })
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,15 @@ class SteamIntegrationShortcutsTest {
|
||||
assertTrue(SteamIntegration.shortcutsChosen(context))
|
||||
}
|
||||
|
||||
@Test fun enablingTheSystemServiceDoesNotBypassDisclosureConsent() {
|
||||
choose(service.flattenToString())
|
||||
assertTrue(SteamIntegration.shortcutsChosen(context))
|
||||
assertFalse(SteamIntegration.accessibilityConsented(context))
|
||||
SteamIntegration.acceptAccessibility(context)
|
||||
assertTrue(SteamIntegration.accessibilityConsented(context))
|
||||
assertTrue(SteamIntegration.shortcutsChosen(context))
|
||||
}
|
||||
|
||||
@Test fun openingShortcutSetupListsTheServiceAndBackingOutHidesItAgain() {
|
||||
SteamIntegration.setShortcutsListed(context, true)
|
||||
assertTrue(listed())
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.droiddeck.launcher.session
|
||||
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.BuildConfig
|
||||
import com.droiddeck.launcher.core.ComponentDownloads
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
import org.junit.Assert.assertEquals
|
||||
@@ -21,7 +23,7 @@ import java.io.File
|
||||
class ProtonExtrasTest {
|
||||
@get:Rule val temp = TemporaryFolder()
|
||||
|
||||
private fun tool(id: String) = ProtonExtras.tools.single { it.id == id }
|
||||
private fun tool(id: String) = ProtonExtras.sources.single { it.id == id }
|
||||
|
||||
private fun asset(name: String, digest: String? = null) = JSONObject()
|
||||
.put("name", name)
|
||||
@@ -47,8 +49,8 @@ class ProtonExtrasTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theThreeSourcesInOrder() {
|
||||
assertEquals(listOf("ge", "cachyos", "droiddeck"), ProtonExtras.tools.map { it.id })
|
||||
fun theSourcesForTheDistributionInOrder() {
|
||||
assertEquals(if (BuildConfig.PLAY_DISTRIBUTION) listOf("droiddeck") else listOf("ge", "cachyos", "droiddeck"), ProtonExtras.tools.map { it.id })
|
||||
val droiddeck = tool("droiddeck")
|
||||
assertEquals("DroidDeck-Proton", droiddeck.name)
|
||||
assertEquals("DroidDeck-Proton", droiddeck.prefix)
|
||||
@@ -70,6 +72,16 @@ class ProtonExtrasTest {
|
||||
assertNull(picked.sha256)
|
||||
}
|
||||
|
||||
@Test fun preparedProtonArchiveIsRecognizedOnlyByThePlayDistribution() {
|
||||
val entry = asset("DroidDeck-Proton-11-11.11-aarch64.tar.zst", "sha256:" + "ab".repeat(32))
|
||||
.put("browser_download_url", "droiddeck-bundle://droiddeck-proton/DroidDeck-Proton-11-11.11-aarch64.tar.zst")
|
||||
val picked = ProtonExtras.pickAsset(tool("droiddeck"), JSONArray().put(release("DroidDeck-Proton-11-11.11", entry)))
|
||||
if (BuildConfig.PLAY_DISTRIBUTION) {
|
||||
assertEquals("ab".repeat(32), picked?.sha256)
|
||||
assertEquals(entry.getString("browser_download_url"), picked?.url)
|
||||
} else assertNull(picked)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun githubsDigestIsKeptBesideTheSha512File() {
|
||||
val sum = "ab".repeat(32)
|
||||
@@ -146,7 +158,7 @@ class ProtonExtrasTest {
|
||||
.put("ge", JSONObject().put("tag", "GE-Proton11-7").put("at", now - 60_000))
|
||||
.put("cachyos", JSONObject().put("tag", "cachyos-11.0-20261005-slr").put("at", now - 60_000))
|
||||
.put("droiddeck", JSONObject().put("tag", "DroidDeck-Proton-11-7.6").put("at", now - ProtonExtras.CHECK_EVERY_MS + 60_000))
|
||||
File(context.filesDir, "proton-latest.json").writeText(latest.toString())
|
||||
File(context.filesDir, ComponentDownloads.catalogName("proton-latest.json")).writeText(latest.toString())
|
||||
assertFalse(ProtonExtras.checkLatest(context, now = now))
|
||||
assertEquals("DroidDeck-Proton-11-7.6", ProtonExtras.update(context, tool("droiddeck")))
|
||||
assertNull(ProtonExtras.update(context, tool("ge")))
|
||||
@@ -175,28 +187,32 @@ class ProtonExtrasTest {
|
||||
@Test
|
||||
fun removingABuildDropsItsStoredOriginalsAndSelections() {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val source = if (BuildConfig.PLAY_DISTRIBUTION) "droiddeck" else "ge"
|
||||
val prefix = if (BuildConfig.PLAY_DISTRIBUTION) "DroidDeck-Proton-" else "GE-Proton"
|
||||
val removedId = "${prefix}11-7"
|
||||
val keptId = "${prefix}11-8"
|
||||
val tools = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/compatibilitytools.d")
|
||||
File(LinuxRuntime.rootDir(context), "root/.local/share/droiddeck-components").mkdirs()
|
||||
installTool(tools, "GE-Proton11-7")
|
||||
val kept = installTool(tools, "GE-Proton11-8").apply {
|
||||
installTool(tools, removedId)
|
||||
val kept = installTool(tools, keptId).apply {
|
||||
File(this, "files/lib/wine").mkdirs()
|
||||
File(this, "proton").writeText("")
|
||||
}
|
||||
val originals = File(context.filesDir, "components/originals")
|
||||
for (id in listOf("GE-Proton11-7", "GE-Proton11-8")) File(originals, "$id/$id/dxvk.wcp").apply { parentFile?.mkdirs(); writeText("x") }
|
||||
val pick = JSONObject().put("dxvk", JSONObject().put("file", "dxvk.wcp").put("protonVersion", "GE-Proton11-7"))
|
||||
for (id in listOf(removedId, keptId)) File(originals, "$id/$id/dxvk.wcp").apply { parentFile?.mkdirs(); writeText("x") }
|
||||
val pick = JSONObject().put("dxvk", JSONObject().put("file", "dxvk.wcp").put("protonVersion", removedId))
|
||||
File(context.filesDir, "components/state.json").writeText(JSONObject()
|
||||
.put("active", JSONObject().put("GE-Proton11-7", pick).put("GE-Proton11-8", pick))
|
||||
.put("queued", JSONObject().put("GE-Proton11-7", pick)).toString())
|
||||
ProtonExtras.remove(context, tool("ge"), "GE-Proton11-7")
|
||||
assertFalse(File(originals, "GE-Proton11-7").exists())
|
||||
assertTrue(File(originals, "GE-Proton11-8/GE-Proton11-8/dxvk.wcp").isFile)
|
||||
.put("active", JSONObject().put(removedId, pick).put(keptId, pick))
|
||||
.put("queued", JSONObject().put(removedId, pick)).toString())
|
||||
ProtonExtras.remove(context, tool(source), removedId)
|
||||
assertFalse(File(originals, removedId).exists())
|
||||
assertTrue(File(originals, "$keptId/$keptId/dxvk.wcp").isFile)
|
||||
val state = JSONObject(File(context.filesDir, "components/state.json").readText())
|
||||
assertFalse(state.getJSONObject("active").has("GE-Proton11-7"))
|
||||
assertFalse(state.getJSONObject("queued").has("GE-Proton11-7"))
|
||||
assertTrue(state.getJSONObject("active").has("GE-Proton11-8"))
|
||||
assertFalse(state.getJSONObject("active").has(removedId))
|
||||
assertFalse(state.getJSONObject("queued").has(removedId))
|
||||
assertTrue(state.getJSONObject("active").has(keptId))
|
||||
ComponentsManager.forgetProton(context, kept.name)
|
||||
assertTrue(File(originals, "GE-Proton11-8/GE-Proton11-8/dxvk.wcp").isFile)
|
||||
assertTrue(File(originals, "$keptId/$keptId/dxvk.wcp").isFile)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -217,7 +233,7 @@ class ProtonExtrasTest {
|
||||
val context = RuntimeEnvironment.getApplication()
|
||||
val tools = File(LinuxRuntime.rootDir(context), "root/.local/share/Steam/compatibilitytools.d")
|
||||
tools.deleteRecursively()
|
||||
File(context.filesDir, "proton-latest.json").writeText(
|
||||
File(context.filesDir, ComponentDownloads.catalogName("proton-latest.json")).writeText(
|
||||
"""{"droiddeck":{"tag":"DroidDeck-Proton-11-11.4","at":1},"ge":{"tag":"GE-Proton11-7","at":1}}""")
|
||||
ProtonExtras.setDeclined(context, false)
|
||||
assertEquals("DroidDeck-Proton-11-11.4", ProtonExtras.missing(context, tool("droiddeck")))
|
||||
|
||||
@@ -7,20 +7,20 @@ import org.junit.Test
|
||||
class BuildWatermarkTest {
|
||||
@Test
|
||||
fun stableAndPreviewBuildsHaveNoWatermark() {
|
||||
assertNull(BuildWatermark.lines(pr = 0, ci = true, commit = "abcdef0123", title = "", branch = ""))
|
||||
assertNull(BuildWatermark.lines(pr = 0, ci = true, commit = "abcdef0123", title = "", branch = "", play = false))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun prBuildShowsNumberHashAndTitle() {
|
||||
assertEquals(
|
||||
listOf("PR-1234 | abcdef0", "Fix: foo the bar"),
|
||||
BuildWatermark.lines(pr = 1234, ci = true, commit = "abcdef0123", title = "Fix: foo the bar", branch = "x"),
|
||||
BuildWatermark.lines(pr = 1234, ci = true, commit = "abcdef0123", title = "Fix: foo the bar", branch = "x", play = false),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun longTitlesTruncateAtEightyCharacters() {
|
||||
val lines = BuildWatermark.lines(pr = 7, ci = true, commit = "abcdef0", title = "a".repeat(120), branch = "")!!
|
||||
val lines = BuildWatermark.lines(pr = 7, ci = true, commit = "abcdef0", title = "a".repeat(120), branch = "", play = false)!!
|
||||
assertEquals(80, lines[1].length)
|
||||
assertEquals('…', lines[1].last())
|
||||
}
|
||||
@@ -29,7 +29,16 @@ class BuildWatermarkTest {
|
||||
fun localBuildShowsBranch() {
|
||||
assertEquals(
|
||||
listOf("LOCAL | abcdef0", "feat/thing"),
|
||||
BuildWatermark.lines(pr = 0, ci = false, commit = "abcdef0123", title = "", branch = "feat/thing"),
|
||||
BuildWatermark.lines(pr = 0, ci = false, commit = "abcdef0123", title = "", branch = "feat/thing", play = false),
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun playBuildShowsOnlyTheShortSourceCommit() {
|
||||
for (ci in listOf(true, false)) for (pr in listOf(0, 1234)) {
|
||||
assertEquals(listOf("abcdef0"), BuildWatermark.lines(
|
||||
pr = pr, ci = ci, commit = "abcdef0123456789", title = "Build title", branch = "playstore", play = true,
|
||||
))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user