When manually deleting files from a .apk file (I know this breaks signing and what not but I wanted to test something) it asks whether I'm really sure and then removes the file from the list. However, it didn't actually delete the file and on re-opening the file the next time it's there again (also file size didn't change). If I just rename the file from .apk to .zip it works just fine. Wild guess: could it be that the zip cmdline tool it uses in the background refuses because it doesn't have a "zip" file extension? In any case it should not lie to me by showing the file being succesfully deleted. ;)
I can't reproduce with a random apk archive from the internet. Tried with both cli7z and clizip plugins. Can you set: QT_LOGGING_RULES=ark.*.debug=true and then reproduce the problem and attach console output? Does it happen with all apk archives? If not, can you provide a link to the affected archive or upload it (if small)? What is your version of Ark?
Sorry, forgot to set the version field, version is 16.12.2. For me it also happens with other APKs I did not create myself. Running ark with logging enabled: ark.main: Trying to open QUrl("file:///home/foo/test.apk") ark.part: Attempting to open archive "/home/foo/test.apk" ark.kerfuffle: Going to create archive "/home/foo/test.apk" ark.kerfuffle: Mimetype for filename extension ( "application/vnd.android.package-archive" ) did not match mimetype for content ( "application/zip" ). Using content-based mimetype. ark.kerfuffle: Checking plugin "kerfuffle_cli7z" ark.kerfuffle: Created read-only interface for "/home/foo/test.apk" ark.kerfuffle: Mimetype for filename extension ( "application/vnd.android.package-archive" ) did not match mimetype for content ( "application/zip" ). Using content-based mimetype. ark.kerfuffle: Created read-write interface for "/home/foo/test.apk" ark.cli7z: Loaded cli_7z plugin ark.cli7z: Setting up parameters... ark.kerfuffle: Successfully loaded plugin "kerfuffle_cli7z" ark.kerfuffle: Created archive instance ark.kerfuffle: LoadJob created ark.main: Entering application loop ark.kerfuffle: Executing "/usr/bin/7z" ("l", "-slt", "/home/foo/test.apk") within directory "/home/broulik/Projekte/kf5/plasma-workspace/build" ark.cli7z: p7zip version "9.20" detected ark.cli7z: Archive name: "/home/foo/test.apk" ark.cli7z: Archive type: "zip" ark.part: Showing columns: (0, 1, 2, 3, 7, 8, 10) ark.kerfuffle: Process finished, exitcode: 0 exitstatus: QProcess::ExitStatus(NormalExit) ark.kerfuffle: Job finished, result: true , time: 1393 ms ark.kerfuffle: Mimetype for filename extension ( "application/vnd.android.package-archive" ) did not match mimetype for content ( "application/zip" ). Using content-based mimetype. *** Chose to delete a file *** ark.kerfuffle: Going to delete 1 entries ark.kerfuffle: Executing "/usr/bin/7z" ("d", "/home/foo/test.apk", "AndroidManifest.xml") within directory "/home/broulik/Projekte/kf5/plasma-workspace/build" ark.kerfuffle: Process finished, exitcode: 2 exitstatus: QProcess::ExitStatus(NormalExit) ark.kerfuffle: Job finished, result: true , time: 22 ms File is still there. When I run the command manually I get "Error: /home/foo/test.apk is not supported archive" and an exit code of 2.
Ok so seems to be a problem with 7z. I noticed you're using an old version (9.20). Can you try updating to a more recent version of 7z?
I'm using whatever KDE neon / its Ubuntu base provides. In any case it should handle such a scenario gracefully.
I can confirm that deleting files from apk-archives with 7z v9.20 doesn't work. No problem with 7z v9.38.1 or later.
Git commit f8df291a061f4f6e078cb57f40bd9182b799617d by Ragnar Thomsen. Committed on 13/03/2017 at 18:26. Pushed by rthomsen into branch 'master'. cli7z: Catch error from p7zip 9.20 when deleting files from APK archives 7z 9.20 does not seem to support deleting files from APK archives (Android Application Packages) even though these are zip archives. A new member function named readDeleteLine() was added to CliInterface. The function is overridden in the cli7z plugin and catches the error message from 7z when attempting to delete files. FIXED-IN: 17.04.0 Differential Revision: D5011 M +10 -0 kerfuffle/cliinterface.cpp M +1 -0 kerfuffle/cliinterface.h M +12 -0 plugins/cli7zplugin/cliplugin.cpp M +1 -0 plugins/cli7zplugin/cliplugin.h https://commits.kde.org/ark/f8df291a061f4f6e078cb57f40bd9182b799617d