sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.46k stars 854 forks source link

Error: Missing option '--source' / '-s'. #339

Closed debug998 closed 4 years ago

debug998 commented 4 years ago

Describe the bug Mission option error when option was provided

To Reproduce Steps to reproduce the behavior:

  1. install objection
    pip install objection
  2. try to run patchapk
    
    $ objection patchapk –s app_name.apk 
    Usage: objection patchapk [OPTIONS]
    Try 'objection patchapk --help' for help.

Error: Missing option '--source' / '-s'.


**Expected behavior**
I've given it a source file, so there should be no error regarding mission source option.

**Evidence / Logs / Screenshots**

$ objection --debug patchapk –s app_name.apk Usage: objection patchapk [OPTIONS] Try 'objection patchapk --help' for help.

Error: Missing option '--source' / '-s'.



**Environment (please complete the following information):**
 - Device: Mac OS
 - OS: Mac
 - Frida Version 12.8.14
- Objection Version 1.8.4

**Additional context**
Add any other context about the problem here.
leonjza commented 4 years ago

Hey! This makes no sense. The definition for --source / -s is here. Could you show me the output of objection patchapk --help?

debug998 commented 4 years ago
$ objection patchapk --help
Usage: objection patchapk [OPTIONS]

  Patch an APK with the frida-gadget.so.

Options:
  -s, --source TEXT              The source APK to patch  [required]
  -a, --architecture TEXT        The architecture of the device the patched
                                 APK will run on. This can be determined with
                                 `adb shell getprop ro.product.cpu.abi`. If it
                                 is not specified, this command will try and
                                 determine it automatically.

  -V, --gadget-version TEXT      The gadget version to use. If not specified,
                                 the latest version will be used.

  -p, --pause                    Pause the patcher before rebuilding the APK.
                                 [default: False]

  -k, --skip-cleanup             Do not clean temporary files once finished.
                                 [default: False]

  -d, --enable-debug             Set the android:debuggable flag to true in
                                 the application manifiest.  [default: False]

  -N, --network-security-config  Include a network_security_config.xml file
                                 allowing for user added CA's to be trusted on
                                 Android 7 and up. This option can not be used
                                 with the --skip-resources flag.

  -D, --skip-resources           Skip resource decoding as part of the apktool
                                 processing.

  -t, --target-class TEXT        The target class to patch.
  -2, --use-aapt2                Use the aapt2 binary instead of aapt as part
                                 of the apktool processing.

  --help                         Show this message and exit.
leonjza commented 4 years ago

I have no idea. You can see from the help the flag is there. 🤔

leonjza commented 4 years ago

Actually, it looks like the -s in your OP is not using a normal dash -, but rather an 'emdash' -.

debug998 commented 4 years ago

That was it! Great eye. I must have copied the command from somewhere with formatting. Thanks!