tweaselORG / cli

Command-line tool for the libraries of the tweasel project.
MIT License
4 stars 0 forks source link

Is there a working version of tweasel-cli right now? #38

Closed SheldorSheldonDZ closed 1 week ago

SheldorSheldonDZ commented 1 month ago

Hey @baltpeter @zner0L ,

I've been trying to install Tweasel recently and I've been encountering some deep and complex errors. The project has been ongoing for a while now, but I still haven't managed to get a properly working version.

When I attempt to install Tweasel via npm, I encounter a Meson/Frida error (see Error 1 below). On the other hand, if I try to install it via Yarn, the installation is successful and I can start Tweasel. However, when I try to run the 'record-traffic' command, I encounter an 'ERR_IMPORT_ASSERT_TYPE_MISSING' error (see my comment at cyanoacrylate (see Error 2). I even tried installing an older version of Tweasel (version 0.2.3) (anything under 1.0.0 works for me without Error 2), but then I face an issue where Wireguard-Auto-Configuration doesn't work.

It would be very helpful if you could point out if I'm doing something wrong or if there are specific versions I need to install to get Tweasel to work properly.

Thanks in advance!

Error 1:

sudo npm i -g tweasel-cli npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported npm ERR! code 1 npm ERR! path /usr/local/lib/node_modules/tweasel-cli/node_modules/frida npm ERR! command failed npm ERR! command sh -c node scripts/install.js npm ERR! Downloading toolchain 20240627... npm ERR! Extracting toolchain... npm ERR! Downloading SDK 20240627 for linux-x86_64... npm ERR! Extracting SDK... npm ERR! The Meson build system npm ERR! Version: 1.4.99 npm ERR! Source dir: /usr/local/lib/node_modules/tweasel-cli/node_modules/frida npm ERR! Build dir: /usr/local/lib/node_modules/tweasel-cli/node_modules/frida/build npm ERR! Build type: native build npm ERR! Program python3 found: YES (/usr/bin/python3) npm ERR! Project name: frida-node npm ERR! Project version: 16.4.6 npm ERR! C++ compiler for the host machine: /usr/bin/c++ (gcc 13.2.0 "c++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0") npm ERR! C++ linker for the host machine: /usr/bin/c++ ld.bfd 2.42 npm ERR! Host machine cpu family: x86_64 npm ERR! Host machine cpu: x86_64 npm ERR! Program strip found: YES npm ERR! Program node found: YES (/usr/bin/node) npm ERR! Program npm found: YES (/usr/bin/npm) npm ERR! Program python3 found: YES (/usr/bin/python3) npm ERR! Message: Fetching ABI bits npm ERR! npm ERR! meson.build:55:11: ERROR: Command/usr/bin/python3 /usr/local/lib/node_modules/tweasel-cli/node_modules/frida/scripts/fetch-abi-bits.py node '' linux x64 /usr/bin/node /usr/bin/npm /usr/local/lib/node_modules/tweasel-cli/node_modules/frida/build` failed with status 1. npm ERR! npm ERR! A full log can be found at /usr/local/lib/node_modules/tweasel-cli/node_modules/frida/build/meson-logs/meson-log.txt npm ERR! prebuild-install warn install No prebuilt binaries found (target=18.19.1 runtime=node arch=x64 libc= platform=linux) npm ERR! Command '['/usr/bin/python3', '/usr/local/lib/node_modules/tweasel-cli/node_modules/frida/releng/meson/meson.py', 'setup', '-Dprefix=/usr/local', '-Ddefault_library=static', '-Doptimization=s', '-Db_ndebug=true', '-Dstrip=true', '--native-file=/usr/local/lib/node_modules/tweasel-cli/node_modules/frida/build/frida-linux-x86_64.txt', PosixPath('/usr/local/lib/node_modules/tweasel-cli/node_modules/frida/build')]' returned non-zero exit status 1. npm ERR! make: *** [Makefile:4: all] Fehler 1

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2024-07-23T08_26_50_233Z-debug-0.log `

Error 2: ` tweasel Command-line tool for the libraries of the tweasel project.

VERSION tweasel-cli/1.0.1 linux-x64 node-v18.20.4

USAGE $ tweasel [COMMAND]

TOPICS android-emulator Create, start, and delete Android emulators.

COMMANDS autocomplete display autocomplete installation instructions detect-tracking Detect tracking data transmissions from traffic in HAR format. help Display help for tweasel. record-traffic Record the traffic of an Android or iOS app in HAR format.

$ tweasel record-traffic '/home/apppruefung/Schreibtisch/com.lidl.eci.lidlplus_16.8.2-1470400597.apk' TypeError: Module "file:///home/apppruefung/.nvm/versions/node/v18.20.4/li b/node_modules/tweasel-cli/node_modules/appstraction/package.json" needs an import attribute of type "json" Code: ERR_IMPORT_ASSERTION_TYPE_MISSING

`

closureEnv commented 1 month ago

Same here. It seems to be a nightmare to install it through npm. I'm running into a dependency hell.

SheldorSheldonDZ commented 1 month ago

Found a workaround for an yarn-installation. It would be great if someone fix this in future versions but for now you can do this to have a working version: https://github.com/tweaselORG/cyanoacrylate/issues/50

baltpeter commented 1 week ago

Thanks for reporting this @SheldorSheldonDZ and @closureEnv! And sorry for only getting back now, but I was on vacation.

The CLI was actually working fine until we released cyanoacrylate 1.1.0, which introduced the issue you also found.

I hadn't considered that the issue would also affect CLI since I thought that we had pinned the cyanoacrylate version in CLI. But the problem is that we're using a ^ version specifier, which in this case will also allow minor version updates:

https://github.com/tweaselORG/cli/blob/c00d1bada010f140d94fd5c3e1d0fc108e9c1388/package.json#L58

Since I'm not sure how quickly we'll be able to fix https://github.com/tweaselORG/cyanoacrylate/issues/50, I'll do a hotfix release of CLI that properly pins a working cyanoacrylate version.

baltpeter commented 1 week ago

The hotfix is released in v1.0.2. Let me know in case the issue still occurs.

I have opened https://github.com/tweaselORG/cli/issues/40 to track upgrading cyanoacrylate to get the new features.