Skip to content

feat: Improve unmount validationΒ #362

Open
@laur89

Description

@laur89

Feature description

Improve utility uninstall output & argument validation. Current exit code & stdout messages always imply the operation was successful (and that anything was done at all).

  1. Example one: phone not connected to PC:
$ java -jar revanced-cli-5.0.1-all.jar utility uninstall --package-name com.no.such.pkg --unmount
SEVERE: app.revanced.library.installation.installer.DeviceNotFoundException: No ADB device found 
INFO: Uninstalled the patched APK file
  1. Example two: adb link exists, but unmounting a nonexisting package:
$ java -jar revanced-cli-5.0.1-all.jar utility uninstall --package-name com.no.such.pkg --unmount
WARNING: No device serial supplied. Using device with serial b7a7a89a 
INFO: Uninstalling com.no.such.pkg by unmounting 
INFO: Uninstalled the patched APK file

Same happens with existing packages that were not mounted to begin with.
Also it's not limited to --unmount option - uninstall operation without it always appear to succeed the same.


It would be useful if there were validation done whether the package:

  1. we're operating on is installed;
  2. is even mounted - if not, --unmount operation should error out;

Basically, process should exit with 0 only if the requested operation was actually performed & successful.

Motivation

Appropriate exit code & stdout/stderr messages make it easier too detect user error. Easy to make typos with longer package names, and if exit code & messaging is always successful, it's hard to tell whether intended action was completed.

Arguably it's also a bug if it always prints INFO: Uninstalled the patched APK file, even if package isn't installed.

Acknowledgements

  • I have checked all open and closed feature requests and this is not a duplicate.
  • I have chosen an appropriate title.
  • All requested information has been provided properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions