sensepost / objection

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

Objection Patchapk #568

Closed flamecopper closed 1 week ago

flamecopper commented 1 year ago

Objection patchapk api

**An error may have occurred while extracting the APK. Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true W: Could not decode attr value, using undecoded value instead: ns=android, name=resource, value=0x79020000 [Fatal Error] :45:405: Element type "application" must be followed by either attribute specifications, ">" or "/>".

App already has android.permission.INTERNET Traceback (most recent call last): File "/usr/local/bin/objection", line 8, in sys.exit(cli()) File "/usr/lib/python3/dist-packages/click/core.py", line 1126, in call return self.main(args, kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 1051, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/lib/python3/dist-packages/click/core.py", line 1393, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 752, in invoke return __callback(args, kwargs) File "/usr/local/lib/python3.9/dist-packages/objection/console/cli.py", line 373, in patchapk patch_android_apk(locals()) File "/usr/local/lib/python3.9/dist-packages/objection/commands/mobile_packages.py", line 195, in patch_android_apk patcher.extract_native_libs_patch() File "/usr/local/lib/python3.9/dist-packages/objection/utils/patchers/android.py", line 460, in extract_native_libs_patch xml = self._get_android_manifest() File "/usr/local/lib/python3.9/dist-packages/objection/utils/patchers/android.py", line 296, in _get_android_manifest return ElementTree.parse(os.path.join(self.apk_temp_directory, 'AndroidManifest.xml')) File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 1229, in parse tree.parse(source, parser) File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 580, in parse self._root = parser._parse_whole(source) xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 45, column 404 Cleaning up temp files... **

Candas1 commented 1 year ago

https://github.com/iBotPeaches/Apktool/issues/2972

IPMegladon commented 1 week ago

As mentioned this is likely caused by apktool, it has been fixed in newer versions and can thus be resolved by manually installing an updated version of apktool as per https://apktool.org/docs/install/