sensepost / objection

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

[bug] Apktool version detection #364

Closed Fisjkars closed 4 years ago

Fisjkars commented 4 years ago

Describe the bug Issue in the version detector for apktool on Windows 10

To Reproduce Steps to reproduce the behavior: objection patchapk -s .\base.apk

Evidence / Logs / Screenshots The stacktrace I had :

objection patchapk -s .\base.apk
No architecture specified. Determining it using `adb`...
Detected target device architecture as: arm64-v8a
Using latest Github gadget version: 12.8.20
Patcher will be using Gadget version: 12.8.20
Detected apktool version as: 2.4.1
Appuyez sur une touche pour continuer...
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...
Failed to cleanup with error: [WinError 2] Le fichier spécifié est introuvable: 'C:\\Users\\blah\\AppData\\Local\\Temp\\tmp51gd96lf.apktemp.objection.apk'
objection --debug explore

Environment (please complete the following information):

leonjza commented 4 years ago

Unfortunately Windows support is limited. PR's welcome to fix it though.

loic-bellinger commented 4 years ago

I'm also facing the issue. Quite frustrating.

leonjza commented 4 years ago

I'm also facing the issue. Quite frustrating.

Happy to take a PR to improve this.

loic-bellinger commented 4 years ago

Alright so this is related to this other issue. In \objection\utils\patchers\android.py line 228:

# windows / delegator weirdness...
if 'Press any key to continue . . .' in o:
    o = o.split('\n')[0]

The 'Press any key to continue . . .' check won't work if your os language is not in english. For instance, if you're using French, the check should be:

if 'Appuyez sur une touche pour continuer...' in o:

Changing this worked for me.

leonjza commented 4 years ago

I just released 1.9.2 with a more generic approach to this Windows weirdness.