diff --git a/app/src/main/java/helium314/keyboard/latin/App.kt b/app/src/main/java/helium314/keyboard/latin/App.kt index 23d066bbc..7af17155a 100644 --- a/app/src/main/java/helium314/keyboard/latin/App.kt +++ b/app/src/main/java/helium314/keyboard/latin/App.kt @@ -252,6 +252,7 @@ fun checkVersionUpgrade(context: Context) { if (oldVersion <= 2303) { File(DeviceProtectedUtils.getFilesDir(context), "layouts").listFiles()?.forEach { file -> val folder = DeviceProtectedUtils.getFilesDir(context) + if (file.isDirectory) return@forEach when (file.name) { "custom.symbols." -> { val dir = File(folder, LayoutType.SYMBOLS.folder) diff --git a/app/src/main/java/helium314/keyboard/settings/preferences/BackupRestorePreference.kt b/app/src/main/java/helium314/keyboard/settings/preferences/BackupRestorePreference.kt index 54ae66196..9777b65ba 100644 --- a/app/src/main/java/helium314/keyboard/settings/preferences/BackupRestorePreference.kt +++ b/app/src/main/java/helium314/keyboard/settings/preferences/BackupRestorePreference.kt @@ -134,8 +134,11 @@ fun BackupRestorePreference(setting: Setting) { ctx.getActivity()?.contentResolver?.openInputStream(uri)?.use { inputStream -> ZipInputStream(inputStream).use { zip -> var entry: ZipEntry? = zip.nextEntry - val filesDir = ctx.filesDir?.path ?: return@execute - val deviceProtectedFilesDir = DeviceProtectedUtils.getFilesDir(ctx).path + val filesDir = ctx.filesDir ?: return@execute + val deviceProtectedFilesDir = DeviceProtectedUtils.getFilesDir(ctx) + filesDir.deleteRecursively() + deviceProtectedFilesDir.deleteRecursively() + LayoutUtilsCustom.onLayoutFileChanged() Settings.getInstance().stopListener() while (entry != null) { if (entry.name.startsWith("unprotected${File.separator}")) { diff --git a/app/src/main/java/helium314/keyboard/settings/screens/LayoutScreen.kt b/app/src/main/java/helium314/keyboard/settings/screens/SecondaryLayoutScreen.kt similarity index 99% rename from app/src/main/java/helium314/keyboard/settings/screens/LayoutScreen.kt rename to app/src/main/java/helium314/keyboard/settings/screens/SecondaryLayoutScreen.kt index 3ea18eb66..72df95862 100644 --- a/app/src/main/java/helium314/keyboard/settings/screens/LayoutScreen.kt +++ b/app/src/main/java/helium314/keyboard/settings/screens/SecondaryLayoutScreen.kt @@ -25,7 +25,7 @@ import helium314.keyboard.settings.dialogs.LayoutPickerDialog import helium314.keyboard.settings.preferences.Preference @Composable -fun LayoutScreen( +fun SecondaryLayoutScreen( onClickBack: () -> Unit, ) { // todo: enable main layouts