Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,13 @@ dependencies {
androidTestImplementation("androidx.test:runner:1.6.2")
}

val verifyGfxstreamRuntimeAssets by
val verifyGraphicsRuntimeAssets by
tasks.registering {
val runtimeRoot = file("src/main/assets/runtime/arm64-v8a")
inputs.dir(runtimeRoot.resolve("gfxstream-host"))
inputs.dir(runtimeRoot.resolve("gfxstream-guest"))
inputs.dir(runtimeRoot.resolve("virgl-host"))
inputs.dir(runtimeRoot.resolve("virgl-angle-vulkan"))

doLast {
fun ByteArray.containsSequence(needle: ByteArray): Boolean {
Expand All @@ -184,7 +186,13 @@ val verifyGfxstreamRuntimeAssets by
return false
}

val bundleNames = listOf("gfxstream-host", "gfxstream-guest")
val bundleNames =
listOf(
"gfxstream-host",
"gfxstream-guest",
"virgl-host",
"virgl-angle-vulkan",
)
val manifests =
bundleNames.associateWith { bundleName ->
val bundle = runtimeRoot.resolve(bundleName)
Expand Down Expand Up @@ -238,5 +246,5 @@ val verifyGfxstreamRuntimeAssets by
}

tasks.matching { it.name == "preBuild" }.configureEach {
dependsOn(verifyGfxstreamRuntimeAssets)
dependsOn(verifyGraphicsRuntimeAssets)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
format=1
runtime=2.1.24923-f09a19ce-2
abi=arm64-v8a
source_package=angle-android
source_backend=vulkan
termux_packages_commit=4c3e1c0c700f7515d89ecbb9f636d5289f6cd48e
source_deb_sha256=3e421cecefc8cb5ca9c57ffe1eb38f77dc315d88d99f1018ef0fdd2add6ca330
lib/libEGL_angle.so.sha256=902da0dabfdc87ed572b7c597e9007066f871e9674ba2ff7c1c73c51d6066a99
lib/libGLESv1_CM_angle.so.sha256=8495dcb6af2d5743283c783a58e744ed160d868e1baf6322aa7ee71b006cbe65
lib/libGLESv2_angle.so.sha256=e99093dd5de9e05d40a4d427dcbd3803e5781e579e9d65543db71c0a3fa1ffba
lib/libfeature_support_angle.so.sha256=afa4ffcda88fca52007ed8a40bfd9bfd27db34f465c753b1d4c4e0540ca7b252
share/doc/copyright.sha256=bf4da21bd20bcfb5b60b7ecc67fa864a79be049e21d6178076887f178dd6c71a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2018 The ANGLE Project Authors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
//
// Neither the name of TransGaming Inc., Google Inc., 3DLabs Inc.
// Ltd., nor the names of their contributors may be used to endorse
// or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
format=1
runtime=1.3.0-1
abi=arm64-v8a
source_package=virglrenderer-android
termux_packages_commit=4bf6c61f492c1b8248192321e0f4440f4decb49f
source_deb_sha256=73b34df68364100af063f1fd6cdeef90d8992f921d576b8262b35619c8223eab
bin/virgl_test_server_android.sha256=c4fa02e432f2edbf974c8bf85922b6d1f7418be633bce443e5b1893c312273aa
lib/libepoxy.so.sha256=7b50fe1ef66cfea354f398523169bdb4ac8ec3b2715ac77073540bd5a1b3075f
lib/libvirglrenderer.so.sha256=d013d65a4f985233f75998945d6ca7af114dc2460f08969811c03ec09bf2d20a
share/doc/COPYING-gl4es.sha256=69a3049c77abd88658f6ad7cf6a5b6ceb5cf03b80e60f7c4657d90322cfab7bd
share/doc/COPYING-libepoxy.sha256=8d5144666f9c4df9bbd69b8900086d5979259152a1060421cdcc0fb9061a1c12
share/doc/COPYING-virglrenderer.sha256=3b32caf16e2402c2aff2b716858713f3e1feded85c25e71bf829816ee5009402
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2016-2018 Sebastien Chevalier
Copyright (c) 2013-2016 Ryan Hileman

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
The libepoxy project code is covered by the MIT license:

/*
* Copyright © 2013-2014 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/

The generated code is derived from Khronos's xml files, which appear
under the following license:

/*
* Copyright (c) 2013 The Khronos Group Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
*
* THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
virglrenderer is under MIT license and derived from mesa in many parts.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

4 changes: 4 additions & 0 deletions app/src/main/java/org/randomcoder/udroid/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import org.randomcoder.udroid.runtime.DesktopEnvironment
import org.randomcoder.udroid.runtime.DesktopEnvironmentScanner
import org.randomcoder.udroid.runtime.DesktopSessionPhase
import org.randomcoder.udroid.runtime.InstalledRootfs
import org.randomcoder.udroid.runtime.ProotEnvironmentProfileStore
import org.randomcoder.udroid.runtime.ProotMountProfile
import org.randomcoder.udroid.runtime.ProotMountProfileValidator
import org.randomcoder.udroid.runtime.RuntimePhase
Expand Down Expand Up @@ -846,6 +847,9 @@ class MainActivity : ComponentActivity() {
?.let { cleanupWarnings += it.message ?: "launcher shortcuts" }

if (resetWork == null) {
runCatching { ProotEnvironmentProfileStore(this@MainActivity).remove(rootfsName) }
.exceptionOrNull()
?.let { cleanupWarnings += it.message ?: "environment profile" }
runCatching { app.mountProfiles.remove(rootfsName) }
.exceptionOrNull()
?.let { cleanupWarnings += it.message ?: "mount profile" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ enum class DesktopGraphicsProfile(
val storageValue: String,
) {
STANDARD("standard"),
SOFTWARE("software"),
ZINK("zink"),
VIRGL("virgl"),
VIRGL_ANGLE("virgl-angle"),
GFXSTREAM_EXPERIMENTAL("gfxstream-experimental"),
;

Expand Down Expand Up @@ -144,6 +148,11 @@ class DesktopConfigurationStore(context: Context) {
return configuration
}

fun loadGraphicsProfile(rootfsName: String): DesktopGraphicsProfile =
DesktopGraphicsProfile.fromStorage(
preferences.getString(key(rootfsName, KEY_GRAPHICS_PROFILE), null),
)

fun remove(rootfsName: String) {
val prefix = "$rootfsName:"
val editor = preferences.edit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ object ProotApplicationLaunchBuilder {
audioAuthDirectory = audioEndpoint?.hostAuthDirectory?.absolutePath,
),
)
val environmentProfile = ProotEnvironmentProfileStore(context).load(rootfs.name)
val guestEnvironment = ProotEnvironmentResolver.resolve(environmentProfile)
val managedEnvironment =
ProotEnvironmentResolver.resolveManagedOverrides(environmentProfile)
val prootArguments =
buildArguments(
prootPath = runtime.executable.absolutePath,
Expand All @@ -51,6 +55,8 @@ object ProotApplicationLaunchBuilder {
audioAuthDirectory = audioEndpoint?.hostAuthDirectory?.absolutePath,
launchProfile = launchProfile,
mounts = mounts,
guestEnvironment = guestEnvironment,
managedEnvironment = managedEnvironment,
)
val temporaryDirectory =
File(context.cacheDir, "proot").apply {
Expand Down Expand Up @@ -90,6 +96,8 @@ object ProotApplicationLaunchBuilder {
launchProfile: ProotLaunchProfile? = null,
mounts: List<ResolvedProotMount> =
ProotMountResolver.defaults(x11SocketDirectory, audioAuthDirectory),
guestEnvironment: List<String> = ProotEnvironmentResolver.resolve(),
managedEnvironment: List<String> = emptyList(),
): List<String> {
require(applicationArguments.isNotEmpty())
return buildList {
Expand All @@ -107,8 +115,7 @@ object ProotApplicationLaunchBuilder {
add("USER=root")
add("LOGNAME=root")
add("SHELL=/bin/sh")
add("LANG=C.UTF-8")
add("PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
addAll(guestEnvironment)
add("DISPLAY=:0")
if (audioAuthDirectory != null) {
add("PULSE_SERVER=${AudioEndpoint.GUEST_SERVER}")
Expand All @@ -117,7 +124,12 @@ object ProotApplicationLaunchBuilder {
add("XDG_CURRENT_DESKTOP=UDROID")
add("GDK_BACKEND=x11")
add("QT_QPA_PLATFORM=xcb")
addAll(launchProfile?.wrapGuestCommand(applicationArguments) ?: applicationArguments)
val overriddenCommand =
ProotEnvironmentResolver.applyManagedOverrides(
applicationArguments,
managedEnvironment,
)
addAll(launchProfile?.wrapGuestCommand(overriddenCommand) ?: overriddenCommand)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ object ProotDesktopLaunchBuilder {
audioAuthDirectory = audioEndpoint?.hostAuthDirectory?.absolutePath,
),
)
val environmentProfile = ProotEnvironmentProfileStore(context).load(rootfs.name)
val guestEnvironment = ProotEnvironmentResolver.resolve(environmentProfile)
val managedEnvironment =
ProotEnvironmentResolver.resolveManagedOverrides(environmentProfile)
val arguments =
buildArguments(
prootPath = runtime.executable.absolutePath,
Expand All @@ -42,6 +46,8 @@ object ProotDesktopLaunchBuilder {
audioAuthDirectory = audioEndpoint?.hostAuthDirectory?.absolutePath,
launchProfile = launchProfile,
mounts = mounts,
guestEnvironment = guestEnvironment,
managedEnvironment = managedEnvironment,
hasDbusRunSession =
File(rootfs, "usr/bin/dbus-run-session").isFile ||
File(rootfs, "bin/dbus-run-session").isFile,
Expand Down Expand Up @@ -85,6 +91,8 @@ object ProotDesktopLaunchBuilder {
launchProfile: ProotLaunchProfile? = null,
mounts: List<ResolvedProotMount> =
ProotMountResolver.defaults(x11SocketDirectory, audioAuthDirectory),
guestEnvironment: List<String> = ProotEnvironmentResolver.resolve(),
managedEnvironment: List<String> = emptyList(),
): List<String> =
buildList {
add(prootPath)
Expand All @@ -101,8 +109,7 @@ object ProotDesktopLaunchBuilder {
add("USER=root")
add("LOGNAME=root")
add("SHELL=/bin/sh")
add("LANG=C.UTF-8")
add("PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin")
addAll(guestEnvironment)
add("DISPLAY=:0")
if (audioAuthDirectory != null) {
add("PULSE_SERVER=${AudioEndpoint.GUEST_SERVER}")
Expand Down Expand Up @@ -130,7 +137,9 @@ object ProotDesktopLaunchBuilder {
add("udroid-desktop")
addAll(environment.command)
}
addAll(launchProfile?.wrapGuestCommand(desktopCommand) ?: desktopCommand)
val overriddenCommand =
ProotEnvironmentResolver.applyManagedOverrides(desktopCommand, managedEnvironment)
addAll(launchProfile?.wrapGuestCommand(overriddenCommand) ?: overriddenCommand)
}

internal fun compositorScript(
Expand Down
Loading