mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-09-09 21:07:01 +00:00
Update MainActivity.kt
This commit is contained in:
parent
96836e2710
commit
4aac9774dd
|
@ -70,6 +70,28 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
||||||
val savesFolderRoot get() = File(savesFolder).listFiles()?.firstOrNull()?.canonicalPath ?: ""
|
val savesFolderRoot get() = File(savesFolder).listFiles()?.firstOrNull()?.canonicalPath ?: ""
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
val keysDirPath = applicationContext.filesDir.absolutePath + "/keys/"
|
||||||
|
val keysDir = File(keysDirPath)
|
||||||
|
if (!keysDir.exists()) {
|
||||||
|
keysDir.mkdir()
|
||||||
|
try {
|
||||||
|
val inputStream = applicationContext.assets.open("prod.keys")
|
||||||
|
val outputStream = FileOutputStream(keysDirPath + "prod.keys")
|
||||||
|
val bufferedInputStream = BufferedInputStream(inputStream)
|
||||||
|
val bufferedOutputStream = BufferedOutputStream(outputStream)
|
||||||
|
val buffer = ByteArray(1024)
|
||||||
|
var length: Int
|
||||||
|
while (bufferedInputStream.read(buffer).also { length = it } != -1) {
|
||||||
|
bufferedOutputStream.write(buffer, 0, length)
|
||||||
|
}
|
||||||
|
bufferedInputStream.close()
|
||||||
|
bufferedOutputStream.close()
|
||||||
|
} catch (e: IOException) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
println("Keys directory already exists.")
|
||||||
|
}
|
||||||
val splashScreen = installSplashScreen()
|
val splashScreen = installSplashScreen()
|
||||||
splashScreen.setKeepOnScreenCondition { !DirectoryInitialization.areDirectoriesReady }
|
splashScreen.setKeepOnScreenCondition { !DirectoryInitialization.areDirectoriesReady }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue