juanmuscaria / blockheads-patch

Fixes annoying issues with the blockheads in modern android
11 stars 2 forks source link

FileNotFoundError: [Errno 2] No such file or directory: '_agent.js' #8

Closed Slinky5880 closed 4 months ago

Slinky5880 commented 4 months ago

It's been 6 hours that I'm trying and there's always new issues I'M DDEEEEEAAAAADDD X-(

Command entered: ./patchApk.sh

Traceback (most recent call last): File "/home/elwan/.local/bin/objection", line 8, in sys.exit(cli()) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/elwan/.local/lib/python3.8/site-packages/objection/console/cli.py", line 373, in patchapk patch_android_apk(locals()) File "/home/elwan/.local/lib/python3.8/site-packages/objection/commands/mobile_packages.py", line 208, in patch_android_apk shutil.copyfile(script_source, File "/usr/lib/python3.8/shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: '_agent.js' Cleaning up temp files... cp: cannot stat './base.objection.apk': No such file or directory

I think the main issue is with the supposed _agent.js file, I didn't find it anywhere

Slinky5880 commented 4 months ago

the full command line output:

`elwan@elwan-Satellite-C650D:~ /blockheads-patch$ ./patchApk.sh /usr/lib/python3/dist-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (1.26.15) or chardet (3.0.4) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " Using latest Github gadget version: 16.3.3 Patcher will be using Gadget version: 16.3.3 Detected apktool version as: 2.9.3 Running apktool empty-framework-dir... I: Removing 1.apk framework file... Unpacking base.apk App already has android.permission.INTERNET Target class not specified, searching for launchable activity instead... Reading smali from: /tmp/tmp08enq831.apktemp/smali/com/apportable/activity/VerdeActivity.smali Injecting into an existing constructor Injecting loadLibrary call at line: 56 Attempting to fix the constructors .locals count Current locals value is 1, updating to 2: Writing patched smali back to: /tmp/tmp08enq831.apktemp/smali/com/apportable/activity/VerdeActivity.smali Copying Frida gadget to libs path... Adding a gadget configuration file... Copying over a custom script to use with the gadget config. Traceback (most recent call last): File "/home/elwan/.local/bin/objection", line 8, in sys.exit(cli()) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1157, in call return self.main(args, kwargs) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/elwan/.local/lib/python3.8/site-packages/click/core.py", line 783, in invoke return __callback(args, kwargs) File "/home/elwan/.local/lib/python3.8/site-packages/objection/console/cli.py", line 373, in patchapk patch_android_apk(locals()) File "/home/elwan/.local/lib/python3.8/site-packages/objection/commands/mobile_packages.py", line 208, in patch_android_apk shutil.copyfile(script_source, File "/usr/lib/python3.8/shutil.py", line 264, in copyfile with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst: FileNotFoundError: [Errno 2] No such file or directory: '_agent.js' Cleaning up temp files... cp: cannot stat './base.objection.apk': No such file or directory elwan@elwan-Satellite-C650D:~ /blockheads-patch$

`

Slinky5880 commented 4 months ago

file _agent.js is nowhere to be found

Slinky5880 commented 4 months ago

I fixed it! (I think)

I moved index.ts out of the agent folder, then edited the patchApk.sh file by replacing _agent.js with index.ts.

Like this: original: objection patchapk -s base.apk -c config.json -m manifest.xml -l _agent.js --architecture armeabi-v7a fix: objection patchapk -s base.apk -c config.json -m manifest.xml -l index.ts --architecture armeabi-v7a