Skip to content

Latest commit

 

History

History
154 lines (91 loc) · 3.86 KB

File metadata and controls

154 lines (91 loc) · 3.86 KB

Use GramAddict without pc

Step 1a: If you don't have Termux installed

You can download Termux from f-droid or the Google Play store. Get the f-droid version, since the Play store version does not support some features.

Apk from f-droid

Step 1b: If you have Termux installed

To get this to work, we need to delete all pip packages and python

# Remove all python packages

pip freeze > unins && pip uninstall -y -r unins && rm unins

# Find the path of the cache for pip...

pip cache dir

# ... and clean it

rm -rf /data/data/com.termux/files/home/.cache/pip

# Delete python completely

apt remove --purge python

Step 2: Install required packages

pkg upgrade -y
pkg install build-essential clang make pkg-config
curl -LO https://its-pointless.github.io/setup-pointless-repo.sh
bash setup-pointless-repo.sh
pkg install android-tools cmake libcompiler-rt pytz cython setuptools libjpeg-turbo libpng libxml2 libxslt freetype git libtiff -y

# install numpy and scipy with pkg NOT with pip

pkg install numpy

pkg install scipy

xport CFLAGS=" -Wno-deprecated-declarations -Wno-unreachable-code"

export LDFLAGS=" -lm -lcompiler_rt"

# install Pandas, this can take hours, depends on your device (I don't recommend doing this over ssh)

pip install pandas

Step 3: Install GramAddict

Termux puts all your files in an emulated folder structure, which can be annoying. You can install GramAddict onto a normal folder:

# give Termux permission to access your device's storage

termux-setup-storage

# cd into the non-emulated /sdcard/ folder

cd /sdcard

This procedure is slow, use -vvv in pip if you want to see if everything installing alright

# download and install GramAddict

git clone https://github.com/gramaddict/bot.git gramaddict

cd gramaddict

# I don't recommend doing this over ssh

pip install -r requirements.txt

pip install GramAddict[telegram-reports]

Step 4: Config

# make accounts folder and folder for your account

mkdir accounts

mkdir accounts/[your-account-name]

# download the config examples and put them in the correct folder

wget -O - https://github.com/GramAddict/bot/archive/master.tar.gz | tar -xz --strip=2 "bot-master/config-examples"

mv -v config-examples/* accounts/[your-account-name]

# edit the files using nano

nano accounts/[your-account-name]/config.yml

nano accounts/[your-account-name]/filters.yml

nano accounts/[your-account-name]/telegram.yml

# etc

Step 5: Run

# enable wake lock to make sure your device does not go into deep sleep

termux-wake-lock

python -m uiautomator2 init

python run.py

How can I access termux files?

Read that article https://wiki.termux.com/wiki/Internal_and_external_storage

The easiest solution is to download an storage access framework compatible file manager like FX File Explorer Then you can follow that instructions https://wiki.termux.com/images/e/e5/FX_Termux_Home.jpg Then you can edit and view GramAddict files.

Troubleshooting

  • if you type on termux adb devices and you get a blank list try the following:
    • connect the phone to a PC and get sure you get your device ID in adb devices (from pc console)
    • adb tcpip 5555
    • adb kill-server and disconnect the cable
    • get back on termux and write: adb connect localhost:5555
    • now you should be able to see your device ID in adb devices
  • when I start the bot it looks like it freezes after opening IG and termux shell has been closed
    • edit your accounts/yourusername/config.yml file and set close-apps: false
  • I am connected, it says my device is not connected when I run GramAddict
    • adb devices
    • check the ID of your device, it might have changed to emulator-5554
    • update the device ID in the config file

All credits to patbengr