mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	@@ -26,9 +26,11 @@ internal class RarPageLoader(file: File) : PageLoader() {
 | 
			
		||||
            rar.fileHeaders.asSequence()
 | 
			
		||||
                .filterNot { it.isDirectory }
 | 
			
		||||
                .forEach { header ->
 | 
			
		||||
                    val pageFile = File(tmpDir, header.fileName).also { it.createNewFile() }
 | 
			
		||||
                    val pageOutputStream = File(tmpDir, header.fileName.substringAfterLast("/"))
 | 
			
		||||
                        .also { it.createNewFile() }
 | 
			
		||||
                        .outputStream()
 | 
			
		||||
                    getStream(rar, header).use {
 | 
			
		||||
                        it.copyTo(pageFile.outputStream())
 | 
			
		||||
                        it.copyTo(pageOutputStream)
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,8 @@ internal class ZipPageLoader(file: File) : PageLoader() {
 | 
			
		||||
            generateSequence { zipInputStream.nextEntry }
 | 
			
		||||
                .filterNot { it.isDirectory }
 | 
			
		||||
                .forEach { entry ->
 | 
			
		||||
                    File(tmpDir, entry.name).also { it.createNewFile() }
 | 
			
		||||
                    File(tmpDir, entry.name.substringAfterLast("/"))
 | 
			
		||||
                        .also { it.createNewFile() }
 | 
			
		||||
                        .outputStream().use { pageOutputStream ->
 | 
			
		||||
                            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
 | 
			
		||||
                                pageOutputStream.write(zipInputStream.readNBytes(entry.size.toInt()))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user