sensepost / objection

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

[bug] kalis version of apktool not recognized correctly #444

Closed Lem closed 3 years ago

Lem commented 3 years ago

Describe the bug With Kali updated to the latest version, apktool will be installed in version 2.5.0. Sadly the _parseversion function from _pkgresources seems to have trouble recognizing the provided version by apktool as newer. Therefor the process will be aborted.

To Reproduce Steps to reproduce the behavior:

  1. Upgrade to latest kali
  2. Upgrade/Install apktool
  3. Run patchapk 'objection patchapk --source orginal.apk '

Similar issues N/A

Expected behavior Version 2.5.0-dirty should be recognized as a newer as 2.4.1.

Evidence / Logs / Screenshots Any output from objection, such as stack traces or errors that occurred. Be sure to run objection with the --debug flag so that errors from the agent are verbose enough to debug. For example:

user@kali:~/$ objection --debug patchapk --source BLA.apk 
No architecture specified. Determining it using `adb`...
Detected target device architecture as: arm64-v8a
Using latest Github gadget version: 14.2.13
Patcher will be using Gadget version: 14.2.13
Detected apktool version as: 2.5.0-dirty
apktool version should be at least 2.4.1
Please see the following URL for more information: https://github.com/sensepost/objection/wiki/Apktool-Upgrades
apktool is not ready for use
Cleaning up temp files...
user@kali:~/$ apt info apktool
Package: apktool
Version: 2.5.0+dfsg.1-2
Priority: optional
Section: devel
[...]
user@kali:~/$ apktool -v
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Apktool v2.5.0-dirty - a tool for reengineering Android apk files
with smali v2.4.0-debian and baksmali v2.4.0-debian
Copyright 2010 Ryszard Wiśniewski <brut.alll@gmail.com>
[...]

Environment (please complete the following information):

Application N/A

Additional context N/A

leonjza commented 3 years ago

I tried to find out what exactly the -dirty tag actually means, and resorted to asking instead. One route we can take is to just strip -dirty, but I would love to know what it means first.

leonjza commented 3 years ago

Ok based on this response we can just strip out -dirty from the version output.

leonjza commented 3 years ago

Should be fixed in #449, and part of a tagged release later today.