Can't delete any file inside APK after signed with MT Manager

Support for Android version of Total Commander

Moderators: Hacker, petermad, Stefan2, white

Post Reply
cmingyan
Junior Member
Junior Member
Posts: 12
Joined: 2011-11-24, 08:19 UTC

Can't delete any file inside APK after signed with MT Manager

Post by *cmingyan »

TC Android can delete files inside any APK file.
But if I signed with MT Manager (Just re-signed, does not change any APK compress method or ratio), TC just can view files but can not delete any file inside this APK.It said:
Error, old ZIP file has unsupported format, cannot pack!
You need to unpack all files and create a new ZIP file with them.
And the APK works fine under windows version of TC.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 51481
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Can't delete any file inside APK after signed with MT Manager

Post by *ghisler(Author) »

This happens when Total Commander detects an anomaly in the ZIP headers, e.g. entries which point to nowhere, invalid sizes etc.
Either the ZIP file doesn't follow the ZIP standard, or my packer is too strict.
Could you provide a sample apk for test purposes, please? Maybe there is a way to support the format.
Author of Total Commander
https://www.ghisler.com
cmingyan
Junior Member
Junior Member
Posts: 12
Joined: 2011-11-24, 08:19 UTC

Re: Can't delete any file inside APK after signed with MT Manager

Post by *cmingyan »

ghisler(Author) wrote: 2025-12-03, 10:25 UTC This happens when Total Commander detects an anomaly in the ZIP headers, e.g. entries which point to nowhere, invalid sizes etc.
Either the ZIP file doesn't follow the ZIP standard, or my packer is too strict.
Could you provide a sample apk for test purposes, please? Maybe there is a way to support the format.
I've uploaded sample APK for testing, thank you:
https://upfiles.com/OmvaTdw
User avatar
petermad
Power Member
Power Member
Posts: 16453
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Can't delete any file inside APK after signed with MT Manager

Post by *petermad »

I can confirm that I cannot delete files with TC for Android in the provided "APK Sample Test for TC Android\Signed with MT Manager\QR Scanner 3.1.8-L_MT.apk"
I can also confirm that I can delete files in that .apk when using TC for Windows

I can delete files in the two other provided apk files:
"APK Sample Test for TC Android\Signed with apksigner.jar\QR Scanner 3.1.8-L_AS.apk"
"APK Sample Test for TC Android\Original APK\QR Scanner 3.1.8-L.apk"

When trying to delete files in "QR Scanner 3.1.8-L_MT.apk" - I get the message:
Error

Error, old ZIP file has unsupported format, cannot pack!r
You need to unpack all files and create a new ZIP file with them.

If the apk files are placed on my external SD-card I first get this message:
Write protected!

On Android >=5, the external SD card is write protected.
You need to choose the directory from a special Android dialog to
give Total Commander write rights.

In the next dialog, please go to the root of the external SD-card and
click on the button at the bottom, 'Select'!
I had already done that, so this message is misleading.

[OT]
Notice that the first error message has a typo; "cannot pack!r" "should be "cannot pack!"
And the second error message inconsistently writes: "SD card" and "SD-card"
[/OT]
License #524 1994
Danish Total Commander Translator
TC 11.56 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1400a
TC 3.60 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 51481
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Can't delete any file inside APK after signed with MT Manager

Post by *ghisler(Author) »

Thanks for the test apk files! I have checked them, and the reason is that the order of the files in the archive is not the same as the order in the central directory at the end of the archive. Normally a ZIP archive is build like this:
localHader1 packedFile1, localHader2 packedFile2, localHader3 packedFile3,.....centralHeaderForFile1, centralHeaderForFile2, centralHeaderForFile3...
But in your file it's like this:
localHader1 packedFile1, localHader2 packedFile2, localHader3 packedFile3,.....centralHeaderForFile1, centralHeaderForFile3, centralHeaderForFile2...

My simplified ZIP functions in the Android version cannot handle this and abort the modification of the archive to not cause any damage. Maybe I can sort the central directory before modifying the archive...
Author of Total Commander
https://www.ghisler.com
cmingyan
Junior Member
Junior Member
Posts: 12
Joined: 2011-11-24, 08:19 UTC

Re: Can't delete any file inside APK after signed with MT Manager

Post by *cmingyan »

ghisler(Author) wrote: 2025-12-04, 16:21 UTC My simplified ZIP functions in the Android version cannot handle this and abort the modification of the archive to not cause any damage. Maybe I can sort the central directory before modifying the archive...
You are the respected engineer, thank you. 💯
Post Reply