mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-09-10 04:47:35 +00:00
Merge pull request #3 from isyvdshvsy/isyvdshvsy-patch-4
Update MainActivity.kt
This commit is contained in:
commit
f1dd8f59a1
|
@ -72,27 +72,27 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
val keysDirPath = applicationContext.filesDir.absolutePath + "/keys/"
|
val keysDirPath = applicationContext.filesDir.absolutePath + "/keys/"
|
||||||
val keysDir = File(keysDirPath)
|
val keysDir = File(keysDirPath)
|
||||||
if (!keysDir.exists()) {
|
if (!keysDir.exists()) {
|
||||||
keysDir.mkdir()
|
keysDir.mkdir()
|
||||||
try {
|
try {
|
||||||
val inputStream = applicationContext.assets.open("prod.keys")
|
val inputStream = applicationContext.assets.open("prod.keys")
|
||||||
val outputStream = FileOutputStream(keysDirPath + "prod.keys")
|
val outputStream = FileOutputStream(keysDirPath + "prod.keys")
|
||||||
val bufferedInputStream = BufferedInputStream(inputStream)
|
val bufferedInputStream = BufferedInputStream(inputStream)
|
||||||
val bufferedOutputStream = BufferedOutputStream(outputStream)
|
val bufferedOutputStream = BufferedOutputStream(outputStream)
|
||||||
val buffer = ByteArray(1024)
|
val buffer = ByteArray(1024)
|
||||||
var length: Int
|
var length: Int
|
||||||
while (bufferedInputStream.read(buffer).also { length = it } != -1) {
|
while (bufferedInputStream.read(buffer).also { length = it } != -1) {
|
||||||
bufferedOutputStream.write(buffer, 0, length)
|
bufferedOutputStream.write(buffer, 0, length)
|
||||||
}
|
}
|
||||||
bufferedInputStream.close()
|
bufferedInputStream.close()
|
||||||
bufferedOutputStream.close()
|
bufferedOutputStream.close()
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("Keys directory already exists.")
|
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