coronalabs / com.coronalabs-plugin.zip

Rpository for plugin.zip.
MIT License
0 stars 6 forks source link

Password protected zips on Android #7

Open ipsoftdev opened 2 years ago

ipsoftdev commented 2 years ago

Encrypted archives fail to extract on latest Android OSes. No error message is returned. Below are the results of some of the tests I've performed:

// Android emulator (AVD) API 31, 32 - failure API 30, 29 - works

// Android devices Android 9 (API 28) - Sony I3123 - failure Android 11 (API 30) - One Plus 8 Pro - failure

// Amazon devices FireOS 5 (API 22) - works FireOS 7 (API 28) - failure FireOS 8 (API 29/30) - failure

Archives that are not encrypted work fine for all the tests above.

appfamily commented 11 months ago

Simulator also crashes with no output when try to extract password-protected zips

-- Creates archive then immediately try to unzip it

local zip = require( "plugin.zip" )

local function unzipListener( event )
    print(event.type .. ", isError: " .. tostring(event.isError))
end

local function zipListener( event )
    print(event.type .. ", isError: " .. tostring(event.isError))
    local zipOptions =
    {
        zipFile = "Exports.zip",
        zipBaseDir = system.TemporaryDirectory,
        dstBaseDir = system.TemporaryDirectory,
        listener = unzipListener,
        password = 123
    }
    zip.uncompress( zipOptions )
end

local zipOptions = {
    zipFile = "Exports.zip",
    zipBaseDir = system.TemporaryDirectory,
    srcBaseDir = system.ResourceDirectory,
    srcFiles = {"build.settings"},
    listener = zipListener,
    password = 123
}
zip.compress( zipOptions )
appfamily commented 7 months ago

For the record: