diff --git a/android/README.md b/android/README.md index c9a0378..3b7f581 100644 --- a/android/README.md +++ b/android/README.md @@ -57,4 +57,4 @@ Note: This form of ZIP can be used in [Kichikuou on Web](http://kichikuou.github - To uninstall a game, long-tap the title in the game list. ## Known Issues -- Android versions older than 7.0 cannot handle ZIPs containing Shift-JIS file names. This is the case with some ZIPs distributed on [retroc.net](http://retropc.net/alice/). If you get the error "This type of ZIP is not supported.", unzip the ZIP file on your PC and re-archive it with a modern ZIP creation software. +- Installation from a ZIP containing multiple games (e.g. DPS series) does not work well. diff --git a/android/app/src/main/java/io/github/kichikuou/system3/Launcher.kt b/android/app/src/main/java/io/github/kichikuou/system3/Launcher.kt index 2085232..cac6363 100644 --- a/android/app/src/main/java/io/github/kichikuou/system3/Launcher.kt +++ b/android/app/src/main/java/io/github/kichikuou/system3/Launcher.kt @@ -201,9 +201,6 @@ class Launcher private constructor(private val rootDir: File) { handler.sendMessage(handler.obtainMessage(SUCCESS, outDir)) } catch (e: InstallFailureException) { handler.sendMessage(handler.obtainMessage(FAILURE, e.msgId)) - } catch (e: UTFDataFormatException) { - // Attempted to read Shift_JIS zip in Android < 7 - handler.sendMessage(handler.obtainMessage(FAILURE, R.string.unsupported_zip)) } catch (e: IOException) { Log.e("launcher", "Failed to extract ZIP", e) handler.sendMessage(handler.obtainMessage(FAILURE, R.string.zip_extraction_error)) @@ -249,8 +246,13 @@ private fun forEachZipEntry(input: InputStream, action: (ZipEntry, ZipInputStrea } zip.use { while (true) { - val zipEntry = zip.nextEntry ?: break - action(zipEntry, zip) + try { + val zipEntry = zip.nextEntry ?: break + action(zipEntry, zip) + } catch (e: UTFDataFormatException) { + Log.w("forEachZipEntry", "UTFDataFormatException: skipping a zip entry") + zip.closeEntry() + } } } }