Compare commits
4 Commits
android-48
...
android-49
Author | SHA1 | Date | |
---|---|---|---|
a2114ece93 | |||
ccd163ab2c | |||
182fb83556 | |||
35b77b9599 |
@ -95,6 +95,7 @@ android {
|
|||||||
// builds a release build that doesn't need signing
|
// builds a release build that doesn't need signing
|
||||||
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
|
// Attaches 'debug' suffix to version and package name, allowing installation alongside the release build.
|
||||||
register("relWithDebInfo") {
|
register("relWithDebInfo") {
|
||||||
|
isDefault = true
|
||||||
resValue("string", "app_name_suffixed", "yuzu Debug Release")
|
resValue("string", "app_name_suffixed", "yuzu Debug Release")
|
||||||
signingConfig = signingConfigs.getByName("debug")
|
signingConfig = signingConfigs.getByName("debug")
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
@ -122,6 +123,7 @@ android {
|
|||||||
flavorDimensions.add("version")
|
flavorDimensions.add("version")
|
||||||
productFlavors {
|
productFlavors {
|
||||||
create("mainline") {
|
create("mainline") {
|
||||||
|
isDefault = true
|
||||||
dimension = "version"
|
dimension = "version"
|
||||||
buildConfigField("Boolean", "PREMIUM", "false")
|
buildConfigField("Boolean", "PREMIUM", "false")
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import kotlinx.serialization.json.Json
|
|||||||
import org.yuzu.yuzu_emu.NativeLibrary
|
import org.yuzu.yuzu_emu.NativeLibrary
|
||||||
import org.yuzu.yuzu_emu.YuzuApplication
|
import org.yuzu.yuzu_emu.YuzuApplication
|
||||||
import org.yuzu.yuzu_emu.model.Game
|
import org.yuzu.yuzu_emu.model.Game
|
||||||
|
import org.yuzu.yuzu_emu.model.MinimalDocumentFile
|
||||||
|
|
||||||
object GameHelper {
|
object GameHelper {
|
||||||
const val KEY_GAME_PATH = "game_path"
|
const val KEY_GAME_PATH = "game_path"
|
||||||
@ -29,15 +30,7 @@ object GameHelper {
|
|||||||
// Ensure keys are loaded so that ROM metadata can be decrypted.
|
// Ensure keys are loaded so that ROM metadata can be decrypted.
|
||||||
NativeLibrary.reloadKeys()
|
NativeLibrary.reloadKeys()
|
||||||
|
|
||||||
val children = FileUtil.listFiles(context, gamesUri)
|
addGamesRecursive(games, FileUtil.listFiles(context, gamesUri), 3)
|
||||||
for (file in children) {
|
|
||||||
if (!file.isDirectory) {
|
|
||||||
// Check that the file has an extension we care about before trying to read out of it.
|
|
||||||
if (Game.extensions.contains(FileUtil.getExtension(file.uri))) {
|
|
||||||
games.add(getGame(file.uri))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cache list of games found on disk
|
// Cache list of games found on disk
|
||||||
val serializedGames = mutableSetOf<String>()
|
val serializedGames = mutableSetOf<String>()
|
||||||
@ -52,6 +45,30 @@ object GameHelper {
|
|||||||
return games.toList()
|
return games.toList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun addGamesRecursive(
|
||||||
|
games: MutableList<Game>,
|
||||||
|
files: Array<MinimalDocumentFile>,
|
||||||
|
depth: Int
|
||||||
|
) {
|
||||||
|
if (depth <= 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
files.forEach {
|
||||||
|
if (it.isDirectory) {
|
||||||
|
addGamesRecursive(
|
||||||
|
games,
|
||||||
|
FileUtil.listFiles(YuzuApplication.appContext, it.uri),
|
||||||
|
depth - 1
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
if (Game.extensions.contains(FileUtil.getExtension(it.uri))) {
|
||||||
|
games.add(getGame(it.uri))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun getGame(uri: Uri): Game {
|
private fun getGame(uri: Uri): Game {
|
||||||
val filePath = uri.toString()
|
val filePath = uri.toString()
|
||||||
var name = NativeLibrary.getTitle(filePath)
|
var name = NativeLibrary.getTitle(filePath)
|
||||||
|
Reference in New Issue
Block a user