Просмотр исходного кода

android: Don't crash the app when selecting a zip that causes a SecurityException

Charles Lombardo 3 лет назад
Родитель
Сommit
8e8627a258
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt

+ 5 - 1
src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/GpuDriverHelper.kt

@@ -103,7 +103,11 @@ object GpuDriverHelper {
         )
         )
 
 
         // Unzip the driver.
         // Unzip the driver.
-        unzip(driverInstallationPath + DRIVER_INTERNAL_FILENAME, driverInstallationPath!!)
+        try {
+            unzip(driverInstallationPath + DRIVER_INTERNAL_FILENAME, driverInstallationPath!!)
+        } catch (e: SecurityException) {
+            return
+        }
 
 
         // Initialize the driver parameters.
         // Initialize the driver parameters.
         initializeDriverParameters(context)
         initializeDriverParameters(context)