mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 05:46:03 +00:00
chore: consistent code branding (#2800)
* chore: consistent code branding * fix: carry legacy overrides, queues and live sync rows across the rename * fix: keep queued legacy overrides on a failed rename and separate merged queue entries
This commit is contained in:
1 parent
ad9348879d
commit
eabcfc7b74
229 files changed
+2584
-2468
No files matched your search
@@ -21,6 +21,10 @@ object LegacyNames {
|
||||
"etc/bannerlator-network.json" to "etc/droiddeck-network.json",
|
||||
"etc/bannerlator-wifi-scan-request" to "etc/droiddeck-wifi-scan-request",
|
||||
)
|
||||
private val RETIRED_FILES = listOf("libblsession.so", "libblfastpath.so", "libblaudit.so").map { "usr/local/lib/$it" } +
|
||||
listOf("x86_64", "i386").map { "usr/local/lib/droiddeck-fex/$it/libblsession.so" }
|
||||
private const val LEGACY_MARKER = ".bl-"
|
||||
private val QUEUED_MARKERS = setOf(".bl-proton-extra", ".bl-steam-urls")
|
||||
private val MENU_REWRITES = listOf(
|
||||
Triple("usr/local/share/applications", "/usr/local/bin/bannerlator-", "/usr/local/bin/droiddeck-"),
|
||||
Triple("usr/share/applications", "Exec=env APPIMAGE_EXTRACT_AND_RUN=1 /opt/appimages/",
|
||||
@@ -38,6 +42,20 @@ object LegacyNames {
|
||||
fun migrateRootfs(root: File) {
|
||||
migrateEtc(root)
|
||||
for ((old, new) in MOVED_FILES) move(File(root, old), File(root, new))
|
||||
for (path in RETIRED_FILES) File(root, path).delete()
|
||||
File(root, "root").listFiles { f -> f.name.startsWith(LEGACY_MARKER) }?.forEach {
|
||||
val target = File(it.parentFile, ".dd-" + it.name.removePrefix(LEGACY_MARKER))
|
||||
if (it.name in QUEUED_MARKERS && it.isFile && !isLink(it) && target.isFile && !isLink(target)) {
|
||||
val queued = it.readText()
|
||||
if (queued.isNotBlank()) {
|
||||
val separator = if (target.length() > 0 && !target.readText().endsWith("\n")) "\n" else ""
|
||||
target.appendText(separator + if (queued.endsWith("\n")) queued else queued + "\n")
|
||||
}
|
||||
FileUtils.delete(it)
|
||||
} else {
|
||||
move(it, target)
|
||||
}
|
||||
}
|
||||
linkScripts(root)
|
||||
rewriteMenuEntries(root)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.security.MessageDigest
|
||||
|
||||
object ProotFastPath {
|
||||
private const val TAG = "ProotFastPath"
|
||||
const val LIBRARY = "/usr/local/lib/libblfastpath.so"
|
||||
const val LIBRARY = "/usr/local/lib/libddfastpath.so"
|
||||
const val MAX_BINDS = 256
|
||||
|
||||
fun allows(preference: Boolean, noSeccomp: Boolean, source: String, nativeUserland: Boolean = false): Boolean =
|
||||
|
||||
Reference in new issue
Block a user