Skip to content

[feature request] improve error handling when input is not .apk (output/exit code) #36

@ghost

Description

I often sign zip, jars etc..
kind of feeded a zip to a batch file using uber-apk-signer,
and got

provided apk path or file 'D:\sample.zip' does not exist
java.lang.IllegalArgumentException: provided apk path or file 'D:\sample.zip' does not exist
        at at.favre.tools.apksigner.ui.FileArgParser.parseAndSortUniqueFilesNonRecursive(FileArgParser.java:38)
        at at.favre.tools.apksigner.SignTool.execute(SignTool.java:60)
        at at.favre.tools.apksigner.SignTool.mainExecute(SignTool.java:45)
        at at.favre.tools.apksigner.SignTool.main(SignTool.java:33)

Cmd history for debugging purpose:
-----------------------

(exit code 1).

tries multiple variations of the arguments (including normalizing paths from backslash to forward slash),
until I've changed the extension to APK.

obviously it makes sense that u.a.s. only handles apk files (it's in the name..).

it seems like an exception that wasn't caught and thrown up until it got the the file-path exception handling method.

I personally transitioned from jarsigner, to apksigner (both can handle ZIP-DEFLATE),
to u.a.s., and a nice message (or even a meaningful exit code) would help a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions